chunkify

package module
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Chunkify Go API Library

Go Reference

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

It is generated with Stainless.

Installation

import (
	"github.com/chunkifydev/chunkify-go" // imported as chunkify
)

Or to pin the version:

go get -u 'github.com/chunkifydev/chunkify-go@v0.17.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/chunkifydev/chunkify-go"
	"github.com/chunkifydev/chunkify-go/option"
)

func main() {
	client := chunkify.NewClient(
		option.WithProjectAccessToken("My Project Access Token"), // defaults to os.LookupEnv("CHUNKIFY_TOKEN")
	)
	asset, err := client.Assets.New(context.TODO(), chunkify.AssetNewParams{
		SourceID: "src_2G6MJiNz71bHQGNzGwKx5cJwPFS",
		Title:    chunkify.String("Launch video"),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", asset.ID)
}

Request fields

The chunkify 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, chunkify.String(string), chunkify.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 := chunkify.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: chunkify.String("..."), // optional property

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

	Origin: chunkify.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[chunkify.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 := chunkify.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Assets.List(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:

iter := client.Sources.ListAutoPaging(context.TODO(), chunkify.SourceListParams{
	Limit: chunkify.Int(30),
})
// Automatically fetches more pages as needed.
for iter.Next() {
	source := iter.Current()
	fmt.Printf("%+v\n", source)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

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

page, err := client.Sources.List(context.TODO(), chunkify.SourceListParams{
	Limit: chunkify.Int(30),
})
for page != nil {
	for _, source := range page.Data {
		fmt.Printf("%+v\n", source)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *chunkify.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.Assets.List(context.TODO(), chunkify.AssetListParams{})
if err != nil {
	var apierr *chunkify.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 "/assets": 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.Assets.List(
	ctx,
	chunkify.AssetListParams{},
	// 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 chunkify.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 := chunkify.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Assets.List(
	context.TODO(),
	chunkify.AssetListParams{},
	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
page, err := client.Assets.List(
	context.TODO(),
	chunkify.AssetListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", page)

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: chunkify.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 := chunkify.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

View Source
const ChunkifyErrorTypeCancelled = shared.ChunkifyErrorTypeCancelled

Equals "cancelled"

View Source
const ChunkifyErrorTypeDownload = shared.ChunkifyErrorTypeDownload

Equals "download"

View Source
const ChunkifyErrorTypeFfmpeg = shared.ChunkifyErrorTypeFfmpeg

Equals "ffmpeg"

View Source
const ChunkifyErrorTypeIngest = shared.ChunkifyErrorTypeIngest

Equals "ingest"

View Source
const ChunkifyErrorTypeJob = shared.ChunkifyErrorTypeJob

Equals "job"

View Source
const ChunkifyErrorTypePermission = shared.ChunkifyErrorTypePermission

Equals "permission"

View Source
const ChunkifyErrorTypeSetup = shared.ChunkifyErrorTypeSetup

Equals "setup"

View Source
const ChunkifyErrorTypeSource = shared.ChunkifyErrorTypeSource

Equals "source"

View Source
const ChunkifyErrorTypeTimeout = shared.ChunkifyErrorTypeTimeout

Equals "timeout"

View Source
const ChunkifyErrorTypeUnexpected = shared.ChunkifyErrorTypeUnexpected

Equals "unexpected"

View Source
const ChunkifyErrorTypeUpload = shared.ChunkifyErrorTypeUpload

Equals "upload"

Variables

This section is empty.

Functions

func Bool added in v0.6.0

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

func BoolPtr added in v0.6.0

func BoolPtr(v bool) *bool

func DefaultClientOptions added in v0.6.0

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (CHUNKIFY_TOKEN, CHUNKIFY_TEAM_TOKEN, CHUNKIFY_WEBHOOK_SECRET, CHUNKIFY_BASE_URL). This should be used to initialize new clients.

func File

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

func Float added in v0.6.0

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

func FloatPtr added in v0.6.0

func FloatPtr(v float64) *float64

func Int added in v0.6.0

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

func IntPtr added in v0.6.0

func IntPtr(v int64) *int64

func Opt added in v0.6.0

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

func Ptr added in v0.6.0

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

func String added in v0.6.0

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

func StringPtr added in v0.6.0

func StringPtr(v string) *string

func Time added in v0.6.0

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

func TimePtr added in v0.6.0

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

Types

type AnalyticsConnection added in v0.17.0

type AnalyticsConnection struct {
	// Id identifies this saved analytics connection.
	ID string `json:"id" api:"required"`
	// CreatedAt records when this connection was added.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// DefaultForDashboard selects this connection for Chunkify dashboard players,
	// public previews, the playground and newly generated snippets. It does not change
	// existing external players. At most one connection per project is selected.
	DefaultForDashboard bool `json:"default_for_dashboard" api:"required"`
	// Endpoint specifies the analytics server base URL. It does not configure the
	// player.
	Endpoint string `json:"endpoint" api:"required" format:"uri"`
	// Name identifies this connection in the dashboard.
	Name string `json:"name" api:"required"`
	// ProjectId identifies the owning Chunkify project.
	ProjectID string `json:"project_id" api:"required"`
	// Status indicates whether the connection is ready to read or requires setup
	// repair.
	//
	// Any of "preparing", "ready", "failed".
	Status AnalyticsConnectionStatus `json:"status" api:"required"`
	// Type specifies whether Chunkify manages the analytics project.
	//
	// Any of "hosted", "custom".
	Type AnalyticsConnectionType `json:"type" api:"required"`
	// UpdatedAt records when this connection was last changed.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// AllowedOrigins lists additional website origins permitted to ingest events for a
	// hosted connection. Shared installation origins remain allowed. An empty list
	// clears project-specific origins. Custom servers manage origins on their own
	// infrastructure.
	AllowedOrigins []string `json:"allowed_origins"`
	// LastCheckedAt records the most recent successful connection check.
	LastCheckedAt time.Time `json:"last_checked_at" format:"date-time"`
	// PublicIngestKey is the public browser ingestion key used by Chunkify previews
	// and player examples. It cannot read or manage analytics. Hosted connections use
	// their primary public key. Omitted when preview tracking is not configured.
	PublicIngestKey string `json:"public_ingest_key"`
	// RetentionSeconds is the last retention applied to a hosted project, in seconds.
	// Omitted for custom connections.
	RetentionSeconds int64 `json:"retention_seconds"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		CreatedAt           respjson.Field
		DefaultForDashboard respjson.Field
		Endpoint            respjson.Field
		Name                respjson.Field
		ProjectID           respjson.Field
		Status              respjson.Field
		Type                respjson.Field
		UpdatedAt           respjson.Field
		AllowedOrigins      respjson.Field
		LastCheckedAt       respjson.Field
		PublicIngestKey     respjson.Field
		RetentionSeconds    respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A saved source for analytics reports. The dashboard player default is independent of the connection selected in reports. External players keep their own configuration. Only the public ingest key is included; read and management credentials stay private.

func (AnalyticsConnection) RawJSON added in v0.17.0

func (r AnalyticsConnection) RawJSON() string

Returns the unmodified JSON received from the API

func (*AnalyticsConnection) UnmarshalJSON added in v0.17.0

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

type AnalyticsConnectionStatus added in v0.17.0

type AnalyticsConnectionStatus string

Status indicates whether the connection is ready to read or requires setup repair.

const (
	AnalyticsConnectionStatusPreparing AnalyticsConnectionStatus = "preparing"
	AnalyticsConnectionStatusReady     AnalyticsConnectionStatus = "ready"
	AnalyticsConnectionStatusFailed    AnalyticsConnectionStatus = "failed"
)

type AnalyticsConnectionType added in v0.17.0

type AnalyticsConnectionType string

Type specifies whether Chunkify manages the analytics project.

const (
	AnalyticsConnectionTypeHosted AnalyticsConnectionType = "hosted"
	AnalyticsConnectionTypeCustom AnalyticsConnectionType = "custom"
)

type AnalyticsKey added in v0.17.0

type AnalyticsKey struct {
	// Id identifies this key in the collector.
	ID string `json:"id" api:"required"`
	// Purpose distinguishes player ingestion, read-only API access and a separate
	// read-only MCP credential. Read and MCP keys have the same collector permissions.
	//
	// Any of "player", "read", "mcp".
	Purpose AnalyticsKeyPurpose `json:"purpose" api:"required"`
	// PublicKey is the browser ingestion credential for a player key. Omitted for
	// read-only API and MCP keys, whose secret values are shown once.
	PublicKey string `json:"public_key"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Purpose     respjson.Field
		PublicKey   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One key per purpose. Public player values remain available; read and MCP values are returned only on creation or rotation.

func (AnalyticsKey) RawJSON added in v0.17.0

func (r AnalyticsKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*AnalyticsKey) UnmarshalJSON added in v0.17.0

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

type AnalyticsKeyPurpose added in v0.17.0

type AnalyticsKeyPurpose string

Purpose distinguishes player ingestion, read-only API access and a separate read-only MCP credential. Read and MCP keys have the same collector permissions.

const (
	AnalyticsKeyPurposePlayer AnalyticsKeyPurpose = "player"
	AnalyticsKeyPurposeRead   AnalyticsKeyPurpose = "read"
	AnalyticsKeyPurposeMcp    AnalyticsKeyPurpose = "mcp"
)

type Asset added in v0.17.0

type Asset struct {
	// Unique Asset ID.
	ID string `json:"id" api:"required"`
	// Whether the Asset can accept new static rendition requests. Creation can still
	// fail if the original video is no longer accessible.
	CanAddStaticRenditions bool `json:"can_add_static_renditions" api:"required"`
	// When the Asset was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Maximum streaming resolution selected at creation. Does not limit static
	// renditions.
	//
	// Any of "1080p", "2160p".
	MaxResolution AssetMaxResolution `json:"max_resolution" api:"required"`
	// String metadata attached to the Asset.
	Metadata map[string]string `json:"metadata" api:"required"`
	// Minimum streaming resolution selected at creation. auto means no minimum;
	// smaller sources are not upscaled.
	//
	// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
	MinResolution AssetMinResolution `json:"min_resolution" api:"required"`
	// Whether HLS playback is available, including while the Asset is preparing.
	PlaybackReady bool `json:"playback_ready" api:"required"`
	// Allow public preview access without an API token. Does not control CDN or static
	// download access. Disabling it does not revoke signed URLs already issued.
	PreviewEnabled bool `json:"preview_enabled" api:"required"`
	// Original media metadata saved at Asset creation and preserved after Source
	// deletion.
	SourceMetadata AssetSourceMetadata `json:"source_metadata" api:"required"`
	// Status specifies the Asset preparation state. ready means the video is prepared
	// for playback, with its poster and timeline previews available. Static renditions
	// and captions have independent statuses.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status AssetStatus `json:"status" api:"required"`
	// ID of the output Storage.
	StorageID string `json:"storage_id" api:"required"`
	// Asset title.
	Title string `json:"title" api:"required"`
	// When the Asset was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Selected Workflow ID, or null.
	WorkflowID string `json:"workflow_id" api:"required"`
	// Pinned Workflow revision, or null.
	WorkflowRevision int64 `json:"workflow_revision" api:"required"`
	// Unsigned CDN URL of the HLS master playlist. Available when playback_ready is
	// true and Storage has a CDN URL.
	CdnURL string `json:"cdn_url" format:"uri"`
	// CreatedByTokenId specifies the Project token used to create the resource. It
	// remains set after the token is revoked. Omitted for dashboard requests, MCP
	// OAuth connections, Workflow actions, and unknown creators.
	CreatedByTokenID string `json:"created_by_token_id"`
	// CreatedByUserId specifies the team member who created the resource. Omitted for
	// Workflow actions, unknown creators, and deleted accounts.
	CreatedByUserID string `json:"created_by_user_id"`
	// CreatedVia specifies how the resource was created: api for API requests,
	// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
	// Workflow actions. Omitted when the creator is unknown.
	//
	// Any of "api", "dashboard", "mcp", "workflow".
	CreatedVia AssetCreatedVia `json:"created_via"`
	Error      AssetError      `json:"error"`
	// When managed outputs expire, 24 hours after readiness. Omitted for
	// customer-connected Storage.
	ExpiresAt time.Time `json:"expires_at" format:"date-time"`
	// Path of the HLS master playlist in Storage. Available when playback_ready is
	// true.
	PlaybackPath string `json:"playback_path"`
	// When HLS playback first became available.
	PlaybackReadyAt time.Time `json:"playback_ready_at" format:"date-time"`
	// Poster image, available once generated.
	Poster AssetPoster `json:"poster"`
	// Public HLS preview URL. Available when playback_ready and preview_enabled are
	// true. No API token is required.
	PreviewURL string `json:"preview_url" format:"uri"`
	// When all required Asset outputs finished processing.
	ReadyAt time.Time `json:"ready_at" format:"date-time"`
	// Size specifies the total bytes of available streaming, playback preview, poster,
	// and timeline files. Excludes static renditions. Omitted until the Asset is
	// ready.
	Size int64 `json:"size"`
	// Original Source ID. Omitted after Source deletion.
	SourceID string `json:"source_id"`
	// Timeline thumbnails. The WebVTT file maps video timestamps to image URLs and
	// crop coordinates.
	TimelinePreviews AssetTimelinePreviews `json:"timeline_previews"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                     respjson.Field
		CanAddStaticRenditions respjson.Field
		CreatedAt              respjson.Field
		MaxResolution          respjson.Field
		Metadata               respjson.Field
		MinResolution          respjson.Field
		PlaybackReady          respjson.Field
		PreviewEnabled         respjson.Field
		SourceMetadata         respjson.Field
		Status                 respjson.Field
		StorageID              respjson.Field
		Title                  respjson.Field
		UpdatedAt              respjson.Field
		WorkflowID             respjson.Field
		WorkflowRevision       respjson.Field
		CdnURL                 respjson.Field
		CreatedByTokenID       respjson.Field
		CreatedByUserID        respjson.Field
		CreatedVia             respjson.Field
		Error                  respjson.Field
		ExpiresAt              respjson.Field
		PlaybackPath           respjson.Field
		PlaybackReadyAt        respjson.Field
		Poster                 respjson.Field
		PreviewURL             respjson.Field
		ReadyAt                respjson.Field
		Size                   respjson.Field
		SourceID               respjson.Field
		TimelinePreviews       respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Asset) RawJSON added in v0.17.0

func (r Asset) RawJSON() string

Returns the unmodified JSON received from the API

func (*Asset) UnmarshalJSON added in v0.17.0

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

type AssetActionRun added in v0.17.0

type AssetActionRun struct {
	// Unique action execution ID, prefixed with acr\_.
	ID string `json:"id" api:"required"`
	// ID of the Asset processed by this action.
	AssetID string `json:"asset_id" api:"required"`
	// When the action completed, failed, was skipped, or was cancelled. Null while
	// work remains.
	CompletedAt time.Time `json:"completed_at" api:"required" format:"date-time"`
	// When the action was accepted.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Resolved parameters and input references for this execution.
	Input AssetActionRunInput `json:"input" api:"required"`
	// Current execution status of the action.
	//
	// Any of "pending", "running", "waiting", "completed", "failed", "skipped",
	// "cancelled".
	Status AssetActionRunStatus `json:"status" api:"required"`
	// Type of action performed.
	//
	// Any of "create_static_rendition", "create_caption", "create_transcript",
	// "translate_caption", "create_thumbnails".
	Type AssetActionRunType `json:"type" api:"required"`
	// When the action was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// ID of the Workflow run that started the action. Null for direct output requests.
	WorkflowRunID string `json:"workflow_run_id" api:"required"`
	// Action key within the rule. Omitted for direct output requests.
	ActionID string `json:"action_id"`
	// Reason the action failed. Omitted when no failure message is available.
	Error string `json:"error"`
	// Machine-readable reason for waiting, skipping, failure, or cancellation. Omitted
	// when no reason applies.
	Reason string `json:"reason"`
	// Output reference and reuse flag. Included when the action completes
	// successfully.
	Result AssetActionRunResult `json:"result"`
	// Rule key from the Workflow definition. Omitted for direct output requests.
	RuleID string `json:"rule_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		AssetID       respjson.Field
		CompletedAt   respjson.Field
		CreatedAt     respjson.Field
		Input         respjson.Field
		Status        respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		WorkflowRunID respjson.Field
		ActionID      respjson.Field
		Error         respjson.Field
		Reason        respjson.Field
		Result        respjson.Field
		RuleID        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One execution of an Asset action, started by a Workflow or a direct output request.

func (AssetActionRun) RawJSON added in v0.17.0

func (r AssetActionRun) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetActionRun) UnmarshalJSON added in v0.17.0

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

type AssetActionRunInput added in v0.17.0

type AssetActionRunInput struct {
	// LanguageCode specifies the target language for the translated subtitle track,
	// such as en or fr. The same code appears in the caption and HLS manifest.
	//
	// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
	// "ru", "tr", "pl", "sv".
	LanguageCode string `json:"language_code"`
	// Resolution specifies the H.264 MP4 output resolution. highest selects the
	// largest supported output without upscaling. Hobby supports up to 1080p; other
	// plans support up to 2160p. Streaming resolution limits do not apply.
	//
	// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
	// "2160p".
	Resolution string `json:"resolution"`
	// ID of the original caption to translate. Included only for translation actions.
	SourceCaptionID string `json:"source_caption_id"`
	// Thumbnail settings. Included only for create_thumbnails actions.
	Thumbnails WorkflowThumbnailParamsResp `json:"thumbnails"`
	// TranscriptId specifies the original transcript consumed by caption publication.
	// Omitted for actions without a transcript input.
	TranscriptID string `json:"transcript_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LanguageCode    respjson.Field
		Resolution      respjson.Field
		SourceCaptionID respjson.Field
		Thumbnails      respjson.Field
		TranscriptID    respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolved parameters and input references for this execution.

func (AssetActionRunInput) RawJSON added in v0.17.0

func (r AssetActionRunInput) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetActionRunInput) UnmarshalJSON added in v0.17.0

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

type AssetActionRunResult added in v0.17.0

type AssetActionRunResult struct {
	// ID of the caption, static rendition, or thumbnail request produced by the
	// action.
	OutputID string `json:"output_id" api:"required"`
	// Type of output referenced by output_id. Caption generation and translation both
	// produce caption outputs.
	//
	// Any of "caption", "static_rendition", "thumbnail", "transcript".
	OutputType string `json:"output_type" api:"required"`
	// Whether the action reused an existing output instead of creating one.
	Reused bool `json:"reused" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OutputID    respjson.Field
		OutputType  respjson.Field
		Reused      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Output reference and reuse flag. Included when the action completes successfully.

func (AssetActionRunResult) RawJSON added in v0.17.0

func (r AssetActionRunResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetActionRunResult) UnmarshalJSON added in v0.17.0

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

type AssetActionRunStatus added in v0.17.0

type AssetActionRunStatus string

Current execution status of the action.

const (
	AssetActionRunStatusPending   AssetActionRunStatus = "pending"
	AssetActionRunStatusRunning   AssetActionRunStatus = "running"
	AssetActionRunStatusWaiting   AssetActionRunStatus = "waiting"
	AssetActionRunStatusCompleted AssetActionRunStatus = "completed"
	AssetActionRunStatusFailed    AssetActionRunStatus = "failed"
	AssetActionRunStatusSkipped   AssetActionRunStatus = "skipped"
	AssetActionRunStatusCancelled AssetActionRunStatus = "cancelled"
)

type AssetActionRunType added in v0.17.0

type AssetActionRunType string

Type of action performed.

const (
	AssetActionRunTypeCreateStaticRendition AssetActionRunType = "create_static_rendition"
	AssetActionRunTypeCreateCaption         AssetActionRunType = "create_caption"
	AssetActionRunTypeCreateTranscript      AssetActionRunType = "create_transcript"
	AssetActionRunTypeTranslateCaption      AssetActionRunType = "translate_caption"
	AssetActionRunTypeCreateThumbnails      AssetActionRunType = "create_thumbnails"
)

type AssetCreatedVia added in v0.17.0

type AssetCreatedVia string

CreatedVia specifies how the resource was created: api for API requests, dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for Workflow actions. Omitted when the creator is unknown.

const (
	AssetCreatedViaAPI       AssetCreatedVia = "api"
	AssetCreatedViaDashboard AssetCreatedVia = "dashboard"
	AssetCreatedViaMcp       AssetCreatedVia = "mcp"
	AssetCreatedViaWorkflow  AssetCreatedVia = "workflow"
)

type AssetDeleteParams added in v0.17.0

type AssetDeleteParams struct {
	// Also delete all files under the Asset's storage prefix, including streaming and
	// static outputs. Other files and the original input are preserved. Defaults to
	// false, which preserves published media files. Private transcript text and saved
	// subtitle copies are always scheduled for removal. File deletion is irreversible.
	// If cleanup fails, records remain for retry, but files may already be deleted.
	DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetDeleteParams) URLQuery added in v0.17.0

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

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

type AssetError added in v0.17.0

type AssetError struct {
	// Machine-readable processing error code.
	Code string `json:"code" api:"required"`
	// Description of the processing failure.
	Message string `json:"message" api:"required"`
	// Processing stage that failed.
	//
	// Any of "ingest", "analysis", "encoding", "packaging", "upload", "validation",
	// "cleanup".
	Stage string `json:"stage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Stage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AssetError) RawJSON added in v0.17.0

func (r AssetError) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetError) UnmarshalJSON added in v0.17.0

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

type AssetGetResponseEnvelope added in v0.17.0

type AssetGetResponseEnvelope struct {
	Data   Asset            `json:"data" api:"required"`
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AssetGetResponseEnvelope) RawJSON added in v0.17.0

func (r AssetGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type AssetListParams added in v0.17.0

type AssetListParams struct {
	// Maximum number of Assets to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of Assets to skip.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Case-insensitive search of Asset IDs and titles.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Filter Assets linked to this Source. Omit to include Assets from all Sources in
	// the Project.
	SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
	// Filter by output Storage ID.
	StorageID param.Opt[string]      `query:"storage_id,omitzero" json:"-"`
	Created   AssetListParamsCreated `query:"created,omitzero" json:"-"`
	// Repeat key:value pairs to match all supplied metadata conditions.
	Metadata []string `query:"metadata,omitzero" json:"-"`
	// Filter by Asset status.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status AssetStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetListParams) URLQuery added in v0.17.0

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

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

type AssetListParamsCreated added in v0.17.0

type AssetListParamsCreated struct {
	// Created at or after this Unix timestamp in seconds.
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Created at or before this Unix timestamp in seconds.
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// Creation-time ordering. Defaults to newest first.
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetListParamsCreated) URLQuery added in v0.17.0

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

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

type AssetMaxResolution added in v0.17.0

type AssetMaxResolution string

Maximum streaming resolution selected at creation. Does not limit static renditions.

const (
	AssetMaxResolution1080p AssetMaxResolution = "1080p"
	AssetMaxResolution2160p AssetMaxResolution = "2160p"
)

type AssetMinResolution added in v0.17.0

type AssetMinResolution string

Minimum streaming resolution selected at creation. auto means no minimum; smaller sources are not upscaled.

const (
	AssetMinResolutionAuto  AssetMinResolution = "auto"
	AssetMinResolution240p  AssetMinResolution = "240p"
	AssetMinResolution360p  AssetMinResolution = "360p"
	AssetMinResolution540p  AssetMinResolution = "540p"
	AssetMinResolution720p  AssetMinResolution = "720p"
	AssetMinResolution1080p AssetMinResolution = "1080p"
	AssetMinResolution1440p AssetMinResolution = "1440p"
	AssetMinResolution2160p AssetMinResolution = "2160p"
)

type AssetNewParams added in v0.17.0

type AssetNewParams struct {
	// ID of the video Source to process.
	SourceID string `json:"source_id" api:"required"`
	// WorkflowId specifies the Workflow to select. Omit to use the Project default.
	// Set null to disable automatic actions. The current revision is pinned when
	// creation is accepted.
	WorkflowID param.Opt[string] `json:"workflow_id,omitzero"`
	// PathTemplate specifies the Asset output folder relative to Storage base_prefix.
	// Supports {assetID} and case-sensitive {metadata.<key>}; referenced values must
	// be non-empty. Ignored for Chunkify storage, which always uses {assetID}.
	// Overrides the Project default. Defaults to {assetID} when neither is set.
	// Maximum template size: 1024 UTF-8 bytes. Expanded prefix: 768 bytes including
	// base_prefix and trailing slash.
	PathTemplate param.Opt[string] `json:"path_template,omitzero"`
	// Allow public preview access without an API token. Omit to use the Project
	// default. Does not control CDN or static download access.
	PreviewEnabled param.Opt[bool] `json:"preview_enabled,omitzero"`
	// Asset title, up to 256 characters. Defaults to an empty string.
	Title param.Opt[string] `json:"title,omitzero"`
	// Maximum streaming resolution. Omit to use the Project default, or the plan
	// maximum if unset. 2160p requires Starter or above. Smaller sources are not
	// upscaled. Does not affect static renditions.
	//
	// Any of "1080p", "2160p".
	MaxResolution AssetNewParamsMaxResolution `json:"max_resolution,omitzero"`
	// String metadata with a maximum encoded JSON size of 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Minimum streaming resolution. Omit to use the Project default; auto removes the
	// minimum. Must not exceed max_resolution. Smaller sources are not upscaled. Does
	// not affect static renditions.
	//
	// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
	MinResolution AssetNewParamsMinResolution `json:"min_resolution,omitzero"`
	// Output Storage. Omit to use the Project default. The path_template controls the
	// folder for generated output paths.
	Storage AssetNewParamsStorage `json:"storage,omitzero"`
	// contains filtered or unexported fields
}

func (AssetNewParams) MarshalJSON added in v0.17.0

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

func (*AssetNewParams) UnmarshalJSON added in v0.17.0

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

type AssetNewParamsMaxResolution added in v0.17.0

type AssetNewParamsMaxResolution string

Maximum streaming resolution. Omit to use the Project default, or the plan maximum if unset. 2160p requires Starter or above. Smaller sources are not upscaled. Does not affect static renditions.

const (
	AssetNewParamsMaxResolution1080p AssetNewParamsMaxResolution = "1080p"
	AssetNewParamsMaxResolution2160p AssetNewParamsMaxResolution = "2160p"
)

type AssetNewParamsMinResolution added in v0.17.0

type AssetNewParamsMinResolution string

Minimum streaming resolution. Omit to use the Project default; auto removes the minimum. Must not exceed max_resolution. Smaller sources are not upscaled. Does not affect static renditions.

const (
	AssetNewParamsMinResolutionAuto  AssetNewParamsMinResolution = "auto"
	AssetNewParamsMinResolution240p  AssetNewParamsMinResolution = "240p"
	AssetNewParamsMinResolution360p  AssetNewParamsMinResolution = "360p"
	AssetNewParamsMinResolution540p  AssetNewParamsMinResolution = "540p"
	AssetNewParamsMinResolution720p  AssetNewParamsMinResolution = "720p"
	AssetNewParamsMinResolution1080p AssetNewParamsMinResolution = "1080p"
	AssetNewParamsMinResolution1440p AssetNewParamsMinResolution = "1440p"
	AssetNewParamsMinResolution2160p AssetNewParamsMinResolution = "2160p"
)

type AssetNewParamsStorage added in v0.17.0

type AssetNewParamsStorage struct {
	// ID of output Storage in this Project. Omit to use the Project default. Applies
	// to all outputs, including static renditions added later.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Output Storage. Omit to use the Project default. The path_template controls the folder for generated output paths.

func (AssetNewParamsStorage) MarshalJSON added in v0.17.0

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

func (*AssetNewParamsStorage) UnmarshalJSON added in v0.17.0

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

type AssetNewResponseEnvelope added in v0.17.0

type AssetNewResponseEnvelope struct {
	Data   Asset            `json:"data" api:"required"`
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AssetNewResponseEnvelope) RawJSON added in v0.17.0

func (r AssetNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetNewResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type AssetOutputCaption added in v0.17.0

type AssetOutputCaption struct {
	// Id identifies the Asset output, prefixed with aop\_. The type field identifies
	// the output kind.
	ID string `json:"id" api:"required"`
	// AssetId identifies the owning Asset.
	AssetID string `json:"asset_id" api:"required"`
	// Details contains the canonical typed output resource, including its available
	// delivery fields.
	Details AssetOutputCaptionDetails `json:"details" api:"required"`
	// Status specifies the output processing state. Expired means temporary output
	// files are no longer available.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Type identifies the output kind.
	Type constant.Caption `json:"type" default:"caption"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AssetID     respjson.Field
		Details     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Asset-owned caption output and its canonical resource details.

func (AssetOutputCaption) RawJSON added in v0.17.0

func (r AssetOutputCaption) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetOutputCaption) UnmarshalJSON added in v0.17.0

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

type AssetOutputCaptionDetails added in v0.17.0

type AssetOutputCaptionDetails struct {
	// Unique Asset output ID, prefixed with aop\_.
	ID string `json:"id" api:"required"`
	// Caption processing status.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Time this caption output was requested.
	CreatedAt time.Time `json:"created_at" format:"date-time"`
	// Reason caption processing failed.
	Error AssetOutputCaptionDetailsError `json:"error"`
	// Primary language of this subtitle track, such as en or fr. Omitted when no
	// speech was detected or processing has not finished.
	LanguageCode string `json:"language_code"`
	// Subtitle media playlist path in Storage. Available when speech was detected.
	PlaylistPath string `json:"playlist_path"`
	// Combined subtitle playlist and WebVTT size in bytes. Available when ready.
	Size int64 `json:"size"`
	// ID of the caption track translated to create this track. Omitted for speech
	// transcription.
	SourceCaptionID string `json:"source_caption_id"`
	// TranscriptId identifies the original-language transcript used to generate this
	// caption. Omitted for translated captions.
	TranscriptID string `json:"transcript_id"`
	// WebVTT subtitle segment path in Storage. Available when speech was detected.
	VttPath string `json:"vtt_path"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Status          respjson.Field
		CreatedAt       respjson.Field
		Error           respjson.Field
		LanguageCode    respjson.Field
		PlaylistPath    respjson.Field
		Size            respjson.Field
		SourceCaptionID respjson.Field
		TranscriptID    respjson.Field
		VttPath         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details contains the canonical typed output resource, including its available delivery fields.

func (AssetOutputCaptionDetails) RawJSON added in v0.17.0

func (r AssetOutputCaptionDetails) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetOutputCaptionDetails) UnmarshalJSON added in v0.17.0

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

type AssetOutputCaptionDetailsError added in v0.17.0

type AssetOutputCaptionDetailsError struct {
	// Machine-readable processing error code.
	Code string `json:"code" api:"required"`
	// Description of the processing failure.
	Message string `json:"message" api:"required"`
	// Processing stage that failed.
	//
	// Any of "ingest", "analysis", "encoding", "packaging", "upload", "validation",
	// "cleanup".
	Stage string `json:"stage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Stage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Reason caption processing failed.

func (AssetOutputCaptionDetailsError) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputCaptionDetailsError) UnmarshalJSON added in v0.17.0

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

type AssetOutputDeleteParams added in v0.17.0

type AssetOutputDeleteParams struct {
	AssetID string `path:"assetId" api:"required" json:"-"`
	// DeleteFiles specifies whether to remove this output's published media files from
	// Storage. Defaults to false, preserving those files. Transcript deletion always
	// schedules removal of its private text and saved subtitle copy, regardless of
	// this option. The Asset, Source, and other outputs are preserved. File cleanup
	// failures retain the output record for retry; files already removed cannot be
	// restored.
	DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetOutputDeleteParams) URLQuery added in v0.17.0

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

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

type AssetOutputGetParams added in v0.17.0

type AssetOutputGetParams struct {
	AssetID string `path:"assetId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type AssetOutputGetResponseEnvelope added in v0.17.0

type AssetOutputGetResponseEnvelope struct {
	// A resource produced for an Asset, requested directly or by a Workflow. Its type
	// selects the details schema. Output state is independent of Asset playback
	// readiness.
	Data AssetOutputUnion `json:"data" api:"required"`
	// Status is success for a successful request.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One Asset output.

func (AssetOutputGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type AssetOutputListParams added in v0.17.0

type AssetOutputListParams struct {
	// Limit specifies the maximum number of results to return. Accepts 1 to 100.
	// Defaults to 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Offset specifies the number of matching results to skip. Must be at least 0.
	// Defaults to 0.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Status specifies the current output state to include. Omit it to include all
	// states.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status AssetOutputListParamsStatus `query:"status,omitzero" json:"-"`
	// Type specifies the output kind to include. Omit it to include all kinds.
	//
	// Any of "caption", "transcript", "static_rendition", "thumbnail".
	Type AssetOutputListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetOutputListParams) URLQuery added in v0.17.0

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

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

type AssetOutputListParamsStatus added in v0.17.0

type AssetOutputListParamsStatus string

Status specifies the current output state to include. Omit it to include all states.

const (
	AssetOutputListParamsStatusPreparing AssetOutputListParamsStatus = "preparing"
	AssetOutputListParamsStatusReady     AssetOutputListParamsStatus = "ready"
	AssetOutputListParamsStatusFailed    AssetOutputListParamsStatus = "failed"
	AssetOutputListParamsStatusExpired   AssetOutputListParamsStatus = "expired"
)

type AssetOutputListParamsType added in v0.17.0

type AssetOutputListParamsType string

Type specifies the output kind to include. Omit it to include all kinds.

const (
	AssetOutputListParamsTypeCaption         AssetOutputListParamsType = "caption"
	AssetOutputListParamsTypeTranscript      AssetOutputListParamsType = "transcript"
	AssetOutputListParamsTypeStaticRendition AssetOutputListParamsType = "static_rendition"
	AssetOutputListParamsTypeThumbnail       AssetOutputListParamsType = "thumbnail"
)

type AssetOutputNewParams added in v0.17.0

type AssetOutputNewParams struct {

	// This field is a request body variant, only one variant field can be set. Create
	// an Asset-owned caption output.
	OfCaption *AssetOutputNewParamsBodyCaption `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Create
	// an Asset-owned static rendition output.
	OfStaticRendition *AssetOutputNewParamsBodyStaticRendition `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Create
	// an Asset-owned thumbnail output.
	OfThumbnail *AssetOutputNewParamsBodyThumbnail `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Create
	// or reuse the original-language transcript for an Asset. Caption generation
	// shares this transcript and its speech-recognition charge.
	OfTranscript *AssetOutputNewParamsBodyTranscript `json:",inline"`
	// contains filtered or unexported fields
}

func (AssetOutputNewParams) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParams) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyCaption added in v0.17.0

type AssetOutputNewParamsBodyCaption struct {
	// Params specifies the settings for this output type.
	Params AssetOutputNewParamsBodyCaptionParams `json:"params,omitzero" api:"required"`
	// Type specifies the output kind to create.
	//
	// This field can be elided, and will marshal its zero value as "caption".
	Type constant.Caption `json:"type" default:"caption"`
	// contains filtered or unexported fields
}

Create an Asset-owned caption output.

The properties Params, Type are required.

func (AssetOutputNewParamsBodyCaption) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyCaption) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyCaptionParams added in v0.17.0

type AssetOutputNewParamsBodyCaptionParams struct {
	// SourceCaptionId specifies the caption on this Asset to translate. Supply
	// language_code with this field. Omit both fields to generate original captions.
	SourceCaptionID param.Opt[string] `json:"source_caption_id,omitzero"`
	// LanguageCode specifies the target language for a translated caption. Supply
	// source_caption_id with this field. Omit both fields to transcribe the Asset
	// audio with automatic language detection.
	//
	// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
	// "ru", "tr", "pl", "sv".
	LanguageCode string `json:"language_code,omitzero"`
	// contains filtered or unexported fields
}

Params specifies the settings for this output type.

func (AssetOutputNewParamsBodyCaptionParams) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyCaptionParams) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyStaticRendition added in v0.17.0

type AssetOutputNewParamsBodyStaticRendition struct {
	// Params specifies the settings for this output type.
	Params AssetStaticRenditionCreateParams `json:"params,omitzero" api:"required"`
	// Type specifies the output kind to create.
	//
	// This field can be elided, and will marshal its zero value as "static_rendition".
	Type constant.StaticRendition `json:"type" default:"static_rendition"`
	// contains filtered or unexported fields
}

Create an Asset-owned static rendition output.

The properties Params, Type are required.

func (AssetOutputNewParamsBodyStaticRendition) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyStaticRendition) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyThumbnail added in v0.17.0

type AssetOutputNewParamsBodyThumbnail struct {
	// Params specifies the settings for this output type.
	Params AssetOutputNewParamsBodyThumbnailParams `json:"params,omitzero" api:"required"`
	// Type specifies the output kind to create.
	//
	// This field can be elided, and will marshal its zero value as "thumbnail".
	Type constant.Thumbnail `json:"type" default:"thumbnail"`
	// contains filtered or unexported fields
}

Create an Asset-owned thumbnail output.

The properties Params, Type are required.

func (AssetOutputNewParamsBodyThumbnail) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyThumbnail) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyThumbnailParams added in v0.17.0

type AssetOutputNewParamsBodyThumbnailParams struct {
	// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
	// selected range.
	Count param.Opt[int64] `json:"count,omitzero"`
	// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
	// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
	// cropping or upscaling.
	Size param.Opt[int64] `json:"size,omitzero"`
	// Format selects JPEG or WebP. Defaults to JPEG.
	//
	// Any of "jpeg", "webp".
	Format string `json:"format,omitzero"`
	// Metadata attaches string values to this request. The serialized object may
	// contain at most 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Output selects images or sprites. Defaults to images.
	//
	// Any of "images", "sprites".
	Output string `json:"output,omitzero"`
	// Range limits sampling to part of the Source. Defaults to the whole Source
	// duration.
	Range AssetOutputNewParamsBodyThumbnailParamsRange `json:"range,omitzero"`
	// Timestamps specifies 1 to 100 Source-relative target times in seconds. Every
	// timestamp must be within the selected range, including its start and excluding
	// its end. Repeated targets produce separate outputs.
	Timestamps []float64 `json:"timestamps,omitzero"`
	// contains filtered or unexported fields
}

Params specifies the settings for this output type.

func (AssetOutputNewParamsBodyThumbnailParams) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyThumbnailParams) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyThumbnailParamsRange added in v0.17.0

type AssetOutputNewParamsBodyThumbnailParamsRange struct {
	// End specifies the exclusive upper bound in seconds. Defaults to the Source
	// duration.
	End param.Opt[float64] `json:"end,omitzero"`
	// Start specifies the inclusive lower bound in seconds. Defaults to zero.
	Start param.Opt[float64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

Range limits sampling to part of the Source. Defaults to the whole Source duration.

func (AssetOutputNewParamsBodyThumbnailParamsRange) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyThumbnailParamsRange) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewParamsBodyTranscript added in v0.17.0

type AssetOutputNewParamsBodyTranscript struct {
	// Parameters for an original-language transcript. Pass an empty object; the spoken
	// language is detected automatically.
	Params any `json:"params,omitzero" api:"required"`
	// Type specifies the output kind.
	//
	// This field can be elided, and will marshal its zero value as "transcript".
	Type constant.Transcript `json:"type" default:"transcript"`
	// contains filtered or unexported fields
}

Create or reuse the original-language transcript for an Asset. Caption generation shares this transcript and its speech-recognition charge.

The properties Params, Type are required.

func (AssetOutputNewParamsBodyTranscript) MarshalJSON added in v0.17.0

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

func (*AssetOutputNewParamsBodyTranscript) UnmarshalJSON added in v0.17.0

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

type AssetOutputNewResponseEnvelope added in v0.17.0

type AssetOutputNewResponseEnvelope struct {
	// A resource produced for an Asset, requested directly or by a Workflow. Its type
	// selects the details schema. Output state is independent of Asset playback
	// readiness.
	Data AssetOutputUnion `json:"data" api:"required"`
	// Status is success for a successful request.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One Asset output.

func (AssetOutputNewResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputNewResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type AssetOutputService added in v0.17.0

type AssetOutputService struct {
	Options []option.RequestOption
}

Automatic video-on-demand Assets and independent H.264 MP4 static renditions.

AssetOutputService contains methods and other services that help with interacting with the chunkify 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 NewAssetOutputService method instead.

func NewAssetOutputService added in v0.17.0

func NewAssetOutputService(opts ...option.RequestOption) (r AssetOutputService)

NewAssetOutputService 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 (*AssetOutputService) Delete added in v0.17.0

func (r *AssetOutputService) Delete(ctx context.Context, outputID string, params AssetOutputDeleteParams, opts ...option.RequestOption) (err error)

Delete one output belonging to this Asset and Project. Its type is resolved from the output ID. Type-specific processing and dependency restrictions still apply.

func (*AssetOutputService) Get added in v0.17.0

func (r *AssetOutputService) Get(ctx context.Context, outputID string, query AssetOutputGetParams, opts ...option.RequestOption) (res *AssetOutputUnion, err error)

Retrieve one output belonging to the specified Asset and authenticated Project. Delivery URLs follow the output resource retention and expiry rules.

func (*AssetOutputService) List added in v0.17.0

List outputs requested directly or by a Workflow. Results are ordered by creation date, newest first, with descending output ID as a tie-breaker. Pagination and total apply after type and status filters. Core playback, poster and default timeline previews remain on the Asset.

func (*AssetOutputService) ListAutoPaging added in v0.17.0

List outputs requested directly or by a Workflow. Results are ordered by creation date, newest first, with descending output ID as a tie-breaker. Pagination and total apply after type and status filters. Core playback, poster and default timeline previews remain on the Asset.

func (*AssetOutputService) New added in v0.17.0

Create one caption, static rendition or additional thumbnail output. The accepted output processes asynchronously and is returned in the same envelope as output reads.

type AssetOutputStaticRendition added in v0.17.0

type AssetOutputStaticRendition struct {
	// Id identifies the Asset output, prefixed with aop\_. The type field identifies
	// the output kind.
	ID string `json:"id" api:"required"`
	// AssetId identifies the owning Asset.
	AssetID string `json:"asset_id" api:"required"`
	// Details contains the canonical typed output resource, including its available
	// delivery fields.
	Details AssetOutputStaticRenditionDetails `json:"details" api:"required"`
	// Status specifies the output processing state. Expired means temporary output
	// files are no longer available.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Type identifies the output kind.
	Type constant.StaticRendition `json:"type" default:"static_rendition"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AssetID     respjson.Field
		Details     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Asset-owned static rendition output and its canonical resource details.

func (AssetOutputStaticRendition) RawJSON added in v0.17.0

func (r AssetOutputStaticRendition) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetOutputStaticRendition) UnmarshalJSON added in v0.17.0

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

type AssetOutputStaticRenditionDetails added in v0.17.0

type AssetOutputStaticRenditionDetails struct {
	// Unique Asset output ID, prefixed with aop\_.
	ID string `json:"id" api:"required"`
	// Parent Asset ID.
	AssetID string `json:"asset_id" api:"required"`
	// Media container.
	Container constant.MP4 `json:"container" default:"mp4"`
	// When the rendition was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Output height in pixels.
	Height int64 `json:"height" api:"required"`
	// MP4 path in Storage. Recreating the same resolution reuses this path and
	// overwrites any retained file.
	Path string `json:"path" api:"required"`
	// Requested resolution selector.
	//
	// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
	// "2160p".
	RequestedResolution string `json:"requested_resolution" api:"required"`
	// Selected output resolution. May be smaller than 240p for small sources. Use
	// width and height for pixel dimensions.
	Resolution string `json:"resolution" api:"required"`
	// Processing status of this MP4, independent of streaming outputs.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Storage containing this rendition, inherited from its Asset.
	StorageID string `json:"storage_id" api:"required"`
	// When the rendition was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Video codec.
	VideoCodec constant.H264 `json:"video_codec" default:"h264"`
	// Output width in pixels.
	Width int64 `json:"width" api:"required"`
	// Measured audio bitrate in bits per second. Omitted until known or when there is
	// no audio.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Measured audio codec. Omitted until known or when there is no audio.
	AudioCodec string `json:"audio_codec"`
	// Measured audio sample rate in Hz. Omitted until known or when there is no audio.
	AudioSamplerate int64 `json:"audio_samplerate"`
	// Unsigned MP4 CDN URL. Available when ready and unexpired and Storage has a CDN
	// URL.
	CdnURL string `json:"cdn_url" format:"uri"`
	// Output duration in seconds. Omitted until ready.
	Duration float64                                `json:"duration"`
	Error    AssetOutputStaticRenditionDetailsError `json:"error"`
	// Progress specifies the current processing stage and encoding percentage. Omitted
	// after processing ends.
	Progress AssetOutputStaticRenditionDetailsProgress `json:"progress"`
	// When the MP4 became available.
	ReadyAt time.Time `json:"ready_at" format:"date-time"`
	// File size in bytes. Omitted until ready.
	Size int64 `json:"size"`
	// Signed MP4 download URL, available when ready and unexpired. Valid for up to ten
	// minutes. Retrieve the output to refresh it. Independent of preview_enabled.
	URL string `json:"url" format:"uri"`
	// Measured video bitrate in bits per second. Omitted until ready.
	VideoBitrate int64 `json:"video_bitrate"`
	// Measured video frame rate in frames per second. Omitted until known.
	VideoFramerate float64 `json:"video_framerate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		AssetID             respjson.Field
		Container           respjson.Field
		CreatedAt           respjson.Field
		Height              respjson.Field
		Path                respjson.Field
		RequestedResolution respjson.Field
		Resolution          respjson.Field
		Status              respjson.Field
		StorageID           respjson.Field
		UpdatedAt           respjson.Field
		VideoCodec          respjson.Field
		Width               respjson.Field
		AudioBitrate        respjson.Field
		AudioCodec          respjson.Field
		AudioSamplerate     respjson.Field
		CdnURL              respjson.Field
		Duration            respjson.Field
		Error               respjson.Field
		Progress            respjson.Field
		ReadyAt             respjson.Field
		Size                respjson.Field
		URL                 respjson.Field
		VideoBitrate        respjson.Field
		VideoFramerate      respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Details contains the canonical typed output resource, including its available delivery fields.

func (AssetOutputStaticRenditionDetails) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputStaticRenditionDetails) UnmarshalJSON added in v0.17.0

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

type AssetOutputStaticRenditionDetailsError added in v0.17.0

type AssetOutputStaticRenditionDetailsError struct {
	// Machine-readable processing error code.
	Code string `json:"code" api:"required"`
	// Description of the processing failure.
	Message string `json:"message" api:"required"`
	// Processing stage that failed.
	//
	// Any of "ingest", "analysis", "encoding", "packaging", "upload", "validation",
	// "cleanup".
	Stage string `json:"stage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Stage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AssetOutputStaticRenditionDetailsError) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputStaticRenditionDetailsError) UnmarshalJSON added in v0.17.0

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

type AssetOutputStaticRenditionDetailsProgress added in v0.17.0

type AssetOutputStaticRenditionDetailsProgress struct {
	// Stage specifies the current preparation activity. Finalization and streaming
	// publication can overlap encoding; finalizing is shown once encoding has
	// completed.
	//
	// Any of "queued", "starting", "encoding", "finalizing", "uploading".
	Stage string `json:"stage" api:"required"`
	// Percent specifies the percentage of the video encoded so far. Present only
	// during encoding when video duration is known. It may decrease if processing
	// restarts. It does not estimate total preparation time.
	Percent float64 `json:"percent"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Stage       respjson.Field
		Percent     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Progress specifies the current processing stage and encoding percentage. Omitted after processing ends.

func (AssetOutputStaticRenditionDetailsProgress) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputStaticRenditionDetailsProgress) UnmarshalJSON added in v0.17.0

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

type AssetOutputThumbnail added in v0.17.0

type AssetOutputThumbnail struct {
	// Id identifies the Asset output, prefixed with aop\_. The type field identifies
	// the output kind.
	ID string `json:"id" api:"required"`
	// AssetId identifies the owning Asset.
	AssetID string `json:"asset_id" api:"required"`
	// Details contains the canonical typed output resource, including its available
	// delivery fields.
	Details Thumbnail `json:"details" api:"required"`
	// Status specifies the output processing state. Expired means temporary output
	// files are no longer available.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Type identifies the output kind.
	Type constant.Thumbnail `json:"type" default:"thumbnail"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AssetID     respjson.Field
		Details     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Asset-owned thumbnail output and its canonical resource details.

func (AssetOutputThumbnail) RawJSON added in v0.17.0

func (r AssetOutputThumbnail) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetOutputThumbnail) UnmarshalJSON added in v0.17.0

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

type AssetOutputTranscript added in v0.17.0

type AssetOutputTranscript struct {
	// Id identifies the Asset output, prefixed with aop\_.
	ID string `json:"id" api:"required"`
	// AssetId identifies the owning Asset.
	AssetID string `json:"asset_id" api:"required"`
	// An original-language transcript. Content is included in ready output responses
	// and lifecycle event snapshots. Transcripts have no download or CDN URL.
	Details AssetOutputTranscriptDetails `json:"details" api:"required"`
	// Status specifies the output processing state. Expired means temporary output
	// files are no longer available.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Type identifies the output kind.
	Type constant.Transcript `json:"type" default:"transcript"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AssetID     respjson.Field
		Details     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Asset-owned transcript output and its content.

func (AssetOutputTranscript) RawJSON added in v0.17.0

func (r AssetOutputTranscript) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetOutputTranscript) UnmarshalJSON added in v0.17.0

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

type AssetOutputTranscriptDetails added in v0.17.0

type AssetOutputTranscriptDetails struct {
	// Id identifies the Asset output, prefixed with aop\_.
	ID string `json:"id" api:"required"`
	// Status specifies the output processing state. Expired means temporary output
	// files are no longer available.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status string `json:"status" api:"required"`
	// Content contains the complete text and timed segments. Included when ready;
	// omitted while preparing, failed or expired.
	Content AssetOutputTranscriptDetailsContent `json:"content"`
	Error   AssetOutputTranscriptDetailsError   `json:"error"`
	// LanguageCode identifies the detected primary language, such as en. Omitted
	// before recognition or when no speech is detected.
	LanguageCode string `json:"language_code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Status       respjson.Field
		Content      respjson.Field
		Error        respjson.Field
		LanguageCode respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An original-language transcript. Content is included in ready output responses and lifecycle event snapshots. Transcripts have no download or CDN URL.

func (AssetOutputTranscriptDetails) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputTranscriptDetails) UnmarshalJSON added in v0.17.0

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

type AssetOutputTranscriptDetailsContent added in v0.17.0

type AssetOutputTranscriptDetailsContent struct {
	// Segments contains timed passages in chronological order. Individual word
	// timestamps are not included.
	Segments []AssetOutputTranscriptDetailsContentSegment `json:"segments" api:"required"`
	// Text contains the complete recognized speech in the original language.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Segments    respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Content contains the complete text and timed segments. Included when ready; omitted while preparing, failed or expired.

func (AssetOutputTranscriptDetailsContent) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputTranscriptDetailsContent) UnmarshalJSON added in v0.17.0

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

type AssetOutputTranscriptDetailsContentSegment added in v0.17.0

type AssetOutputTranscriptDetailsContentSegment struct {
	// End specifies the passage end time in seconds.
	End float64 `json:"end" api:"required"`
	// Start specifies the passage start time in seconds.
	Start float64 `json:"start" api:"required"`
	// Text contains the recognized passage, including punctuation.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A timed passage of recognized speech. Times are seconds from the start of the Asset.

func (AssetOutputTranscriptDetailsContentSegment) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputTranscriptDetailsContentSegment) UnmarshalJSON added in v0.17.0

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

type AssetOutputTranscriptDetailsError added in v0.17.0

type AssetOutputTranscriptDetailsError struct {
	// Machine-readable processing error code.
	Code string `json:"code" api:"required"`
	// Description of the processing failure.
	Message string `json:"message" api:"required"`
	// Processing stage that failed.
	//
	// Any of "ingest", "analysis", "encoding", "packaging", "upload", "validation",
	// "cleanup".
	Stage string `json:"stage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Stage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AssetOutputTranscriptDetailsError) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetOutputTranscriptDetailsError) UnmarshalJSON added in v0.17.0

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

type AssetOutputUnion added in v0.17.0

type AssetOutputUnion struct {
	ID      string `json:"id"`
	AssetID string `json:"asset_id"`
	// This field is a union of [AssetOutputCaptionDetails],
	// [AssetOutputStaticRenditionDetails], [Thumbnail], [AssetOutputTranscriptDetails]
	Details AssetOutputUnionDetails `json:"details"`
	Status  string                  `json:"status"`
	// Any of "caption", "static_rendition", "thumbnail", "transcript".
	Type string `json:"type"`
	JSON struct {
		ID      respjson.Field
		AssetID respjson.Field
		Details respjson.Field
		Status  respjson.Field
		Type    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AssetOutputUnion contains all possible properties and values from AssetOutputCaption, AssetOutputStaticRendition, AssetOutputThumbnail, AssetOutputTranscript.

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

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

func (AssetOutputUnion) AsAny added in v0.17.0

func (u AssetOutputUnion) AsAny() anyAssetOutput

Use the following switch statement to find the correct variant

switch variant := AssetOutputUnion.AsAny().(type) {
case chunkify.AssetOutputCaption:
case chunkify.AssetOutputStaticRendition:
case chunkify.AssetOutputThumbnail:
case chunkify.AssetOutputTranscript:
default:
  fmt.Errorf("no variant present")
}

func (AssetOutputUnion) AsCaption added in v0.17.0

func (u AssetOutputUnion) AsCaption() (v AssetOutputCaption)

func (AssetOutputUnion) AsStaticRendition added in v0.17.0

func (u AssetOutputUnion) AsStaticRendition() (v AssetOutputStaticRendition)

func (AssetOutputUnion) AsThumbnail added in v0.17.0

func (u AssetOutputUnion) AsThumbnail() (v AssetOutputThumbnail)

func (AssetOutputUnion) AsTranscript added in v0.17.0

func (u AssetOutputUnion) AsTranscript() (v AssetOutputTranscript)

func (AssetOutputUnion) RawJSON added in v0.17.0

func (u AssetOutputUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetOutputUnion) UnmarshalJSON added in v0.17.0

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

type AssetOutputUnionDetails added in v0.17.0

type AssetOutputUnionDetails struct {
	ID        string    `json:"id"`
	Status    string    `json:"status"`
	CreatedAt time.Time `json:"created_at"`
	// This field is a union of [AssetOutputCaptionDetailsError],
	// [AssetOutputStaticRenditionDetailsError], [ThumbnailError],
	// [AssetOutputTranscriptDetailsError]
	Error        AssetOutputUnionDetailsError `json:"error"`
	LanguageCode string                       `json:"language_code"`
	// This field is from variant [AssetOutputCaptionDetails].
	PlaylistPath string `json:"playlist_path"`
	Size         int64  `json:"size"`
	// This field is from variant [AssetOutputCaptionDetails].
	SourceCaptionID string `json:"source_caption_id"`
	// This field is from variant [AssetOutputCaptionDetails].
	TranscriptID string `json:"transcript_id"`
	// This field is from variant [AssetOutputCaptionDetails].
	VttPath string `json:"vtt_path"`
	AssetID string `json:"asset_id"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Container constant.MP4 `json:"container"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Height int64 `json:"height"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Path string `json:"path"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	RequestedResolution string `json:"requested_resolution"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Resolution string    `json:"resolution"`
	StorageID  string    `json:"storage_id"`
	UpdatedAt  time.Time `json:"updated_at"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	VideoCodec constant.H264 `json:"video_codec"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Width int64 `json:"width"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	AudioBitrate int64 `json:"audio_bitrate"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	AudioCodec string `json:"audio_codec"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	AudioSamplerate int64 `json:"audio_samplerate"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	CdnURL string `json:"cdn_url"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Duration float64 `json:"duration"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	Progress AssetOutputStaticRenditionDetailsProgress `json:"progress"`
	ReadyAt  time.Time                                 `json:"ready_at"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	URL string `json:"url"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	VideoBitrate int64 `json:"video_bitrate"`
	// This field is from variant [AssetOutputStaticRenditionDetails].
	VideoFramerate float64 `json:"video_framerate"`
	// This field is from variant [Thumbnail].
	Files []ThumbnailFile `json:"files"`
	// This field is from variant [Thumbnail].
	Metadata map[string]string `json:"metadata"`
	// This field is from variant [Thumbnail].
	Samples []ThumbnailSample `json:"samples"`
	// This field is from variant [Thumbnail].
	Settings ThumbnailSettings `json:"settings"`
	// This field is from variant [Thumbnail].
	SourceID string `json:"source_id"`
	// This field is from variant [Thumbnail].
	StoragePath string `json:"storage_path"`
	// This field is from variant [Thumbnail].
	StoragePrefix string `json:"storage_prefix"`
	// This field is from variant [Thumbnail].
	CreatedByTokenID string `json:"created_by_token_id"`
	// This field is from variant [Thumbnail].
	CreatedByUserID string `json:"created_by_user_id"`
	// This field is from variant [Thumbnail].
	CreatedVia ThumbnailCreatedVia `json:"created_via"`
	// This field is from variant [Thumbnail].
	DeleteAt time.Time `json:"delete_at"`
	// This field is from variant [Thumbnail].
	ExpiresAt time.Time `json:"expires_at"`
	// This field is from variant [AssetOutputTranscriptDetails].
	Content AssetOutputTranscriptDetailsContent `json:"content"`
	JSON    struct {
		ID                  respjson.Field
		Status              respjson.Field
		CreatedAt           respjson.Field
		Error               respjson.Field
		LanguageCode        respjson.Field
		PlaylistPath        respjson.Field
		Size                respjson.Field
		SourceCaptionID     respjson.Field
		TranscriptID        respjson.Field
		VttPath             respjson.Field
		AssetID             respjson.Field
		Container           respjson.Field
		Height              respjson.Field
		Path                respjson.Field
		RequestedResolution respjson.Field
		Resolution          respjson.Field
		StorageID           respjson.Field
		UpdatedAt           respjson.Field
		VideoCodec          respjson.Field
		Width               respjson.Field
		AudioBitrate        respjson.Field
		AudioCodec          respjson.Field
		AudioSamplerate     respjson.Field
		CdnURL              respjson.Field
		Duration            respjson.Field
		Progress            respjson.Field
		ReadyAt             respjson.Field
		URL                 respjson.Field
		VideoBitrate        respjson.Field
		VideoFramerate      respjson.Field
		Files               respjson.Field
		Metadata            respjson.Field
		Samples             respjson.Field
		Settings            respjson.Field
		SourceID            respjson.Field
		StoragePath         respjson.Field
		StoragePrefix       respjson.Field
		CreatedByTokenID    respjson.Field
		CreatedByUserID     respjson.Field
		CreatedVia          respjson.Field
		DeleteAt            respjson.Field
		ExpiresAt           respjson.Field
		Content             respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AssetOutputUnionDetails is an implicit subunion of AssetOutputUnion. AssetOutputUnionDetails provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the AssetOutputUnion.

func (*AssetOutputUnionDetails) UnmarshalJSON added in v0.17.0

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

type AssetOutputUnionDetailsError added in v0.17.0

type AssetOutputUnionDetailsError struct {
	Code    string `json:"code"`
	Message string `json:"message"`
	Stage   string `json:"stage"`
	JSON    struct {
		Code    respjson.Field
		Message respjson.Field
		Stage   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AssetOutputUnionDetailsError is an implicit subunion of AssetOutputUnion. AssetOutputUnionDetailsError provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the AssetOutputUnion.

func (*AssetOutputUnionDetailsError) UnmarshalJSON added in v0.17.0

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

type AssetPoster added in v0.17.0

type AssetPoster struct {
	// Image height in pixels.
	Height int64 `json:"height" api:"required"`
	// Image path in Storage.
	Path string `json:"path" api:"required"`
	// Image width in pixels.
	Width int64 `json:"width" api:"required"`
	// Unsigned image CDN URL. Available once the poster exists and Storage has a CDN
	// URL.
	CdnURL string `json:"cdn_url" format:"uri"`
	// Public poster preview URL. Available when the Asset is ready and preview_enabled
	// is true.
	PreviewURL string `json:"preview_url" format:"uri"`
	// Image size in bytes.
	Size int64 `json:"size"`
	// Position of the selected frame in seconds.
	TimeSeconds float64 `json:"time_seconds"`
	// Signed image URL, valid for up to ten minutes. Available once the poster exists,
	// regardless of preview_enabled.
	URL string `json:"url" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Height      respjson.Field
		Path        respjson.Field
		Width       respjson.Field
		CdnURL      respjson.Field
		PreviewURL  respjson.Field
		Size        respjson.Field
		TimeSeconds respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Poster image, available once generated.

func (AssetPoster) RawJSON added in v0.17.0

func (r AssetPoster) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetPoster) UnmarshalJSON added in v0.17.0

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

type AssetService added in v0.17.0

type AssetService struct {
	Options []option.RequestOption
	// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
	Outputs AssetOutputService
	// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
	Workflow AssetWorkflowService
}

Automatic video-on-demand Assets and independent H.264 MP4 static renditions.

AssetService contains methods and other services that help with interacting with the chunkify 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 NewAssetService method instead.

func NewAssetService added in v0.17.0

func NewAssetService(opts ...option.RequestOption) (r AssetService)

NewAssetService 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 (*AssetService) Delete added in v0.17.0

func (r *AssetService) Delete(ctx context.Context, assetID string, body AssetDeleteParams, opts ...option.RequestOption) (err error)

Delete an Asset after all processing finishes. Files remain in Storage unless delete_files is true.

func (*AssetService) Get added in v0.17.0

func (r *AssetService) Get(ctx context.Context, assetID string, opts ...option.RequestOption) (res *Asset, err error)

Retrieve an Asset and its streaming, static, poster, and timeline outputs.

func (*AssetService) List added in v0.17.0

List Assets in the Project, with filtering and pagination.

func (*AssetService) ListAutoPaging added in v0.17.0

List Assets in the Project, with filtering and pagination.

func (*AssetService) New added in v0.17.0

func (r *AssetService) New(ctx context.Context, body AssetNewParams, opts ...option.RequestOption) (res *Asset, err error)

Create an Asset from a video Source. Processing starts asynchronously.

func (*AssetService) Update added in v0.17.0

func (r *AssetService) Update(ctx context.Context, assetID string, body AssetUpdateParams, opts ...option.RequestOption) (err error)

Update the title, metadata, or public preview access. Omitted fields remain unchanged.

type AssetSourceMetadata added in v0.17.0

type AssetSourceMetadata struct {
	// Original audio bitrate in bits per second, or zero when unavailable.
	AudioBitrate int64 `json:"audio_bitrate" api:"required"`
	// Original audio codec, or an empty string when there is no audio.
	AudioCodec string `json:"audio_codec" api:"required"`
	// Original audio sample rate in Hz, or zero when unavailable.
	AudioSamplerate int64 `json:"audio_samplerate" api:"required"`
	// Original duration in seconds.
	Duration float64 `json:"duration" api:"required"`
	// Original video height in pixels.
	Height int64 `json:"height" api:"required"`
	// Original file size in bytes.
	Size int64 `json:"size" api:"required"`
	// Original video bitrate in bits per second, or zero when unknown.
	VideoBitrate int64 `json:"video_bitrate" api:"required"`
	// Original video codec.
	VideoCodec string `json:"video_codec" api:"required"`
	// Original video frame rate in frames per second.
	VideoFramerate float64 `json:"video_framerate" api:"required"`
	// Original video width in pixels.
	Width int64 `json:"width" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AudioBitrate    respjson.Field
		AudioCodec      respjson.Field
		AudioSamplerate respjson.Field
		Duration        respjson.Field
		Height          respjson.Field
		Size            respjson.Field
		VideoBitrate    respjson.Field
		VideoCodec      respjson.Field
		VideoFramerate  respjson.Field
		Width           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Original media metadata saved at Asset creation and preserved after Source deletion.

func (AssetSourceMetadata) RawJSON added in v0.17.0

func (r AssetSourceMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetSourceMetadata) UnmarshalJSON added in v0.17.0

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

type AssetStaticRenditionCreateParams added in v0.17.0

type AssetStaticRenditionCreateParams struct {
	// H.264 MP4 resolution. highest selects the largest supported output without
	// upscaling. Hobby supports up to 1080p; other plans support up to 2160p.
	// Independent of the streaming resolution limits.
	//
	// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
	// "2160p".
	Resolution AssetStaticRenditionCreateParamsResolution `json:"resolution,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for an independently processed H.264 MP4 rendition.

The property Resolution is required.

func (AssetStaticRenditionCreateParams) MarshalJSON added in v0.17.0

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

func (*AssetStaticRenditionCreateParams) UnmarshalJSON added in v0.17.0

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

type AssetStaticRenditionCreateParamsResolution added in v0.17.0

type AssetStaticRenditionCreateParamsResolution string

H.264 MP4 resolution. highest selects the largest supported output without upscaling. Hobby supports up to 1080p; other plans support up to 2160p. Independent of the streaming resolution limits.

const (
	AssetStaticRenditionCreateParamsResolutionHighest AssetStaticRenditionCreateParamsResolution = "highest"
	AssetStaticRenditionCreateParamsResolution240p    AssetStaticRenditionCreateParamsResolution = "240p"
	AssetStaticRenditionCreateParamsResolution360p    AssetStaticRenditionCreateParamsResolution = "360p"
	AssetStaticRenditionCreateParamsResolution480p    AssetStaticRenditionCreateParamsResolution = "480p"
	AssetStaticRenditionCreateParamsResolution540p    AssetStaticRenditionCreateParamsResolution = "540p"
	AssetStaticRenditionCreateParamsResolution720p    AssetStaticRenditionCreateParamsResolution = "720p"
	AssetStaticRenditionCreateParamsResolution1080p   AssetStaticRenditionCreateParamsResolution = "1080p"
	AssetStaticRenditionCreateParamsResolution1440p   AssetStaticRenditionCreateParamsResolution = "1440p"
	AssetStaticRenditionCreateParamsResolution2160p   AssetStaticRenditionCreateParamsResolution = "2160p"
)

type AssetStatus added in v0.17.0

type AssetStatus string
const (
	AssetStatusPreparing AssetStatus = "preparing"
	AssetStatusReady     AssetStatus = "ready"
	AssetStatusFailed    AssetStatus = "failed"
	AssetStatusExpired   AssetStatus = "expired"
)

type AssetTimelinePreviews added in v0.17.0

type AssetTimelinePreviews struct {
	// Thumbnail image layout.
	Format constant.Sprite `json:"format" default:"sprite"`
	// WebVTT file path in Storage.
	VttPath string `json:"vtt_path" api:"required"`
	// Unsigned WebVTT CDN URL. Available when the Asset is ready and Storage has a CDN
	// URL.
	CdnURL string `json:"cdn_url" format:"uri"`
	// Number of thumbnails.
	ImageCount int64 `json:"image_count"`
	// Target thumbnail sampling interval in seconds. The WebVTT file provides actual
	// cue timestamps.
	IntervalSeconds float64 `json:"interval_seconds"`
	// Public WebVTT preview URL with signed image references. Available when the Asset
	// is ready and preview_enabled is true.
	PreviewURL string `json:"preview_url" format:"uri"`
	// Combined WebVTT and sprite image size in bytes.
	Size int64 `json:"size"`
	// Number of sprite images containing the thumbnails.
	SpriteCount int64 `json:"sprite_count"`
	// Thumbnail height in pixels.
	ThumbnailHeight int64 `json:"thumbnail_height"`
	// Thumbnail width in pixels.
	ThumbnailWidth int64 `json:"thumbnail_width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Format          respjson.Field
		VttPath         respjson.Field
		CdnURL          respjson.Field
		ImageCount      respjson.Field
		IntervalSeconds respjson.Field
		PreviewURL      respjson.Field
		Size            respjson.Field
		SpriteCount     respjson.Field
		ThumbnailHeight respjson.Field
		ThumbnailWidth  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Timeline thumbnails. The WebVTT file maps video timestamps to image URLs and crop coordinates.

func (AssetTimelinePreviews) RawJSON added in v0.17.0

func (r AssetTimelinePreviews) RawJSON() string

Returns the unmodified JSON received from the API

func (*AssetTimelinePreviews) UnmarshalJSON added in v0.17.0

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

type AssetUpdateParams added in v0.17.0

type AssetUpdateParams struct {
	// Allow public preview access without an API token. Does not control CDN or static
	// download access. Disabling it does not revoke signed URLs already issued.
	PreviewEnabled param.Opt[bool] `json:"preview_enabled,omitzero"`
	// Asset title, up to 256 characters. Send an empty string to clear it; omit to
	// leave unchanged.
	Title param.Opt[string] `json:"title,omitzero"`
	// Replaces all metadata. Send {} to clear it; omit to leave unchanged. Maximum
	// encoded JSON size: 2,048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// contains filtered or unexported fields
}

func (AssetUpdateParams) MarshalJSON added in v0.17.0

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

func (*AssetUpdateParams) UnmarshalJSON added in v0.17.0

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

type AssetWorkflowActionListParams added in v0.17.0

type AssetWorkflowActionListParams struct {
	// LatestPerAction specifies whether to return only the latest execution of each
	// rule and action on the Asset. Defaults to false. Pagination and total count
	// apply after this selection.
	LatestPerAction param.Opt[bool] `query:"latest_per_action,omitzero" json:"-"`
	// Limit specifies the maximum number of results to return. Accepts 1 to 100.
	// Defaults to 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Offset specifies the number of matching results to skip. Must be at least 0.
	// Defaults to 0.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Revision specifies the Workflow revision to filter by. Omit it to include all
	// revisions.
	Revision param.Opt[int64]                     `query:"revision,omitzero" json:"-"`
	Created  AssetWorkflowActionListParamsCreated `query:"created,omitzero" json:"-"`
	// Status specifies the action status to filter by. Omit it to include all
	// statuses.
	//
	// Any of "pending", "running", "waiting", "completed", "failed", "skipped",
	// "cancelled".
	Status AssetWorkflowActionListParamsStatus `query:"status,omitzero" json:"-"`
	// Type specifies the action type to filter by. Omit it to include all action
	// types.
	//
	// Any of "create_static_rendition", "create_caption", "create_transcript",
	// "translate_caption".
	Type AssetWorkflowActionListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetWorkflowActionListParams) URLQuery added in v0.17.0

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

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

type AssetWorkflowActionListParamsCreated added in v0.17.0

type AssetWorkflowActionListParamsCreated struct {
	// Created at or after this Unix timestamp in seconds.
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Created at or before this Unix timestamp in seconds.
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AssetWorkflowActionListParamsCreated) URLQuery added in v0.17.0

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

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

type AssetWorkflowActionListParamsStatus added in v0.17.0

type AssetWorkflowActionListParamsStatus string

Status specifies the action status to filter by. Omit it to include all statuses.

const (
	AssetWorkflowActionListParamsStatusPending   AssetWorkflowActionListParamsStatus = "pending"
	AssetWorkflowActionListParamsStatusRunning   AssetWorkflowActionListParamsStatus = "running"
	AssetWorkflowActionListParamsStatusWaiting   AssetWorkflowActionListParamsStatus = "waiting"
	AssetWorkflowActionListParamsStatusCompleted AssetWorkflowActionListParamsStatus = "completed"
	AssetWorkflowActionListParamsStatusFailed    AssetWorkflowActionListParamsStatus = "failed"
	AssetWorkflowActionListParamsStatusSkipped   AssetWorkflowActionListParamsStatus = "skipped"
	AssetWorkflowActionListParamsStatusCancelled AssetWorkflowActionListParamsStatus = "cancelled"
)

type AssetWorkflowActionListParamsType added in v0.17.0

type AssetWorkflowActionListParamsType string

Type specifies the action type to filter by. Omit it to include all action types.

const (
	AssetWorkflowActionListParamsTypeCreateStaticRendition AssetWorkflowActionListParamsType = "create_static_rendition"
	AssetWorkflowActionListParamsTypeCreateCaption         AssetWorkflowActionListParamsType = "create_caption"
	AssetWorkflowActionListParamsTypeCreateTranscript      AssetWorkflowActionListParamsType = "create_transcript"
	AssetWorkflowActionListParamsTypeTranslateCaption      AssetWorkflowActionListParamsType = "translate_caption"
)

type AssetWorkflowActionService added in v0.17.0

type AssetWorkflowActionService struct {
	Options []option.RequestOption
}

Automatic video-on-demand Assets and independent H.264 MP4 static renditions.

AssetWorkflowActionService contains methods and other services that help with interacting with the chunkify 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 NewAssetWorkflowActionService method instead.

func NewAssetWorkflowActionService added in v0.17.0

func NewAssetWorkflowActionService(opts ...option.RequestOption) (r AssetWorkflowActionService)

NewAssetWorkflowActionService 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 (*AssetWorkflowActionService) List added in v0.17.0

List retained Workflow actions for an Asset, newest first. Direct output requests are excluded.

func (*AssetWorkflowActionService) ListAutoPaging added in v0.17.0

List retained Workflow actions for an Asset, newest first. Direct output requests are excluded.

type AssetWorkflowService added in v0.17.0

type AssetWorkflowService struct {
	Options []option.RequestOption
	// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
	Actions AssetWorkflowActionService
}

Automatic video-on-demand Assets and independent H.264 MP4 static renditions.

AssetWorkflowService contains methods and other services that help with interacting with the chunkify 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 NewAssetWorkflowService method instead.

func NewAssetWorkflowService added in v0.17.0

func NewAssetWorkflowService(opts ...option.RequestOption) (r AssetWorkflowService)

NewAssetWorkflowService 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 (*AssetWorkflowService) Update added in v0.17.0

func (r *AssetWorkflowService) Update(ctx context.Context, assetID string, opts ...option.RequestOption) (res *WorkflowRun, err error)

Update a ready Asset to the latest revision of its selected Workflow. Existing outputs are preserved and missing outputs are created.

type AssetWorkflowUpdateResponseEnvelope added in v0.17.0

type AssetWorkflowUpdateResponseEnvelope struct {
	// The requested Workflow run.
	Data WorkflowRun `json:"data" api:"required"`
	// Status of the API request. Always success for this response.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing one Workflow run.

func (AssetWorkflowUpdateResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*AssetWorkflowUpdateResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type ChunkifyError added in v0.6.0

type ChunkifyError = shared.ChunkifyError

This is an alias to an internal type.

type ChunkifyErrorType added in v0.6.0

type ChunkifyErrorType = shared.ChunkifyErrorType

Type of error

This is an alias to an internal type.

type Client

type Client struct {
	Options []option.RequestOption
	// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
	Assets        AssetService
	Events        EventService
	Files         FileService
	Jobs          JobService
	Metrics       MetricService
	Notifications NotificationService
	Projects      ProjectService
	Sources       SourceService
	Storages      StorageService
	Thumbnails    ThumbnailService
	Tokens        TokenService
	Transcodings  TranscodingService
	Uploads       UploadService
	Webhooks      WebhookService
	Workflows     WorkflowService
}

Client creates a struct with services and top level methods that help with interacting with the chunkify 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 (CHUNKIFY_TOKEN, CHUNKIFY_TEAM_TOKEN, CHUNKIFY_WEBHOOK_SECRET, CHUNKIFY_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 added in v0.6.0

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

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

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

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

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

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 Error added in v0.6.0

type Error = apierror.Error

type Event added in v0.17.0

type Event struct {
	// Unique event ID.
	ID string `json:"id" api:"required"`
	// Time the event occurred.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Number of retained webhook delivery attempts.
	DeliveryCount int64 `json:"delivery_count" api:"required"`
	// Summary of the latest retained attempt for each webhook. none means no retained
	// attempts; pending means at least one latest attempt is awaiting delivery; failed
	// means at least one latest attempt failed and none are pending; delivered means
	// all latest attempts succeeded. Earlier failures superseded by successful retries
	// do not mark the event failed.
	//
	// Any of "none", "pending", "delivered", "failed".
	DeliveryStatus EventDeliveryStatus `json:"delivery_status" api:"required"`
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Event EventEvent `json:"event" api:"required"`
	// Retention deadline set from the project team plan when the event was recorded.
	// Deliveries and retries share this deadline.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// ID of the resource that caused this event.
	ObjectID string `json:"object_id" api:"required"`
	// Immutable JSON event envelope. Its ID is the event ID; webhook delivery
	// envelopes retain their notification IDs. Signed links in historical snapshots
	// may have expired.
	Payload string `json:"payload" api:"required"`
	// Related resource IDs retained independently of resource deletion.
	RelatedObjectIDs []string `json:"related_object_ids" api:"required"`
	// First 100 delivery attempts, oldest first; included on retrieval. List
	// notifications with event_id to paginate all attempts.
	Deliveries []Notification `json:"deliveries"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		DeliveryCount    respjson.Field
		DeliveryStatus   respjson.Field
		Event            respjson.Field
		ExpiresAt        respjson.Field
		ObjectID         respjson.Field
		Payload          respjson.Field
		RelatedObjectIDs respjson.Field
		Deliveries       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A retained lifecycle event, recorded independently of webhook subscriptions. The payload is an immutable JSON snapshot.

func (Event) RawJSON added in v0.17.0

func (r Event) RawJSON() string

Returns the unmodified JSON received from the API

func (*Event) UnmarshalJSON added in v0.17.0

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

type EventDeliveryStatus added in v0.17.0

type EventDeliveryStatus string

Summary of the latest retained attempt for each webhook. none means no retained attempts; pending means at least one latest attempt is awaiting delivery; failed means at least one latest attempt failed and none are pending; delivered means all latest attempts succeeded. Earlier failures superseded by successful retries do not mark the event failed.

const (
	EventDeliveryStatusNone      EventDeliveryStatus = "none"
	EventDeliveryStatusPending   EventDeliveryStatus = "pending"
	EventDeliveryStatusDelivered EventDeliveryStatus = "delivered"
	EventDeliveryStatusFailed    EventDeliveryStatus = "failed"
)

type EventEvent added in v0.17.0

type EventEvent string
const (
	EventEventJobCreated           EventEvent = "job.created"
	EventEventJobCompleted         EventEvent = "job.completed"
	EventEventJobFailed            EventEvent = "job.failed"
	EventEventJobCancelled         EventEvent = "job.cancelled"
	EventEventSourceCreated        EventEvent = "source.created"
	EventEventSourceDeleted        EventEvent = "source.deleted"
	EventEventUploadCreated        EventEvent = "upload.created"
	EventEventUploadCompleted      EventEvent = "upload.completed"
	EventEventUploadFailed         EventEvent = "upload.failed"
	EventEventUploadExpired        EventEvent = "upload.expired"
	EventEventAssetCreated         EventEvent = "asset.created"
	EventEventAssetReady           EventEvent = "asset.ready"
	EventEventAssetPlaybackReady   EventEvent = "asset.playback_ready"
	EventEventAssetFailed          EventEvent = "asset.failed"
	EventEventAssetExpired         EventEvent = "asset.expired"
	EventEventAssetDeleted         EventEvent = "asset.deleted"
	EventEventAssetOutputCreated   EventEvent = "asset.output.created"
	EventEventAssetOutputReady     EventEvent = "asset.output.ready"
	EventEventAssetOutputFailed    EventEvent = "asset.output.failed"
	EventEventAssetOutputDeleted   EventEvent = "asset.output.deleted"
	EventEventWorkflowRunCreated   EventEvent = "workflow_run.created"
	EventEventWorkflowRunCompleted EventEvent = "workflow_run.completed"
	EventEventWorkflowRunFailed    EventEvent = "workflow_run.failed"
	EventEventWorkflowRunCancelled EventEvent = "workflow_run.cancelled"
	EventEventTranscodingCreated   EventEvent = "transcoding.created"
	EventEventTranscodingReady     EventEvent = "transcoding.ready"
	EventEventTranscodingFailed    EventEvent = "transcoding.failed"
	EventEventTranscodingCancelled EventEvent = "transcoding.cancelled"
	EventEventTranscodingExpired   EventEvent = "transcoding.expired"
	EventEventTranscodingDeleted   EventEvent = "transcoding.deleted"
	EventEventThumbnailCreated     EventEvent = "thumbnail.created"
	EventEventThumbnailReady       EventEvent = "thumbnail.ready"
	EventEventThumbnailFailed      EventEvent = "thumbnail.failed"
	EventEventThumbnailExpired     EventEvent = "thumbnail.expired"
	EventEventThumbnailDeleted     EventEvent = "thumbnail.deleted"
)

type EventGetResponseEnvelope added in v0.17.0

type EventGetResponseEnvelope struct {
	// A retained lifecycle event, recorded independently of webhook subscriptions. The
	// payload is an immutable JSON snapshot.
	Data Event `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (EventGetResponseEnvelope) RawJSON added in v0.17.0

func (r EventGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*EventGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type EventListParams added in v0.17.0

type EventListParams struct {
	// Pagination limit (max 100)
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by the primary or a related resource ID, including retained associations
	// after resource deletion.
	ObjectID param.Opt[string] `query:"object_id,omitzero" json:"-"`
	// Pagination offset
	Offset  param.Opt[int64]       `query:"offset,omitzero" json:"-"`
	Created EventListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by events
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Events []string `query:"events,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EventListParams) URLQuery added in v0.17.0

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

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

type EventListParamsCreated added in v0.17.0

type EventListParamsCreated struct {
	// Filter by creation date greater than or equal (UNIX epoch time)
	Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
	// Sort by creation date (asc/desc)
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (EventListParamsCreated) URLQuery added in v0.17.0

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

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

type EventService added in v0.17.0

type EventService struct {
	Options []option.RequestOption
}

EventService contains methods and other services that help with interacting with the chunkify 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 NewEventService method instead.

func NewEventService added in v0.17.0

func NewEventService(opts ...option.RequestOption) (r EventService)

NewEventService 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 (*EventService) Get added in v0.17.0

func (r *EventService) Get(ctx context.Context, eventID string, opts ...option.RequestOption) (res *Event, err error)

Retrieve a retained event, its frozen payload, related resources, and up to 100 delivery attempts. No webhook configuration is required.

func (*EventService) List added in v0.17.0

List lifecycle events recorded with or without webhooks. Events and their deliveries expire according to the plan retention deadline. Historical notifications recorded before the event log remain available through Notifications.

func (*EventService) ListAutoPaging added in v0.17.0

List lifecycle events recorded with or without webhooks. Events and their deliveries expire according to the plan retention deadline. Historical notifications recorded before the event log remain available through Notifications.

type FileGetResponseEnvelope added in v0.6.0

type FileGetResponseEnvelope struct {
	// Data contains the response object
	Data JobFile `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Successful response

func (FileGetResponseEnvelope) RawJSON added in v0.6.0

func (r FileGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*FileGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type FileListParams

type FileListParams struct {
	// Filter by file ID
	ID param.Opt[string] `query:"id,omitzero" json:"-"`
	// Filter by audio codec
	AudioCodec param.Opt[string] `query:"audio_codec,omitzero" json:"-"`
	// Filter by job ID
	JobID param.Opt[string] `query:"job_id,omitzero" json:"-"`
	// Pagination limit (max 100)
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by mime type
	MimeType param.Opt[string] `query:"mime_type,omitzero" json:"-"`
	// Pagination offset
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter by storage ID
	StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
	// Filter by video codec
	VideoCodec param.Opt[string]      `query:"video_codec,omitzero" json:"-"`
	Created    FileListParamsCreated  `query:"created,omitzero" json:"-"`
	Duration   FileListParamsDuration `query:"duration,omitzero" json:"-"`
	Height     FileListParamsHeight   `query:"height,omitzero" json:"-"`
	Path       FileListParamsPath     `query:"path,omitzero" json:"-"`
	Size       FileListParamsSize     `query:"size,omitzero" json:"-"`
	Width      FileListParamsWidth    `query:"width,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParams) URLQuery added in v0.6.0

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

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

type FileListParamsCreated added in v0.6.0

type FileListParamsCreated struct {
	// Filter by creation date greater than or equal (UNIX epoch time)
	Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
	// Sort by creation date (asc/desc)
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParamsCreated) URLQuery added in v0.6.0

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

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

type FileListParamsDuration added in v0.6.0

type FileListParamsDuration struct {
	// Filter by exact duration
	Eq param.Opt[float64] `query:"eq,omitzero" json:"-"`
	// Filter by duration greater than
	Gt param.Opt[float64] `query:"gt,omitzero" json:"-"`
	// Filter by duration greater than or equal
	Gte param.Opt[float64] `query:"gte,omitzero" json:"-"`
	// Filter by duration less than
	Lt param.Opt[float64] `query:"lt,omitzero" json:"-"`
	// Filter by duration less than or equal
	Lte param.Opt[float64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParamsDuration) URLQuery added in v0.6.0

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

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

type FileListParamsHeight added in v0.6.0

type FileListParamsHeight struct {
	// Filter by exact height
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by height greater than
	Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
	// Filter by height greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by height less than
	Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
	// Filter by height less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParamsHeight) URLQuery added in v0.6.0

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

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

type FileListParamsPath added in v0.6.0

type FileListParamsPath struct {
	// Filter by path
	Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
	// Filter by path (case insensitive)
	Ilike param.Opt[string] `query:"ilike,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParamsPath) URLQuery added in v0.6.0

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

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

type FileListParamsSize added in v0.6.0

type FileListParamsSize struct {
	// Filter by exact file size
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by file size greater than
	Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
	// Filter by file size greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by file size less than
	Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
	// Filter by file size less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParamsSize) URLQuery added in v0.6.0

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

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

type FileListParamsWidth added in v0.6.0

type FileListParamsWidth struct {
	// Filter by exact width
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by width greater than
	Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
	// Filter by width greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by width less than
	Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
	// Filter by width less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParamsWidth) URLQuery added in v0.6.0

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

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

type FileService added in v0.6.0

type FileService struct {
	Options []option.RequestOption
}

FileService contains methods and other services that help with interacting with the chunkify 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 NewFileService method instead.

func NewFileService added in v0.6.0

func NewFileService(opts ...option.RequestOption) (r FileService)

NewFileService 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 (*FileService) Delete deprecated added in v0.6.0

func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (err error)

Delete a file. It will fail if there are processing jobs using this file. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.

Deprecated: deprecated

func (*FileService) Get deprecated added in v0.6.0

func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *JobFile, err error)

Retrieve details of a specific file by its ID, including metadata, media properties, and associated jobs. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.

Deprecated: deprecated

func (*FileService) List deprecated added in v0.6.0

Retrieve a list of files with optional filtering and pagination. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.

Deprecated: deprecated

func (*FileService) ListAutoPaging deprecated added in v0.6.0

Retrieve a list of files with optional filtering and pagination. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.

Deprecated: deprecated

type HlsAv1 added in v0.6.0

type HlsAv1 struct {
	ID constant.HlsAv1 `json:"id" default:"hls_av1"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 63. Recommended
	// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// HlsEnc enables encryption for HLS segments when set to true.
	HlsEnc bool `json:"hls_enc"`
	// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncIv string `json:"hls_enc_iv"`
	// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncKey string `json:"hls_enc_key"`
	// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
	// Required when HlsEnc is true.
	HlsEncKeyURL string `json:"hls_enc_key_url"`
	// HlsSegmentType specifies the type of HLS segments. Valid values:
	//
	// - mpegts: Traditional MPEG-TS segments, better compatibility
	// - fmp4: Fragmented MP4 segments, better efficiency
	//
	// Any of "mpegts", "fmp4".
	HlsSegmentType HlsAv1HlsSegmentType `json:"hls_segment_type"`
	// HlsSingleFile specifies whether to store HLS segments in one file using byte
	// ranges. Defaults to true. Set to false to create separate segment files.
	HlsSingleFile bool `json:"hls_single_file"`
	// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
	// Shorter segments provide faster startup but more overhead, longer segments are
	// more efficient.
	HlsTime int64 `json:"hls_time"`
	// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
	// Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  int64  `json:"minrate"`
	Movflags string `json:"movflags"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt HlsAv1Pixfmt `json:"pixfmt"`
	// Preset controls the encoding efficiency and processing intensity. Lower presets
	// use more optimization features, creating smaller files with better quality but
	// requiring more compute time. Higher presets encode faster but produce larger
	// files.
	//
	// Preset ranges:
	//
	// - 6-7: Fast encoding for real-time applications (smaller files)
	// - 8-10: Balanced efficiency and speed for general use
	// - 11-13: Fastest encoding for real-time applications (larger files)
	//
	// Any of "6", "7", "8", "9", "10", "11", "12", "13".
	Preset HlsAv1Preset `json:"preset"`
	// Profilev specifies the AV1 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev HlsAv1Profilev `json:"profilev"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		AudioBitrate   respjson.Field
		Bufsize        respjson.Field
		Channels       respjson.Field
		Crf            respjson.Field
		DisableAudio   respjson.Field
		DisableVideo   respjson.Field
		Duration       respjson.Field
		Framerate      respjson.Field
		Gop            respjson.Field
		Height         respjson.Field
		HlsEnc         respjson.Field
		HlsEncIv       respjson.Field
		HlsEncKey      respjson.Field
		HlsEncKeyURL   respjson.Field
		HlsSegmentType respjson.Field
		HlsSingleFile  respjson.Field
		HlsTime        respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       respjson.Field
		PerTitle       respjson.Field
		Pixfmt         respjson.Field
		Preset         respjson.Field
		Profilev       respjson.Field
		Seek           respjson.Field
		VideoBitrate   respjson.Field
		Width          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (HlsAv1) RawJSON added in v0.6.0

func (r HlsAv1) RawJSON() string

Returns the unmodified JSON received from the API

func (HlsAv1) ToParam added in v0.6.0

func (r HlsAv1) ToParam() HlsAv1Param

ToParam converts this HlsAv1 to a HlsAv1Param.

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 HlsAv1Param.Overrides()

func (*HlsAv1) UnmarshalJSON added in v0.6.0

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

type HlsAv1HlsSegmentType added in v0.6.0

type HlsAv1HlsSegmentType string

HlsSegmentType specifies the type of HLS segments. Valid values:

- mpegts: Traditional MPEG-TS segments, better compatibility - fmp4: Fragmented MP4 segments, better efficiency

const (
	HlsAv1HlsSegmentTypeMpegts HlsAv1HlsSegmentType = "mpegts"
	HlsAv1HlsSegmentTypeFmp4   HlsAv1HlsSegmentType = "fmp4"
)

type HlsAv1Param added in v0.6.0

type HlsAv1Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 63. Recommended
	// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// HlsEnc enables encryption for HLS segments when set to true.
	HlsEnc param.Opt[bool] `json:"hls_enc,omitzero"`
	// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncIv param.Opt[string] `json:"hls_enc_iv,omitzero"`
	// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncKey param.Opt[string] `json:"hls_enc_key,omitzero"`
	// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
	// Required when HlsEnc is true.
	HlsEncKeyURL param.Opt[string] `json:"hls_enc_key_url,omitzero"`
	// HlsSingleFile specifies whether to store HLS segments in one file using byte
	// ranges. Defaults to true. Set to false to create separate segment files.
	HlsSingleFile param.Opt[bool] `json:"hls_single_file,omitzero"`
	// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
	// Shorter segments provide faster startup but more overhead, longer segments are
	// more efficient.
	HlsTime param.Opt[int64] `json:"hls_time,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  param.Opt[int64]  `json:"minrate,omitzero"`
	Movflags param.Opt[string] `json:"movflags,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// HlsSegmentType specifies the type of HLS segments. Valid values:
	//
	// - mpegts: Traditional MPEG-TS segments, better compatibility
	// - fmp4: Fragmented MP4 segments, better efficiency
	//
	// Any of "mpegts", "fmp4".
	HlsSegmentType HlsAv1HlsSegmentType `json:"hls_segment_type,omitzero"`
	// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
	// Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt HlsAv1Pixfmt `json:"pixfmt,omitzero"`
	// Preset controls the encoding efficiency and processing intensity. Lower presets
	// use more optimization features, creating smaller files with better quality but
	// requiring more compute time. Higher presets encode faster but produce larger
	// files.
	//
	// Preset ranges:
	//
	// - 6-7: Fast encoding for real-time applications (smaller files)
	// - 8-10: Balanced efficiency and speed for general use
	// - 11-13: Fastest encoding for real-time applications (larger files)
	//
	// Any of "6", "7", "8", "9", "10", "11", "12", "13".
	Preset HlsAv1Preset `json:"preset,omitzero"`
	// Profilev specifies the AV1 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev HlsAv1Profilev `json:"profilev,omitzero"`
	// This field can be elided, and will marshal its zero value as "hls_av1".
	ID constant.HlsAv1 `json:"id" default:"hls_av1"`
	// contains filtered or unexported fields
}

The property ID is required.

func (HlsAv1Param) MarshalJSON added in v0.6.0

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

func (*HlsAv1Param) UnmarshalJSON added in v0.6.0

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

type HlsAv1Pixfmt added in v0.6.0

type HlsAv1Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	HlsAv1PixfmtYuv410p     HlsAv1Pixfmt = "yuv410p"
	HlsAv1PixfmtYuv411p     HlsAv1Pixfmt = "yuv411p"
	HlsAv1PixfmtYuv420p     HlsAv1Pixfmt = "yuv420p"
	HlsAv1PixfmtYuv422p     HlsAv1Pixfmt = "yuv422p"
	HlsAv1PixfmtYuv440p     HlsAv1Pixfmt = "yuv440p"
	HlsAv1PixfmtYuv444p     HlsAv1Pixfmt = "yuv444p"
	HlsAv1PixfmtYuvJ411p    HlsAv1Pixfmt = "yuvJ411p"
	HlsAv1PixfmtYuvJ420p    HlsAv1Pixfmt = "yuvJ420p"
	HlsAv1PixfmtYuvJ422p    HlsAv1Pixfmt = "yuvJ422p"
	HlsAv1PixfmtYuvJ440p    HlsAv1Pixfmt = "yuvJ440p"
	HlsAv1PixfmtYuvJ444p    HlsAv1Pixfmt = "yuvJ444p"
	HlsAv1PixfmtYuv420p10le HlsAv1Pixfmt = "yuv420p10le"
	HlsAv1PixfmtYuv422p10le HlsAv1Pixfmt = "yuv422p10le"
	HlsAv1PixfmtYuv440p10le HlsAv1Pixfmt = "yuv440p10le"
	HlsAv1PixfmtYuv444p10le HlsAv1Pixfmt = "yuv444p10le"
	HlsAv1PixfmtYuv420p12le HlsAv1Pixfmt = "yuv420p12le"
	HlsAv1PixfmtYuv422p12le HlsAv1Pixfmt = "yuv422p12le"
	HlsAv1PixfmtYuv440p12le HlsAv1Pixfmt = "yuv440p12le"
	HlsAv1PixfmtYuv444p12le HlsAv1Pixfmt = "yuv444p12le"
	HlsAv1PixfmtYuv420p10be HlsAv1Pixfmt = "yuv420p10be"
	HlsAv1PixfmtYuv422p10be HlsAv1Pixfmt = "yuv422p10be"
	HlsAv1PixfmtYuv440p10be HlsAv1Pixfmt = "yuv440p10be"
	HlsAv1PixfmtYuv444p10be HlsAv1Pixfmt = "yuv444p10be"
	HlsAv1PixfmtYuv420p12be HlsAv1Pixfmt = "yuv420p12be"
	HlsAv1PixfmtYuv422p12be HlsAv1Pixfmt = "yuv422p12be"
	HlsAv1PixfmtYuv440p12be HlsAv1Pixfmt = "yuv440p12be"
	HlsAv1PixfmtYuv444p12be HlsAv1Pixfmt = "yuv444p12be"
)

type HlsAv1Preset added in v0.6.0

type HlsAv1Preset string

Preset controls the encoding efficiency and processing intensity. Lower presets use more optimization features, creating smaller files with better quality but requiring more compute time. Higher presets encode faster but produce larger files.

Preset ranges:

- 6-7: Fast encoding for real-time applications (smaller files) - 8-10: Balanced efficiency and speed for general use - 11-13: Fastest encoding for real-time applications (larger files)

const (
	HlsAv1Preset6  HlsAv1Preset = "6"
	HlsAv1Preset7  HlsAv1Preset = "7"
	HlsAv1Preset8  HlsAv1Preset = "8"
	HlsAv1Preset9  HlsAv1Preset = "9"
	HlsAv1Preset10 HlsAv1Preset = "10"
	HlsAv1Preset11 HlsAv1Preset = "11"
	HlsAv1Preset12 HlsAv1Preset = "12"
	HlsAv1Preset13 HlsAv1Preset = "13"
)

type HlsAv1Profilev added in v0.6.0

type HlsAv1Profilev string

Profilev specifies the AV1 profile. Valid values:

- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images

const (
	HlsAv1ProfilevMain             HlsAv1Profilev = "main"
	HlsAv1ProfilevMain10           HlsAv1Profilev = "main10"
	HlsAv1ProfilevMainstillpicture HlsAv1Profilev = "mainstillpicture"
)

type HlsH264 added in v0.6.0

type HlsH264 struct {
	ID constant.HlsH264 `json:"id" default:"hls_h264"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// HlsEnc enables encryption for HLS segments when set to true.
	HlsEnc bool `json:"hls_enc"`
	// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncIv string `json:"hls_enc_iv"`
	// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncKey string `json:"hls_enc_key"`
	// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
	// Required when HlsEnc is true.
	HlsEncKeyURL string `json:"hls_enc_key_url"`
	// HlsSegmentType specifies the type of HLS segments. Valid values:
	//
	// - mpegts: Traditional MPEG-TS segments, better compatibility
	// - fmp4: Fragmented MP4 segments, better efficiency
	//
	// Any of "mpegts", "fmp4".
	HlsSegmentType HlsH264HlsSegmentType `json:"hls_segment_type"`
	// HlsSingleFile specifies whether to store HLS segments in one file using byte
	// ranges. Defaults to true. Set to false to create separate segment files.
	HlsSingleFile bool `json:"hls_single_file"`
	// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
	// Shorter segments provide faster startup but more overhead, longer segments are
	// more efficient.
	HlsTime int64 `json:"hls_time"`
	// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
	// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
	// resolutions and bitrates but require more processing power.
	//
	// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
	Level int64 `json:"level"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  int64  `json:"minrate"`
	Movflags string `json:"movflags"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt HlsH264Pixfmt `json:"pixfmt"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset HlsH264Preset `json:"preset"`
	// Profilev specifies the H.264 profile. Valid values:
	//
	// - baseline: Basic profile, good for mobile devices
	// - main: Main profile, good for most applications
	// - high: High profile, best quality but requires more processing
	// - high10: High 10-bit profile, supports 10-bit color
	// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
	// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
	//
	// Any of "baseline", "main", "high", "high10", "high422", "high444".
	Profilev HlsH264Profilev `json:"profilev"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// X264KeyInt specifies the maximum number of frames between keyframes for H.264
	// encoding. Range: 1 to 960. Higher values can improve compression but may affect
	// seeking.
	X264Keyint int64 `json:"x264_keyint"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		AudioBitrate   respjson.Field
		Bufsize        respjson.Field
		Channels       respjson.Field
		Crf            respjson.Field
		DisableAudio   respjson.Field
		DisableVideo   respjson.Field
		Duration       respjson.Field
		Framerate      respjson.Field
		Gop            respjson.Field
		Height         respjson.Field
		HlsEnc         respjson.Field
		HlsEncIv       respjson.Field
		HlsEncKey      respjson.Field
		HlsEncKeyURL   respjson.Field
		HlsSegmentType respjson.Field
		HlsSingleFile  respjson.Field
		HlsTime        respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       respjson.Field
		PerTitle       respjson.Field
		Pixfmt         respjson.Field
		Preset         respjson.Field
		Profilev       respjson.Field
		Seek           respjson.Field
		VideoBitrate   respjson.Field
		Width          respjson.Field
		X264Keyint     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (HlsH264) RawJSON added in v0.6.0

func (r HlsH264) RawJSON() string

Returns the unmodified JSON received from the API

func (HlsH264) ToParam added in v0.6.0

func (r HlsH264) ToParam() HlsH264Param

ToParam converts this HlsH264 to a HlsH264Param.

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 HlsH264Param.Overrides()

func (*HlsH264) UnmarshalJSON added in v0.6.0

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

type HlsH264HlsSegmentType added in v0.6.0

type HlsH264HlsSegmentType string

HlsSegmentType specifies the type of HLS segments. Valid values:

- mpegts: Traditional MPEG-TS segments, better compatibility - fmp4: Fragmented MP4 segments, better efficiency

const (
	HlsH264HlsSegmentTypeMpegts HlsH264HlsSegmentType = "mpegts"
	HlsH264HlsSegmentTypeFmp4   HlsH264HlsSegmentType = "fmp4"
)

type HlsH264Param added in v0.6.0

type HlsH264Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// HlsEnc enables encryption for HLS segments when set to true.
	HlsEnc param.Opt[bool] `json:"hls_enc,omitzero"`
	// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncIv param.Opt[string] `json:"hls_enc_iv,omitzero"`
	// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncKey param.Opt[string] `json:"hls_enc_key,omitzero"`
	// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
	// Required when HlsEnc is true.
	HlsEncKeyURL param.Opt[string] `json:"hls_enc_key_url,omitzero"`
	// HlsSingleFile specifies whether to store HLS segments in one file using byte
	// ranges. Defaults to true. Set to false to create separate segment files.
	HlsSingleFile param.Opt[bool] `json:"hls_single_file,omitzero"`
	// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
	// Shorter segments provide faster startup but more overhead, longer segments are
	// more efficient.
	HlsTime param.Opt[int64] `json:"hls_time,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  param.Opt[int64]  `json:"minrate,omitzero"`
	Movflags param.Opt[string] `json:"movflags,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// X264KeyInt specifies the maximum number of frames between keyframes for H.264
	// encoding. Range: 1 to 960. Higher values can improve compression but may affect
	// seeking.
	X264Keyint param.Opt[int64] `json:"x264_keyint,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// HlsSegmentType specifies the type of HLS segments. Valid values:
	//
	// - mpegts: Traditional MPEG-TS segments, better compatibility
	// - fmp4: Fragmented MP4 segments, better efficiency
	//
	// Any of "mpegts", "fmp4".
	HlsSegmentType HlsH264HlsSegmentType `json:"hls_segment_type,omitzero"`
	// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
	// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
	// resolutions and bitrates but require more processing power.
	//
	// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
	Level int64 `json:"level,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt HlsH264Pixfmt `json:"pixfmt,omitzero"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset HlsH264Preset `json:"preset,omitzero"`
	// Profilev specifies the H.264 profile. Valid values:
	//
	// - baseline: Basic profile, good for mobile devices
	// - main: Main profile, good for most applications
	// - high: High profile, best quality but requires more processing
	// - high10: High 10-bit profile, supports 10-bit color
	// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
	// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
	//
	// Any of "baseline", "main", "high", "high10", "high422", "high444".
	Profilev HlsH264Profilev `json:"profilev,omitzero"`
	// This field can be elided, and will marshal its zero value as "hls_h264".
	ID constant.HlsH264 `json:"id" default:"hls_h264"`
	// contains filtered or unexported fields
}

The property ID is required.

func (HlsH264Param) MarshalJSON added in v0.6.0

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

func (*HlsH264Param) UnmarshalJSON added in v0.6.0

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

type HlsH264Pixfmt added in v0.6.0

type HlsH264Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	HlsH264PixfmtYuv410p     HlsH264Pixfmt = "yuv410p"
	HlsH264PixfmtYuv411p     HlsH264Pixfmt = "yuv411p"
	HlsH264PixfmtYuv420p     HlsH264Pixfmt = "yuv420p"
	HlsH264PixfmtYuv422p     HlsH264Pixfmt = "yuv422p"
	HlsH264PixfmtYuv440p     HlsH264Pixfmt = "yuv440p"
	HlsH264PixfmtYuv444p     HlsH264Pixfmt = "yuv444p"
	HlsH264PixfmtYuvJ411p    HlsH264Pixfmt = "yuvJ411p"
	HlsH264PixfmtYuvJ420p    HlsH264Pixfmt = "yuvJ420p"
	HlsH264PixfmtYuvJ422p    HlsH264Pixfmt = "yuvJ422p"
	HlsH264PixfmtYuvJ440p    HlsH264Pixfmt = "yuvJ440p"
	HlsH264PixfmtYuvJ444p    HlsH264Pixfmt = "yuvJ444p"
	HlsH264PixfmtYuv420p10le HlsH264Pixfmt = "yuv420p10le"
	HlsH264PixfmtYuv422p10le HlsH264Pixfmt = "yuv422p10le"
	HlsH264PixfmtYuv440p10le HlsH264Pixfmt = "yuv440p10le"
	HlsH264PixfmtYuv444p10le HlsH264Pixfmt = "yuv444p10le"
	HlsH264PixfmtYuv420p12le HlsH264Pixfmt = "yuv420p12le"
	HlsH264PixfmtYuv422p12le HlsH264Pixfmt = "yuv422p12le"
	HlsH264PixfmtYuv440p12le HlsH264Pixfmt = "yuv440p12le"
	HlsH264PixfmtYuv444p12le HlsH264Pixfmt = "yuv444p12le"
	HlsH264PixfmtYuv420p10be HlsH264Pixfmt = "yuv420p10be"
	HlsH264PixfmtYuv422p10be HlsH264Pixfmt = "yuv422p10be"
	HlsH264PixfmtYuv440p10be HlsH264Pixfmt = "yuv440p10be"
	HlsH264PixfmtYuv444p10be HlsH264Pixfmt = "yuv444p10be"
	HlsH264PixfmtYuv420p12be HlsH264Pixfmt = "yuv420p12be"
	HlsH264PixfmtYuv422p12be HlsH264Pixfmt = "yuv422p12be"
	HlsH264PixfmtYuv440p12be HlsH264Pixfmt = "yuv440p12be"
	HlsH264PixfmtYuv444p12be HlsH264Pixfmt = "yuv444p12be"
)

type HlsH264Preset added in v0.6.0

type HlsH264Preset string

Preset specifies the encoding speed preset. Valid values (from fastest to slowest):

- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality

const (
	HlsH264PresetUltrafast HlsH264Preset = "ultrafast"
	HlsH264PresetSuperfast HlsH264Preset = "superfast"
	HlsH264PresetVeryfast  HlsH264Preset = "veryfast"
	HlsH264PresetFaster    HlsH264Preset = "faster"
	HlsH264PresetFast      HlsH264Preset = "fast"
	HlsH264PresetMedium    HlsH264Preset = "medium"
)

type HlsH264Profilev added in v0.6.0

type HlsH264Profilev string

Profilev specifies the H.264 profile. Valid values:

- baseline: Basic profile, good for mobile devices - main: Main profile, good for most applications - high: High profile, best quality but requires more processing - high10: High 10-bit profile, supports 10-bit color - high422: High 4:2:2 profile, supports 4:2:2 color sampling - high444: High 4:4:4 profile, supports 4:4:4 color sampling

const (
	HlsH264ProfilevBaseline HlsH264Profilev = "baseline"
	HlsH264ProfilevMain     HlsH264Profilev = "main"
	HlsH264ProfilevHigh     HlsH264Profilev = "high"
	HlsH264ProfilevHigh10   HlsH264Profilev = "high10"
	HlsH264ProfilevHigh422  HlsH264Profilev = "high422"
	HlsH264ProfilevHigh444  HlsH264Profilev = "high444"
)

type HlsH265 added in v0.6.0

type HlsH265 struct {
	ID constant.HlsH265 `json:"id" default:"hls_h265"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// HlsEnc enables encryption for HLS segments when set to true.
	HlsEnc bool `json:"hls_enc"`
	// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncIv string `json:"hls_enc_iv"`
	// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncKey string `json:"hls_enc_key"`
	// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
	// Required when HlsEnc is true.
	HlsEncKeyURL string `json:"hls_enc_key_url"`
	// HlsSegmentType specifies the type of HLS segments. Valid values:
	//
	// - mpegts: Traditional MPEG-TS segments, better compatibility
	// - fmp4: Fragmented MP4 segments, better efficiency
	//
	// Any of "mpegts", "fmp4".
	HlsSegmentType HlsH265HlsSegmentType `json:"hls_segment_type"`
	// HlsSingleFile specifies whether to store HLS segments in one file using byte
	// ranges. Defaults to true. Set to false to create separate segment files.
	HlsSingleFile bool `json:"hls_single_file"`
	// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
	// Shorter segments provide faster startup but more overhead, longer segments are
	// more efficient.
	HlsTime int64 `json:"hls_time"`
	// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
	// (main10). Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  int64  `json:"minrate"`
	Movflags string `json:"movflags"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt HlsH265Pixfmt `json:"pixfmt"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset HlsH265Preset `json:"preset"`
	// Profilev specifies the H.265 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev HlsH265Profilev `json:"profilev"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// X265KeyInt specifies the maximum number of frames between keyframes for H.265
	// encoding. Range: 1 to 300. Higher values can improve compression but may affect
	// seeking.
	X265Keyint int64 `json:"x265_keyint"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		AudioBitrate   respjson.Field
		Bufsize        respjson.Field
		Channels       respjson.Field
		Crf            respjson.Field
		DisableAudio   respjson.Field
		DisableVideo   respjson.Field
		Duration       respjson.Field
		Framerate      respjson.Field
		Gop            respjson.Field
		Height         respjson.Field
		HlsEnc         respjson.Field
		HlsEncIv       respjson.Field
		HlsEncKey      respjson.Field
		HlsEncKeyURL   respjson.Field
		HlsSegmentType respjson.Field
		HlsSingleFile  respjson.Field
		HlsTime        respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       respjson.Field
		PerTitle       respjson.Field
		Pixfmt         respjson.Field
		Preset         respjson.Field
		Profilev       respjson.Field
		Seek           respjson.Field
		VideoBitrate   respjson.Field
		Width          respjson.Field
		X265Keyint     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (HlsH265) RawJSON added in v0.6.0

func (r HlsH265) RawJSON() string

Returns the unmodified JSON received from the API

func (HlsH265) ToParam added in v0.6.0

func (r HlsH265) ToParam() HlsH265Param

ToParam converts this HlsH265 to a HlsH265Param.

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 HlsH265Param.Overrides()

func (*HlsH265) UnmarshalJSON added in v0.6.0

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

type HlsH265HlsSegmentType added in v0.6.0

type HlsH265HlsSegmentType string

HlsSegmentType specifies the type of HLS segments. Valid values:

- mpegts: Traditional MPEG-TS segments, better compatibility - fmp4: Fragmented MP4 segments, better efficiency

const (
	HlsH265HlsSegmentTypeMpegts HlsH265HlsSegmentType = "mpegts"
	HlsH265HlsSegmentTypeFmp4   HlsH265HlsSegmentType = "fmp4"
)

type HlsH265Param added in v0.6.0

type HlsH265Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// HlsEnc enables encryption for HLS segments when set to true.
	HlsEnc param.Opt[bool] `json:"hls_enc,omitzero"`
	// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncIv param.Opt[string] `json:"hls_enc_iv,omitzero"`
	// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
	// characters. Required when HlsEnc is true.
	HlsEncKey param.Opt[string] `json:"hls_enc_key,omitzero"`
	// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
	// Required when HlsEnc is true.
	HlsEncKeyURL param.Opt[string] `json:"hls_enc_key_url,omitzero"`
	// HlsSingleFile specifies whether to store HLS segments in one file using byte
	// ranges. Defaults to true. Set to false to create separate segment files.
	HlsSingleFile param.Opt[bool] `json:"hls_single_file,omitzero"`
	// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
	// Shorter segments provide faster startup but more overhead, longer segments are
	// more efficient.
	HlsTime param.Opt[int64] `json:"hls_time,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  param.Opt[int64]  `json:"minrate,omitzero"`
	Movflags param.Opt[string] `json:"movflags,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// X265KeyInt specifies the maximum number of frames between keyframes for H.265
	// encoding. Range: 1 to 300. Higher values can improve compression but may affect
	// seeking.
	X265Keyint param.Opt[int64] `json:"x265_keyint,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// HlsSegmentType specifies the type of HLS segments. Valid values:
	//
	// - mpegts: Traditional MPEG-TS segments, better compatibility
	// - fmp4: Fragmented MP4 segments, better efficiency
	//
	// Any of "mpegts", "fmp4".
	HlsSegmentType HlsH265HlsSegmentType `json:"hls_segment_type,omitzero"`
	// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
	// (main10). Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt HlsH265Pixfmt `json:"pixfmt,omitzero"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset HlsH265Preset `json:"preset,omitzero"`
	// Profilev specifies the H.265 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev HlsH265Profilev `json:"profilev,omitzero"`
	// This field can be elided, and will marshal its zero value as "hls_h265".
	ID constant.HlsH265 `json:"id" default:"hls_h265"`
	// contains filtered or unexported fields
}

The property ID is required.

func (HlsH265Param) MarshalJSON added in v0.6.0

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

func (*HlsH265Param) UnmarshalJSON added in v0.6.0

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

type HlsH265Pixfmt added in v0.6.0

type HlsH265Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	HlsH265PixfmtYuv410p     HlsH265Pixfmt = "yuv410p"
	HlsH265PixfmtYuv411p     HlsH265Pixfmt = "yuv411p"
	HlsH265PixfmtYuv420p     HlsH265Pixfmt = "yuv420p"
	HlsH265PixfmtYuv422p     HlsH265Pixfmt = "yuv422p"
	HlsH265PixfmtYuv440p     HlsH265Pixfmt = "yuv440p"
	HlsH265PixfmtYuv444p     HlsH265Pixfmt = "yuv444p"
	HlsH265PixfmtYuvJ411p    HlsH265Pixfmt = "yuvJ411p"
	HlsH265PixfmtYuvJ420p    HlsH265Pixfmt = "yuvJ420p"
	HlsH265PixfmtYuvJ422p    HlsH265Pixfmt = "yuvJ422p"
	HlsH265PixfmtYuvJ440p    HlsH265Pixfmt = "yuvJ440p"
	HlsH265PixfmtYuvJ444p    HlsH265Pixfmt = "yuvJ444p"
	HlsH265PixfmtYuv420p10le HlsH265Pixfmt = "yuv420p10le"
	HlsH265PixfmtYuv422p10le HlsH265Pixfmt = "yuv422p10le"
	HlsH265PixfmtYuv440p10le HlsH265Pixfmt = "yuv440p10le"
	HlsH265PixfmtYuv444p10le HlsH265Pixfmt = "yuv444p10le"
	HlsH265PixfmtYuv420p12le HlsH265Pixfmt = "yuv420p12le"
	HlsH265PixfmtYuv422p12le HlsH265Pixfmt = "yuv422p12le"
	HlsH265PixfmtYuv440p12le HlsH265Pixfmt = "yuv440p12le"
	HlsH265PixfmtYuv444p12le HlsH265Pixfmt = "yuv444p12le"
	HlsH265PixfmtYuv420p10be HlsH265Pixfmt = "yuv420p10be"
	HlsH265PixfmtYuv422p10be HlsH265Pixfmt = "yuv422p10be"
	HlsH265PixfmtYuv440p10be HlsH265Pixfmt = "yuv440p10be"
	HlsH265PixfmtYuv444p10be HlsH265Pixfmt = "yuv444p10be"
	HlsH265PixfmtYuv420p12be HlsH265Pixfmt = "yuv420p12be"
	HlsH265PixfmtYuv422p12be HlsH265Pixfmt = "yuv422p12be"
	HlsH265PixfmtYuv440p12be HlsH265Pixfmt = "yuv440p12be"
	HlsH265PixfmtYuv444p12be HlsH265Pixfmt = "yuv444p12be"
)

type HlsH265Preset added in v0.6.0

type HlsH265Preset string

Preset specifies the encoding speed preset. Valid values (from fastest to slowest):

- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality

const (
	HlsH265PresetUltrafast HlsH265Preset = "ultrafast"
	HlsH265PresetSuperfast HlsH265Preset = "superfast"
	HlsH265PresetVeryfast  HlsH265Preset = "veryfast"
	HlsH265PresetFaster    HlsH265Preset = "faster"
	HlsH265PresetFast      HlsH265Preset = "fast"
	HlsH265PresetMedium    HlsH265Preset = "medium"
)

type HlsH265Profilev added in v0.6.0

type HlsH265Profilev string

Profilev specifies the H.265 profile. Valid values:

- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images

const (
	HlsH265ProfilevMain             HlsH265Profilev = "main"
	HlsH265ProfilevMain10           HlsH265Profilev = "main10"
	HlsH265ProfilevMainstillpicture HlsH265Profilev = "mainstillpicture"
)

type Job

type Job struct {
	// Unique identifier for the job
	ID string `json:"id" api:"required"`
	// Billable time in seconds
	BillableTime int64 `json:"billable_time" api:"required"`
	// Creation timestamp
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The format parameters and settings for a job
	Format JobFormatUnion `json:"format" api:"required"`
	// Progress percentage of the job (0-100)
	Progress float64 `json:"progress" api:"required"`
	// ID of the source media being processed
	SourceID string `json:"source_id" api:"required"`
	// Current status of the job.
	//
	// Any of "pending", "queued", "ingesting", "transcoding", "downloading",
	// "merging", "uploading", "failed", "completed", "cancelled", "merged",
	// "downloaded", "transcoded", "waiting".
	Status JobStatus `json:"status" api:"required"`
	// Storage settings for where the job output will be saved
	Storage JobStorage `json:"storage" api:"required"`
	// Last update timestamp
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Error message for the job
	Error shared.ChunkifyError `json:"error"`
	// HLS manifest ID
	HlsManifestID string `json:"hls_manifest_id"`
	// Additional metadata for the job
	Metadata map[string]string `json:"metadata"`
	// When the job started processing
	StartedAt time.Time `json:"started_at" format:"date-time"`
	// The transcoder configuration for a job
	Transcoder JobTranscoder `json:"transcoder"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		BillableTime  respjson.Field
		CreatedAt     respjson.Field
		Format        respjson.Field
		Progress      respjson.Field
		SourceID      respjson.Field
		Status        respjson.Field
		Storage       respjson.Field
		UpdatedAt     respjson.Field
		Error         respjson.Field
		HlsManifestID respjson.Field
		Metadata      respjson.Field
		StartedAt     respjson.Field
		Transcoder    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Job) RawJSON added in v0.6.0

func (r Job) RawJSON() string

Returns the unmodified JSON received from the API

func (*Job) UnmarshalJSON added in v0.6.0

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

type JobFile added in v0.9.3

type JobFile struct {
	// Unique identifier of the file
	ID string `json:"id" api:"required"`
	// Audio bitrate in bits per second
	AudioBitrate int64 `json:"audio_bitrate" api:"required"`
	// Audio codec used
	AudioCodec string `json:"audio_codec" api:"required"`
	// Timestamp when the file was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Duration of the video in seconds
	Duration int64 `json:"duration" api:"required"`
	// Height of the video in pixels
	Height int64 `json:"height" api:"required"`
	// ID of the job that created this file
	JobID string `json:"job_id" api:"required"`
	// MIME type of the file
	MimeType string `json:"mime_type" api:"required"`
	// Path to the file in storage
	Path string `json:"path" api:"required"`
	// Size of the object at this File's path in bytes
	Size int64 `json:"size" api:"required"`
	// StorageId identifier where the file is stored
	StorageID string `json:"storage_id" api:"required"`
	// Pre-signed URL to directly access the file (only included when available)
	URL string `json:"url" api:"required"`
	// Video bitrate in bits per second
	VideoBitrate int64 `json:"video_bitrate" api:"required"`
	// Video codec used
	VideoCodec string `json:"video_codec" api:"required"`
	// Video framerate in frames per second
	VideoFramerate float64 `json:"video_framerate" api:"required"`
	// Width of the video in pixels
	Width int64 `json:"width" api:"required"`
	// Stable, unsigned CDN delivery URL derived from the file's current storage
	// configuration. Omitted when no CDN base URL is configured.
	CdnURL string `json:"cdn_url" api:"nullable" format:"uri"`
	// PackageSize specifies the media playlist and every media object it references in
	// bytes. Present only for HLS video media playlists; it excludes the shared master
	// playlist.
	PackageSize int64 `json:"package_size"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		AudioBitrate   respjson.Field
		AudioCodec     respjson.Field
		CreatedAt      respjson.Field
		Duration       respjson.Field
		Height         respjson.Field
		JobID          respjson.Field
		MimeType       respjson.Field
		Path           respjson.Field
		Size           respjson.Field
		StorageID      respjson.Field
		URL            respjson.Field
		VideoBitrate   respjson.Field
		VideoCodec     respjson.Field
		VideoFramerate respjson.Field
		Width          respjson.Field
		CdnURL         respjson.Field
		PackageSize    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (JobFile) RawJSON added in v0.9.3

func (r JobFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFile) UnmarshalJSON added in v0.9.3

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

type JobFileListResponse added in v0.6.0

type JobFileListResponse struct {
	Data []JobFile `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing a list of files for a job

func (JobFileListResponse) RawJSON added in v0.6.0

func (r JobFileListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFileListResponse) UnmarshalJSON added in v0.6.0

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

type JobFileService added in v0.6.0

type JobFileService struct {
	Options []option.RequestOption
}

JobFileService contains methods and other services that help with interacting with the chunkify 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 NewJobFileService method instead.

func NewJobFileService added in v0.6.0

func NewJobFileService(opts ...option.RequestOption) (r JobFileService)

NewJobFileService 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 (*JobFileService) List deprecated added in v0.6.0

func (r *JobFileService) List(ctx context.Context, jobID string, opts ...option.RequestOption) (res *JobFileListResponse, err error)

Retrieve all files associated with a specific job. Deprecated: Job files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.

Deprecated: deprecated

type JobFormatHlsAv1 added in v0.6.0

type JobFormatHlsAv1 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	HlsAv1
}

FFmpeg encoding parameters specific to HLS with AV1 encoding. When per-title optimization is disabled, either audio_bitrate or video_bitrate is required.

func (JobFormatHlsAv1) RawJSON added in v0.6.0

func (r JobFormatHlsAv1) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatHlsAv1) UnmarshalJSON added in v0.6.0

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

type JobFormatHlsH264 added in v0.6.0

type JobFormatHlsH264 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	HlsH264
}

FFmpeg encoding parameters specific to HLS with H.264 encoding. When per-title optimization is disabled, either audio_bitrate or video_bitrate is required.

func (JobFormatHlsH264) RawJSON added in v0.6.0

func (r JobFormatHlsH264) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatHlsH264) UnmarshalJSON added in v0.6.0

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

type JobFormatHlsH265 added in v0.6.0

type JobFormatHlsH265 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	HlsH265
}

FFmpeg encoding parameters specific to HLS with H.265 encoding. When per-title optimization is disabled, either audio_bitrate or video_bitrate is required.

func (JobFormatHlsH265) RawJSON added in v0.6.0

func (r JobFormatHlsH265) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatHlsH265) UnmarshalJSON added in v0.6.0

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

type JobFormatJpg added in v0.6.0

type JobFormatJpg struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	Jpg
}

FFmpeg encoding parameters specific to JPEG image extraction.

func (JobFormatJpg) RawJSON added in v0.6.0

func (r JobFormatJpg) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatJpg) UnmarshalJSON added in v0.6.0

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

type JobFormatMP4Av1 added in v0.6.0

type JobFormatMP4Av1 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	MP4Av1
}

FFmpeg encoding parameters specific to MP4 with AV1 encoding.

func (JobFormatMP4Av1) RawJSON added in v0.6.0

func (r JobFormatMP4Av1) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatMP4Av1) UnmarshalJSON added in v0.6.0

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

type JobFormatMP4H264 added in v0.6.0

type JobFormatMP4H264 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	MP4H264
}

FFmpeg encoding parameters specific to MP4 with H.264 encoding.

func (JobFormatMP4H264) RawJSON added in v0.6.0

func (r JobFormatMP4H264) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatMP4H264) UnmarshalJSON added in v0.6.0

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

type JobFormatMP4H265 added in v0.6.0

type JobFormatMP4H265 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	MP4H265
}

FFmpeg encoding parameters specific to MP4 with H.265 encoding.

func (JobFormatMP4H265) RawJSON added in v0.6.0

func (r JobFormatMP4H265) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatMP4H265) UnmarshalJSON added in v0.6.0

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

type JobFormatUnion added in v0.6.0

type JobFormatUnion struct {
	// Any of "mp4_av1", "mp4_h264", "mp4_h265", "webm_vp9", "hls_av1", "hls_h264",
	// "hls_h265", "jpg".
	ID           string  `json:"id"`
	AudioBitrate int64   `json:"audio_bitrate"`
	Bufsize      int64   `json:"bufsize"`
	Channels     int64   `json:"channels"`
	Crf          int64   `json:"crf"`
	DisableAudio bool    `json:"disable_audio"`
	DisableVideo bool    `json:"disable_video"`
	Duration     int64   `json:"duration"`
	Framerate    float64 `json:"framerate"`
	Gop          int64   `json:"gop"`
	Height       int64   `json:"height"`
	Level        int64   `json:"level"`
	Maxrate      int64   `json:"maxrate"`
	Minrate      int64   `json:"minrate"`
	Movflags     string  `json:"movflags"`
	PerTitle     bool    `json:"per_title"`
	Pixfmt       string  `json:"pixfmt"`
	Preset       string  `json:"preset"`
	Profilev     string  `json:"profilev"`
	Seek         int64   `json:"seek"`
	VideoBitrate int64   `json:"video_bitrate"`
	Width        int64   `json:"width"`
	X264Keyint   int64   `json:"x264_keyint"`
	X265Keyint   int64   `json:"x265_keyint"`
	// This field is from variant [JobFormatWebmVp9].
	CPUUsed WebmVp9CPUUsed `json:"cpu_used"`
	// This field is from variant [JobFormatWebmVp9].
	Quality        WebmVp9Quality `json:"quality"`
	HlsEnc         bool           `json:"hls_enc"`
	HlsEncIv       string         `json:"hls_enc_iv"`
	HlsEncKey      string         `json:"hls_enc_key"`
	HlsEncKeyURL   string         `json:"hls_enc_key_url"`
	HlsSegmentType string         `json:"hls_segment_type"`
	HlsSingleFile  bool           `json:"hls_single_file"`
	HlsTime        int64          `json:"hls_time"`
	// This field is from variant [JobFormatJpg].
	Interval int64 `json:"interval"`
	// This field is from variant [JobFormatJpg].
	ChunkDuration int64 `json:"chunk_duration"`
	// This field is from variant [JobFormatJpg].
	Frames int64 `json:"frames"`
	// This field is from variant [JobFormatJpg].
	Sprite bool `json:"sprite"`
	JSON   struct {
		ID             respjson.Field
		AudioBitrate   respjson.Field
		Bufsize        respjson.Field
		Channels       respjson.Field
		Crf            respjson.Field
		DisableAudio   respjson.Field
		DisableVideo   respjson.Field
		Duration       respjson.Field
		Framerate      respjson.Field
		Gop            respjson.Field
		Height         respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       respjson.Field
		PerTitle       respjson.Field
		Pixfmt         respjson.Field
		Preset         respjson.Field
		Profilev       respjson.Field
		Seek           respjson.Field
		VideoBitrate   respjson.Field
		Width          respjson.Field
		X264Keyint     respjson.Field
		X265Keyint     respjson.Field
		CPUUsed        respjson.Field
		Quality        respjson.Field
		HlsEnc         respjson.Field
		HlsEncIv       respjson.Field
		HlsEncKey      respjson.Field
		HlsEncKeyURL   respjson.Field
		HlsSegmentType respjson.Field
		HlsSingleFile  respjson.Field
		HlsTime        respjson.Field
		Interval       respjson.Field
		ChunkDuration  respjson.Field
		Frames         respjson.Field
		Sprite         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

JobFormatUnion contains all possible properties and values from JobFormatMP4Av1, JobFormatMP4H264, JobFormatMP4H265, JobFormatWebmVp9, JobFormatHlsAv1, JobFormatHlsH264, JobFormatHlsH265, JobFormatJpg.

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

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

func (JobFormatUnion) AsAny added in v0.6.0

func (u JobFormatUnion) AsAny() anyJobFormat

Use the following switch statement to find the correct variant

switch variant := JobFormatUnion.AsAny().(type) {
case chunkify.JobFormatMP4Av1:
case chunkify.JobFormatMP4H264:
case chunkify.JobFormatMP4H265:
case chunkify.JobFormatWebmVp9:
case chunkify.JobFormatHlsAv1:
case chunkify.JobFormatHlsH264:
case chunkify.JobFormatHlsH265:
case chunkify.JobFormatJpg:
default:
  fmt.Errorf("no variant present")
}

func (JobFormatUnion) AsHlsAv1 added in v0.6.0

func (u JobFormatUnion) AsHlsAv1() (v JobFormatHlsAv1)

func (JobFormatUnion) AsHlsH264 added in v0.6.0

func (u JobFormatUnion) AsHlsH264() (v JobFormatHlsH264)

func (JobFormatUnion) AsHlsH265 added in v0.6.0

func (u JobFormatUnion) AsHlsH265() (v JobFormatHlsH265)

func (JobFormatUnion) AsJpg added in v0.6.0

func (u JobFormatUnion) AsJpg() (v JobFormatJpg)

func (JobFormatUnion) AsMP4Av1 added in v0.6.0

func (u JobFormatUnion) AsMP4Av1() (v JobFormatMP4Av1)

func (JobFormatUnion) AsMP4H264 added in v0.6.0

func (u JobFormatUnion) AsMP4H264() (v JobFormatMP4H264)

func (JobFormatUnion) AsMP4H265 added in v0.6.0

func (u JobFormatUnion) AsMP4H265() (v JobFormatMP4H265)

func (JobFormatUnion) AsWebmVp9 added in v0.6.0

func (u JobFormatUnion) AsWebmVp9() (v JobFormatWebmVp9)

func (JobFormatUnion) RawJSON added in v0.6.0

func (u JobFormatUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatUnion) UnmarshalJSON added in v0.6.0

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

type JobFormatWebmVp9 added in v0.6.0

type JobFormatWebmVp9 struct {
	// The format ID
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	ID string `json:"id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	WebmVp9
}

FFmpeg encoding parameters specific to WebM with VP9 encoding.

func (JobFormatWebmVp9) RawJSON added in v0.6.0

func (r JobFormatWebmVp9) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobFormatWebmVp9) UnmarshalJSON added in v0.6.0

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

type JobGetResponseEnvelope added in v0.6.0

type JobGetResponseEnvelope struct {
	// Data contains the response object
	Data Job `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (JobGetResponseEnvelope) RawJSON added in v0.6.0

func (r JobGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type JobListParams

type JobListParams struct {
	// Filter by job ID
	ID param.Opt[string] `query:"id,omitzero" json:"-"`
	// Filter by hls manifest ID
	HlsManifestID param.Opt[string] `query:"hls_manifest_id,omitzero" json:"-"`
	// Pagination limit
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Pagination offset
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter by source ID
	SourceID param.Opt[string]    `query:"source_id,omitzero" json:"-"`
	Created  JobListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by format id
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
	// "hls_av1", "jpg".
	FormatID JobListParamsFormatID `query:"format_id,omitzero" json:"-"`
	// Filter by metadata
	Metadata [][]string `query:"metadata,omitzero" json:"-"`
	// Filter by job status
	//
	// Any of "completed", "processing", "failed", "cancelled", "queued", "pending".
	Status JobListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (JobListParams) URLQuery added in v0.6.0

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

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

type JobListParamsCreated added in v0.6.0

type JobListParamsCreated struct {
	// Filter by creation date greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
	// Filter by creation date less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
	// Sort by creation date (asc/desc)
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (JobListParamsCreated) URLQuery added in v0.6.0

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

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

type JobListParamsFormatID added in v0.6.0

type JobListParamsFormatID string

Filter by format id

const (
	JobListParamsFormatIDMP4H264 JobListParamsFormatID = "mp4_h264"
	JobListParamsFormatIDMP4H265 JobListParamsFormatID = "mp4_h265"
	JobListParamsFormatIDMP4Av1  JobListParamsFormatID = "mp4_av1"
	JobListParamsFormatIDWebmVp9 JobListParamsFormatID = "webm_vp9"
	JobListParamsFormatIDHlsH264 JobListParamsFormatID = "hls_h264"
	JobListParamsFormatIDHlsH265 JobListParamsFormatID = "hls_h265"
	JobListParamsFormatIDHlsAv1  JobListParamsFormatID = "hls_av1"
	JobListParamsFormatIDJpg     JobListParamsFormatID = "jpg"
)

type JobListParamsStatus added in v0.6.0

type JobListParamsStatus string

Filter by job status

const (
	JobListParamsStatusCompleted  JobListParamsStatus = "completed"
	JobListParamsStatusProcessing JobListParamsStatus = "processing"
	JobListParamsStatusFailed     JobListParamsStatus = "failed"
	JobListParamsStatusCancelled  JobListParamsStatus = "cancelled"
	JobListParamsStatusQueued     JobListParamsStatus = "queued"
	JobListParamsStatusPending    JobListParamsStatus = "pending"
)

type JobLogListParams added in v0.6.0

type JobLogListParams struct {
	// Service type (transcoder or manager)
	//
	// Any of "transcoder", "manager".
	Service JobLogListParamsService `query:"service,omitzero" api:"required" json:"-"`
	// Transcoder ID (required if service is transcoder)
	TranscoderID param.Opt[int64] `query:"transcoder_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (JobLogListParams) URLQuery added in v0.6.0

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

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

type JobLogListParamsService added in v0.6.0

type JobLogListParamsService string

Service type (transcoder or manager)

const (
	JobLogListParamsServiceTranscoder JobLogListParamsService = "transcoder"
	JobLogListParamsServiceManager    JobLogListParamsService = "manager"
)

type JobLogListResponse added in v0.6.0

type JobLogListResponse struct {
	Data []JobLogListResponseData `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing a list of logs for a job

func (JobLogListResponse) RawJSON added in v0.6.0

func (r JobLogListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobLogListResponse) UnmarshalJSON added in v0.6.0

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

type JobLogListResponseData added in v0.6.0

type JobLogListResponseData struct {
	// Additional structured data attached to the log
	Attributes map[string]any `json:"attributes" api:"required"`
	// Log level
	//
	// Any of "info", "error", "debug".
	Level string `json:"level" api:"required"`
	// The log message content
	Msg string `json:"msg" api:"required"`
	// Name of the service that generated the log
	//
	// Any of "transcoder", "manager".
	Service string `json:"service" api:"required"`
	// Timestamp when the log was created
	Time time.Time `json:"time" api:"required" format:"date-time"`
	// Optional ID of the job this log is associated with
	JobID string `json:"job_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Attributes  respjson.Field
		Level       respjson.Field
		Msg         respjson.Field
		Service     respjson.Field
		Time        respjson.Field
		JobID       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (JobLogListResponseData) RawJSON added in v0.6.0

func (r JobLogListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobLogListResponseData) UnmarshalJSON added in v0.6.0

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

type JobLogService added in v0.6.0

type JobLogService struct {
	Options []option.RequestOption
}

JobLogService contains methods and other services that help with interacting with the chunkify 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 NewJobLogService method instead.

func NewJobLogService added in v0.6.0

func NewJobLogService(opts ...option.RequestOption) (r JobLogService)

NewJobLogService 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 (*JobLogService) List deprecated added in v0.6.0

func (r *JobLogService) List(ctx context.Context, jobID string, query JobLogListParams, opts ...option.RequestOption) (res *JobLogListResponse, err error)

Retrieve logs for a specific job, either from the transcoder or manager service. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

type JobNewParams added in v0.6.0

type JobNewParams struct {
	// Required format configuration, one and only one valid format configuration must
	// be provided. If you want to use a format without specifying any configuration,
	// use an empty object in the corresponding field.
	Format JobNewParamsFormatUnion `json:"format,omitzero" api:"required"`
	// The ID of the source file to transcode
	SourceID string `json:"source_id" api:"required"`
	// Optional HLS manifest configuration Use the same hls manifest ID to group
	// multiple jobs into a single HLS manifest By default, it's automatically
	// generated if no set for HLS jobs
	HlsManifestID param.Opt[string] `json:"hls_manifest_id,omitzero"`
	// Optional metadata to attach to the job, the maximum size allowed is 2048 bytes
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional storage configuration
	Storage JobNewParamsStorage `json:"storage,omitzero"`
	// Optional transcoder configuration. If not provided, the system will
	// automatically calculate the optimal quantity and CPU type based on the source
	// file specifications and output requirements. This auto-scaling ensures efficient
	// resource utilization.
	Transcoder JobNewParamsTranscoder `json:"transcoder,omitzero"`
	// contains filtered or unexported fields
}

func (JobNewParams) MarshalJSON added in v0.6.0

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

func (*JobNewParams) UnmarshalJSON added in v0.6.0

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

type JobNewParamsFormatUnion added in v0.6.0

type JobNewParamsFormatUnion struct {
	OfMP4Av1  *MP4Av1Param  `json:",omitzero,inline"`
	OfMP4H264 *MP4H264Param `json:",omitzero,inline"`
	OfMP4H265 *MP4H265Param `json:",omitzero,inline"`
	OfWebmVp9 *WebmVp9Param `json:",omitzero,inline"`
	OfHlsAv1  *HlsAv1Param  `json:",omitzero,inline"`
	OfHlsH264 *HlsH264Param `json:",omitzero,inline"`
	OfHlsH265 *HlsH265Param `json:",omitzero,inline"`
	OfJpg     *JpgParam     `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 (JobNewParamsFormatUnion) GetAudioBitrate added in v0.6.0

func (u JobNewParamsFormatUnion) GetAudioBitrate() *int64

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

func (JobNewParamsFormatUnion) GetBufsize added in v0.6.0

func (u JobNewParamsFormatUnion) GetBufsize() *int64

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

func (JobNewParamsFormatUnion) GetCPUUsed added in v0.6.0

func (u JobNewParamsFormatUnion) GetCPUUsed() *string

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

func (JobNewParamsFormatUnion) GetChannels added in v0.6.0

func (u JobNewParamsFormatUnion) GetChannels() *int64

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

func (JobNewParamsFormatUnion) GetChunkDuration added in v0.6.0

func (u JobNewParamsFormatUnion) GetChunkDuration() *int64

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

func (JobNewParamsFormatUnion) GetCrf added in v0.6.0

func (u JobNewParamsFormatUnion) GetCrf() *int64

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

func (JobNewParamsFormatUnion) GetDisableAudio added in v0.6.0

func (u JobNewParamsFormatUnion) GetDisableAudio() *bool

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

func (JobNewParamsFormatUnion) GetDisableVideo added in v0.6.0

func (u JobNewParamsFormatUnion) GetDisableVideo() *bool

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

func (JobNewParamsFormatUnion) GetDuration added in v0.6.0

func (u JobNewParamsFormatUnion) GetDuration() *int64

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

func (JobNewParamsFormatUnion) GetFramerate added in v0.6.0

func (u JobNewParamsFormatUnion) GetFramerate() *float64

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

func (JobNewParamsFormatUnion) GetFrames added in v0.6.0

func (u JobNewParamsFormatUnion) GetFrames() *int64

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

func (JobNewParamsFormatUnion) GetGop added in v0.6.0

func (u JobNewParamsFormatUnion) GetGop() *int64

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

func (JobNewParamsFormatUnion) GetHeight added in v0.6.0

func (u JobNewParamsFormatUnion) GetHeight() *int64

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

func (JobNewParamsFormatUnion) GetHlsEnc added in v0.6.0

func (u JobNewParamsFormatUnion) GetHlsEnc() *bool

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

func (JobNewParamsFormatUnion) GetHlsEncIv added in v0.6.0

func (u JobNewParamsFormatUnion) GetHlsEncIv() *string

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

func (JobNewParamsFormatUnion) GetHlsEncKey added in v0.6.0

func (u JobNewParamsFormatUnion) GetHlsEncKey() *string

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

func (JobNewParamsFormatUnion) GetHlsEncKeyURL added in v0.6.0

func (u JobNewParamsFormatUnion) GetHlsEncKeyURL() *string

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

func (JobNewParamsFormatUnion) GetHlsSegmentType added in v0.6.0

func (u JobNewParamsFormatUnion) GetHlsSegmentType() *string

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

func (JobNewParamsFormatUnion) GetHlsSingleFile added in v0.17.0

func (u JobNewParamsFormatUnion) GetHlsSingleFile() *bool

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

func (JobNewParamsFormatUnion) GetHlsTime added in v0.6.0

func (u JobNewParamsFormatUnion) GetHlsTime() *int64

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

func (JobNewParamsFormatUnion) GetID added in v0.6.0

func (u JobNewParamsFormatUnion) GetID() *string

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

func (JobNewParamsFormatUnion) GetInterval added in v0.6.0

func (u JobNewParamsFormatUnion) GetInterval() *int64

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

func (JobNewParamsFormatUnion) GetLevel added in v0.6.0

func (u JobNewParamsFormatUnion) GetLevel() *int64

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

func (JobNewParamsFormatUnion) GetMaxrate added in v0.6.0

func (u JobNewParamsFormatUnion) GetMaxrate() *int64

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

func (JobNewParamsFormatUnion) GetMinrate added in v0.6.0

func (u JobNewParamsFormatUnion) GetMinrate() *int64

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

func (JobNewParamsFormatUnion) GetMovflags added in v0.6.0

func (u JobNewParamsFormatUnion) GetMovflags() *string

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

func (JobNewParamsFormatUnion) GetPerTitle added in v0.16.0

func (u JobNewParamsFormatUnion) GetPerTitle() *bool

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

func (JobNewParamsFormatUnion) GetPixfmt added in v0.6.0

func (u JobNewParamsFormatUnion) GetPixfmt() *string

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

func (JobNewParamsFormatUnion) GetPreset added in v0.6.0

func (u JobNewParamsFormatUnion) GetPreset() *string

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

func (JobNewParamsFormatUnion) GetProfilev added in v0.6.0

func (u JobNewParamsFormatUnion) GetProfilev() *string

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

func (JobNewParamsFormatUnion) GetQuality added in v0.6.0

func (u JobNewParamsFormatUnion) GetQuality() *string

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

func (JobNewParamsFormatUnion) GetSeek added in v0.6.0

func (u JobNewParamsFormatUnion) GetSeek() *int64

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

func (JobNewParamsFormatUnion) GetSprite added in v0.6.0

func (u JobNewParamsFormatUnion) GetSprite() *bool

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

func (JobNewParamsFormatUnion) GetVideoBitrate added in v0.6.0

func (u JobNewParamsFormatUnion) GetVideoBitrate() *int64

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

func (JobNewParamsFormatUnion) GetWidth added in v0.6.0

func (u JobNewParamsFormatUnion) GetWidth() *int64

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

func (JobNewParamsFormatUnion) GetX264Keyint added in v0.6.0

func (u JobNewParamsFormatUnion) GetX264Keyint() *int64

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

func (JobNewParamsFormatUnion) GetX265Keyint added in v0.6.0

func (u JobNewParamsFormatUnion) GetX265Keyint() *int64

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

func (JobNewParamsFormatUnion) MarshalJSON added in v0.6.0

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

func (*JobNewParamsFormatUnion) UnmarshalJSON added in v0.6.0

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

type JobNewParamsStorage added in v0.6.0

type JobNewParamsStorage struct {
	// Storage Id specifies the storage configuration to use from pre-configured
	// storage options. Must be 4-64 characters long and contain only alphanumeric
	// characters, underscores and hyphens. Optional if Storage Path is provided.
	ID param.Opt[string] `json:"id,omitzero"`
	// Storage Path specifies an object path relative to the selected storage
	// connection's base_prefix. Do not include the base_prefix. Leading slashes are
	// accepted for compatibility and removed before the path is stored. The
	// base_prefix and normalized path may contain at most 1024 bytes combined.
	// Optional if Storage Id is provided.
	Path param.Opt[string] `json:"path,omitzero"`
	// contains filtered or unexported fields
}

Optional storage configuration

func (JobNewParamsStorage) MarshalJSON added in v0.6.0

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

func (*JobNewParamsStorage) UnmarshalJSON added in v0.6.0

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

type JobNewParamsTranscoder added in v0.6.0

type JobNewParamsTranscoder struct {
	// Quantity specifies the number of transcoder instances. Required if Type is set.
	Quantity param.Opt[int64] `json:"quantity,omitzero"`
	// Type specifies the CPU configuration for each transcoder instance. Required if
	// Quantity is set.
	//
	// Any of "4vCPU", "8vCPU", "16vCPU".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Optional transcoder configuration. If not provided, the system will automatically calculate the optimal quantity and CPU type based on the source file specifications and output requirements. This auto-scaling ensures efficient resource utilization.

func (JobNewParamsTranscoder) MarshalJSON added in v0.6.0

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

func (*JobNewParamsTranscoder) UnmarshalJSON added in v0.6.0

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

type JobNewResponseEnvelope added in v0.6.0

type JobNewResponseEnvelope struct {
	// Data contains the response object
	Data Job `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (JobNewResponseEnvelope) RawJSON added in v0.6.0

func (r JobNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type JobService added in v0.6.0

type JobService struct {
	Options     []option.RequestOption
	Files       JobFileService
	Logs        JobLogService
	Transcoders JobTranscoderService
}

JobService contains methods and other services that help with interacting with the chunkify 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 NewJobService method instead.

func NewJobService added in v0.6.0

func NewJobService(opts ...option.RequestOption) (r JobService)

NewJobService 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 (*JobService) Cancel deprecated added in v0.6.0

func (r *JobService) Cancel(ctx context.Context, jobID string, opts ...option.RequestOption) (err error)

Cancel a job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

func (*JobService) Delete deprecated added in v0.6.0

func (r *JobService) Delete(ctx context.Context, jobID string, opts ...option.RequestOption) (err error)

Delete a job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

func (*JobService) Get deprecated added in v0.6.0

func (r *JobService) Get(ctx context.Context, jobID string, opts ...option.RequestOption) (res *Job, err error)

Retrieve details of a specific job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

func (*JobService) List deprecated added in v0.6.0

func (r *JobService) List(ctx context.Context, query JobListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Job], err error)

Retrieve a list of jobs with optional filtering and pagination. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

func (*JobService) ListAutoPaging deprecated added in v0.6.0

Retrieve a list of jobs with optional filtering and pagination. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

func (*JobService) New deprecated added in v0.6.0

func (r *JobService) New(ctx context.Context, body JobNewParams, opts ...option.RequestOption) (res *Job, err error)

Create a new video processing job with specified parameters. The job is created with pending status and waits for scheduler admission before processing. Pending jobs are admitted oldest first across all projects in the team as vCPU capacity becomes available. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

type JobStatus added in v0.6.0

type JobStatus string

Current status of the job.

const (
	JobStatusPending     JobStatus = "pending"
	JobStatusQueued      JobStatus = "queued"
	JobStatusIngesting   JobStatus = "ingesting"
	JobStatusTranscoding JobStatus = "transcoding"
	JobStatusDownloading JobStatus = "downloading"
	JobStatusMerging     JobStatus = "merging"
	JobStatusUploading   JobStatus = "uploading"
	JobStatusFailed      JobStatus = "failed"
	JobStatusCompleted   JobStatus = "completed"
	JobStatusCancelled   JobStatus = "cancelled"
	JobStatusMerged      JobStatus = "merged"
	JobStatusDownloaded  JobStatus = "downloaded"
	JobStatusTranscoded  JobStatus = "transcoded"
	JobStatusWaiting     JobStatus = "waiting"
)

type JobStorage

type JobStorage struct {
	// ID of the storage
	ID string `json:"id" api:"required"`
	// Path where the output will be stored
	Path string `json:"path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Storage settings for where the job output will be saved

func (JobStorage) RawJSON added in v0.6.0

func (r JobStorage) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobStorage) UnmarshalJSON added in v0.6.0

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

type JobTranscoder added in v0.6.0

type JobTranscoder struct {
	// Whether the transcoder configuration is automatically set by Chunkify
	Auto bool `json:"auto" api:"required"`
	// Number of instances allocated
	Quantity int64 `json:"quantity" api:"required"`
	// Type of transcoder instance
	//
	// Any of "4vCPU", "8vCPU", "16vCPU".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Auto        respjson.Field
		Quantity    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The transcoder configuration for a job

func (JobTranscoder) RawJSON added in v0.6.0

func (r JobTranscoder) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobTranscoder) UnmarshalJSON added in v0.6.0

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

type JobTranscoderListResponse added in v0.6.0

type JobTranscoderListResponse struct {
	Data []JobTranscoderListResponseData `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing a list of transcoders for a job

func (JobTranscoderListResponse) RawJSON added in v0.6.0

func (r JobTranscoderListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*JobTranscoderListResponse) UnmarshalJSON added in v0.6.0

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

type JobTranscoderListResponseData added in v0.6.0

type JobTranscoderListResponseData struct {
	// Unique identifier of the transcoder
	ID string `json:"id" api:"required"`
	// Billable time in seconds
	BillableTime int64 `json:"billable_time" api:"required"`
	// End time of the current chunk in seconds
	ChunkEndTime float64 `json:"chunk_end_time" api:"required"`
	// Number of the chunk being processed
	ChunkNumber int64 `json:"chunk_number" api:"required"`
	// Start time of the current chunk in seconds
	ChunkStartTime float64 `json:"chunk_start_time" api:"required"`
	// CPU time used for transcoding in seconds
	CPUTime float64 `json:"cpu_time" api:"required"`
	// Timestamp when the status was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Current frames per second being processed
	Fps float64 `json:"fps" api:"required"`
	// Current frame number being processed
	Frame int64 `json:"frame" api:"required"`
	// Unique identifier of the job
	JobID string `json:"job_id" api:"required"`
	// Current output time in seconds
	OutTime int64 `json:"out_time" api:"required"`
	// Progress percentage of the transcoding operation (0-100)
	Progress float64 `json:"progress" api:"required"`
	// Current processing speed multiplier
	Speed float64 `json:"speed" api:"required"`
	// Current status of the transcoder (starting, transcoding, finished, failed)
	//
	// Any of "starting", "pending", "transcoding", "completed", "failed", "cancelled".
	Status string `json:"status" api:"required"`
	// Unique identifier of the transcoder instance (generated by the transcoder)
	TranscoderInstanceID string `json:"transcoder_instance_id" api:"required"`
	// Timestamp when the status was last updated
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Error message if the transcoding failed
	Error shared.ChunkifyError `json:"error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                   respjson.Field
		BillableTime         respjson.Field
		ChunkEndTime         respjson.Field
		ChunkNumber          respjson.Field
		ChunkStartTime       respjson.Field
		CPUTime              respjson.Field
		CreatedAt            respjson.Field
		Fps                  respjson.Field
		Frame                respjson.Field
		JobID                respjson.Field
		OutTime              respjson.Field
		Progress             respjson.Field
		Speed                respjson.Field
		Status               respjson.Field
		TranscoderInstanceID respjson.Field
		UpdatedAt            respjson.Field
		Error                respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (JobTranscoderListResponseData) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*JobTranscoderListResponseData) UnmarshalJSON added in v0.6.0

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

type JobTranscoderService added in v0.6.0

type JobTranscoderService struct {
	Options []option.RequestOption
}

JobTranscoderService contains methods and other services that help with interacting with the chunkify 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 NewJobTranscoderService method instead.

func NewJobTranscoderService added in v0.6.0

func NewJobTranscoderService(opts ...option.RequestOption) (r JobTranscoderService)

NewJobTranscoderService 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 (*JobTranscoderService) List deprecated added in v0.6.0

Retrieve all the transcoders statuses for a specific job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.

Deprecated: deprecated

type Jpg added in v0.6.0

type Jpg struct {
	ID constant.Jpg `json:"id" default:"jpg"`
	// Time interval in seconds at which frames are extracted from the video (e.g.,
	// interval=10 extracts frames at 0s, 10s, 20s, etc.). Must be between 1 and 3600
	// seconds.
	Interval      int64 `json:"interval" api:"required"`
	ChunkDuration int64 `json:"chunk_duration"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	Frames   int64 `json:"frames"`
	Height   int64 `json:"height"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek   int64 `json:"seek"`
	Sprite bool  `json:"sprite"`
	Width  int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Interval      respjson.Field
		ChunkDuration respjson.Field
		Duration      respjson.Field
		Frames        respjson.Field
		Height        respjson.Field
		Seek          respjson.Field
		Sprite        respjson.Field
		Width         respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FFmpeg encoding parameters specific to JPEG image extraction.

func (Jpg) RawJSON added in v0.6.0

func (r Jpg) RawJSON() string

Returns the unmodified JSON received from the API

func (Jpg) ToParam added in v0.6.0

func (r Jpg) ToParam() JpgParam

ToParam converts this Jpg to a JpgParam.

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 JpgParam.Overrides()

func (*Jpg) UnmarshalJSON added in v0.6.0

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

type JpgParam added in v0.6.0

type JpgParam struct {
	// Time interval in seconds at which frames are extracted from the video (e.g.,
	// interval=10 extracts frames at 0s, 10s, 20s, etc.). Must be between 1 and 3600
	// seconds.
	Interval      int64            `json:"interval" api:"required"`
	ChunkDuration param.Opt[int64] `json:"chunk_duration,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	Frames   param.Opt[int64] `json:"frames,omitzero"`
	Height   param.Opt[int64] `json:"height,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek   param.Opt[int64] `json:"seek,omitzero"`
	Sprite param.Opt[bool]  `json:"sprite,omitzero"`
	Width  param.Opt[int64] `json:"width,omitzero"`
	// This field can be elided, and will marshal its zero value as "jpg".
	ID constant.Jpg `json:"id" default:"jpg"`
	// contains filtered or unexported fields
}

FFmpeg encoding parameters specific to JPEG image extraction.

The properties ID, Interval are required.

func (JpgParam) MarshalJSON added in v0.6.0

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

func (*JpgParam) UnmarshalJSON added in v0.6.0

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

type MP4Av1 added in v0.6.0

type MP4Av1 struct {
	ID constant.MP4Av1 `json:"id" default:"mp4_av1"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 63. Recommended
	// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
	// Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  int64  `json:"minrate"`
	Movflags string `json:"movflags"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt MP4Av1Pixfmt `json:"pixfmt"`
	// Preset controls the encoding efficiency and processing intensity. Lower presets
	// use more optimization features, creating smaller files with better quality but
	// requiring more compute time. Higher presets encode faster but produce larger
	// files.
	//
	// Preset ranges:
	//
	// - 6-7: Fast encoding for real-time applications (smaller files)
	// - 8-10: Balanced efficiency and speed for general use
	// - 11-13: Fastest encoding for real-time applications (larger files)
	//
	// Any of "6", "7", "8", "9", "10", "11", "12", "13".
	Preset MP4Av1Preset `json:"preset"`
	// Profilev specifies the AV1 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev MP4Av1Profilev `json:"profilev"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AudioBitrate respjson.Field
		Bufsize      respjson.Field
		Channels     respjson.Field
		Crf          respjson.Field
		DisableAudio respjson.Field
		DisableVideo respjson.Field
		Duration     respjson.Field
		Framerate    respjson.Field
		Gop          respjson.Field
		Height       respjson.Field
		Level        respjson.Field
		Maxrate      respjson.Field
		Minrate      respjson.Field
		Movflags     respjson.Field
		PerTitle     respjson.Field
		Pixfmt       respjson.Field
		Preset       respjson.Field
		Profilev     respjson.Field
		Seek         respjson.Field
		VideoBitrate respjson.Field
		Width        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MP4Av1) RawJSON added in v0.6.0

func (r MP4Av1) RawJSON() string

Returns the unmodified JSON received from the API

func (MP4Av1) ToParam added in v0.6.0

func (r MP4Av1) ToParam() MP4Av1Param

ToParam converts this MP4Av1 to a MP4Av1Param.

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 MP4Av1Param.Overrides()

func (*MP4Av1) UnmarshalJSON added in v0.6.0

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

type MP4Av1Param added in v0.6.0

type MP4Av1Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 63. Recommended
	// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  param.Opt[int64]  `json:"minrate,omitzero"`
	Movflags param.Opt[string] `json:"movflags,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
	// Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt MP4Av1Pixfmt `json:"pixfmt,omitzero"`
	// Preset controls the encoding efficiency and processing intensity. Lower presets
	// use more optimization features, creating smaller files with better quality but
	// requiring more compute time. Higher presets encode faster but produce larger
	// files.
	//
	// Preset ranges:
	//
	// - 6-7: Fast encoding for real-time applications (smaller files)
	// - 8-10: Balanced efficiency and speed for general use
	// - 11-13: Fastest encoding for real-time applications (larger files)
	//
	// Any of "6", "7", "8", "9", "10", "11", "12", "13".
	Preset MP4Av1Preset `json:"preset,omitzero"`
	// Profilev specifies the AV1 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev MP4Av1Profilev `json:"profilev,omitzero"`
	// This field can be elided, and will marshal its zero value as "mp4_av1".
	ID constant.MP4Av1 `json:"id" default:"mp4_av1"`
	// contains filtered or unexported fields
}

The property ID is required.

func (MP4Av1Param) MarshalJSON added in v0.6.0

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

func (*MP4Av1Param) UnmarshalJSON added in v0.6.0

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

type MP4Av1Pixfmt added in v0.6.0

type MP4Av1Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	MP4Av1PixfmtYuv410p     MP4Av1Pixfmt = "yuv410p"
	MP4Av1PixfmtYuv411p     MP4Av1Pixfmt = "yuv411p"
	MP4Av1PixfmtYuv420p     MP4Av1Pixfmt = "yuv420p"
	MP4Av1PixfmtYuv422p     MP4Av1Pixfmt = "yuv422p"
	MP4Av1PixfmtYuv440p     MP4Av1Pixfmt = "yuv440p"
	MP4Av1PixfmtYuv444p     MP4Av1Pixfmt = "yuv444p"
	MP4Av1PixfmtYuvJ411p    MP4Av1Pixfmt = "yuvJ411p"
	MP4Av1PixfmtYuvJ420p    MP4Av1Pixfmt = "yuvJ420p"
	MP4Av1PixfmtYuvJ422p    MP4Av1Pixfmt = "yuvJ422p"
	MP4Av1PixfmtYuvJ440p    MP4Av1Pixfmt = "yuvJ440p"
	MP4Av1PixfmtYuvJ444p    MP4Av1Pixfmt = "yuvJ444p"
	MP4Av1PixfmtYuv420p10le MP4Av1Pixfmt = "yuv420p10le"
	MP4Av1PixfmtYuv422p10le MP4Av1Pixfmt = "yuv422p10le"
	MP4Av1PixfmtYuv440p10le MP4Av1Pixfmt = "yuv440p10le"
	MP4Av1PixfmtYuv444p10le MP4Av1Pixfmt = "yuv444p10le"
	MP4Av1PixfmtYuv420p12le MP4Av1Pixfmt = "yuv420p12le"
	MP4Av1PixfmtYuv422p12le MP4Av1Pixfmt = "yuv422p12le"
	MP4Av1PixfmtYuv440p12le MP4Av1Pixfmt = "yuv440p12le"
	MP4Av1PixfmtYuv444p12le MP4Av1Pixfmt = "yuv444p12le"
	MP4Av1PixfmtYuv420p10be MP4Av1Pixfmt = "yuv420p10be"
	MP4Av1PixfmtYuv422p10be MP4Av1Pixfmt = "yuv422p10be"
	MP4Av1PixfmtYuv440p10be MP4Av1Pixfmt = "yuv440p10be"
	MP4Av1PixfmtYuv444p10be MP4Av1Pixfmt = "yuv444p10be"
	MP4Av1PixfmtYuv420p12be MP4Av1Pixfmt = "yuv420p12be"
	MP4Av1PixfmtYuv422p12be MP4Av1Pixfmt = "yuv422p12be"
	MP4Av1PixfmtYuv440p12be MP4Av1Pixfmt = "yuv440p12be"
	MP4Av1PixfmtYuv444p12be MP4Av1Pixfmt = "yuv444p12be"
)

type MP4Av1Preset added in v0.6.0

type MP4Av1Preset string

Preset controls the encoding efficiency and processing intensity. Lower presets use more optimization features, creating smaller files with better quality but requiring more compute time. Higher presets encode faster but produce larger files.

Preset ranges:

- 6-7: Fast encoding for real-time applications (smaller files) - 8-10: Balanced efficiency and speed for general use - 11-13: Fastest encoding for real-time applications (larger files)

const (
	MP4Av1Preset6  MP4Av1Preset = "6"
	MP4Av1Preset7  MP4Av1Preset = "7"
	MP4Av1Preset8  MP4Av1Preset = "8"
	MP4Av1Preset9  MP4Av1Preset = "9"
	MP4Av1Preset10 MP4Av1Preset = "10"
	MP4Av1Preset11 MP4Av1Preset = "11"
	MP4Av1Preset12 MP4Av1Preset = "12"
	MP4Av1Preset13 MP4Av1Preset = "13"
)

type MP4Av1Profilev added in v0.6.0

type MP4Av1Profilev string

Profilev specifies the AV1 profile. Valid values:

- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images

const (
	MP4Av1ProfilevMain             MP4Av1Profilev = "main"
	MP4Av1ProfilevMain10           MP4Av1Profilev = "main10"
	MP4Av1ProfilevMainstillpicture MP4Av1Profilev = "mainstillpicture"
)

type MP4H264 added in v0.6.0

type MP4H264 struct {
	ID constant.MP4H264 `json:"id" default:"mp4_h264"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
	// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
	// resolutions and bitrates but require more processing power.
	//
	// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
	Level int64 `json:"level"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  int64  `json:"minrate"`
	Movflags string `json:"movflags"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt MP4H264Pixfmt `json:"pixfmt"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset MP4H264Preset `json:"preset"`
	// Profilev specifies the H.264 profile. Valid values:
	//
	// - baseline: Basic profile, good for mobile devices
	// - main: Main profile, good for most applications
	// - high: High profile, best quality but requires more processing
	// - high10: High 10-bit profile, supports 10-bit color
	// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
	// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
	//
	// Any of "baseline", "main", "high", "high10", "high422", "high444".
	Profilev MP4H264Profilev `json:"profilev"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// X264KeyInt specifies the maximum number of frames between keyframes for H.264
	// encoding. Range: 1 to 960. Higher values can improve compression but may affect
	// seeking.
	X264Keyint int64 `json:"x264_keyint"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AudioBitrate respjson.Field
		Bufsize      respjson.Field
		Channels     respjson.Field
		Crf          respjson.Field
		DisableAudio respjson.Field
		DisableVideo respjson.Field
		Duration     respjson.Field
		Framerate    respjson.Field
		Gop          respjson.Field
		Height       respjson.Field
		Level        respjson.Field
		Maxrate      respjson.Field
		Minrate      respjson.Field
		Movflags     respjson.Field
		PerTitle     respjson.Field
		Pixfmt       respjson.Field
		Preset       respjson.Field
		Profilev     respjson.Field
		Seek         respjson.Field
		VideoBitrate respjson.Field
		Width        respjson.Field
		X264Keyint   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MP4H264) RawJSON added in v0.6.0

func (r MP4H264) RawJSON() string

Returns the unmodified JSON received from the API

func (MP4H264) ToParam added in v0.6.0

func (r MP4H264) ToParam() MP4H264Param

ToParam converts this MP4H264 to a MP4H264Param.

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 MP4H264Param.Overrides()

func (*MP4H264) UnmarshalJSON added in v0.6.0

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

type MP4H264Param added in v0.6.0

type MP4H264Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  param.Opt[int64]  `json:"minrate,omitzero"`
	Movflags param.Opt[string] `json:"movflags,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// X264KeyInt specifies the maximum number of frames between keyframes for H.264
	// encoding. Range: 1 to 960. Higher values can improve compression but may affect
	// seeking.
	X264Keyint param.Opt[int64] `json:"x264_keyint,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
	// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
	// resolutions and bitrates but require more processing power.
	//
	// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
	Level int64 `json:"level,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt MP4H264Pixfmt `json:"pixfmt,omitzero"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset MP4H264Preset `json:"preset,omitzero"`
	// Profilev specifies the H.264 profile. Valid values:
	//
	// - baseline: Basic profile, good for mobile devices
	// - main: Main profile, good for most applications
	// - high: High profile, best quality but requires more processing
	// - high10: High 10-bit profile, supports 10-bit color
	// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
	// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
	//
	// Any of "baseline", "main", "high", "high10", "high422", "high444".
	Profilev MP4H264Profilev `json:"profilev,omitzero"`
	// This field can be elided, and will marshal its zero value as "mp4_h264".
	ID constant.MP4H264 `json:"id" default:"mp4_h264"`
	// contains filtered or unexported fields
}

The property ID is required.

func (MP4H264Param) MarshalJSON added in v0.6.0

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

func (*MP4H264Param) UnmarshalJSON added in v0.6.0

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

type MP4H264Pixfmt added in v0.6.0

type MP4H264Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	MP4H264PixfmtYuv410p     MP4H264Pixfmt = "yuv410p"
	MP4H264PixfmtYuv411p     MP4H264Pixfmt = "yuv411p"
	MP4H264PixfmtYuv420p     MP4H264Pixfmt = "yuv420p"
	MP4H264PixfmtYuv422p     MP4H264Pixfmt = "yuv422p"
	MP4H264PixfmtYuv440p     MP4H264Pixfmt = "yuv440p"
	MP4H264PixfmtYuv444p     MP4H264Pixfmt = "yuv444p"
	MP4H264PixfmtYuvJ411p    MP4H264Pixfmt = "yuvJ411p"
	MP4H264PixfmtYuvJ420p    MP4H264Pixfmt = "yuvJ420p"
	MP4H264PixfmtYuvJ422p    MP4H264Pixfmt = "yuvJ422p"
	MP4H264PixfmtYuvJ440p    MP4H264Pixfmt = "yuvJ440p"
	MP4H264PixfmtYuvJ444p    MP4H264Pixfmt = "yuvJ444p"
	MP4H264PixfmtYuv420p10le MP4H264Pixfmt = "yuv420p10le"
	MP4H264PixfmtYuv422p10le MP4H264Pixfmt = "yuv422p10le"
	MP4H264PixfmtYuv440p10le MP4H264Pixfmt = "yuv440p10le"
	MP4H264PixfmtYuv444p10le MP4H264Pixfmt = "yuv444p10le"
	MP4H264PixfmtYuv420p12le MP4H264Pixfmt = "yuv420p12le"
	MP4H264PixfmtYuv422p12le MP4H264Pixfmt = "yuv422p12le"
	MP4H264PixfmtYuv440p12le MP4H264Pixfmt = "yuv440p12le"
	MP4H264PixfmtYuv444p12le MP4H264Pixfmt = "yuv444p12le"
	MP4H264PixfmtYuv420p10be MP4H264Pixfmt = "yuv420p10be"
	MP4H264PixfmtYuv422p10be MP4H264Pixfmt = "yuv422p10be"
	MP4H264PixfmtYuv440p10be MP4H264Pixfmt = "yuv440p10be"
	MP4H264PixfmtYuv444p10be MP4H264Pixfmt = "yuv444p10be"
	MP4H264PixfmtYuv420p12be MP4H264Pixfmt = "yuv420p12be"
	MP4H264PixfmtYuv422p12be MP4H264Pixfmt = "yuv422p12be"
	MP4H264PixfmtYuv440p12be MP4H264Pixfmt = "yuv440p12be"
	MP4H264PixfmtYuv444p12be MP4H264Pixfmt = "yuv444p12be"
)

type MP4H264Preset added in v0.6.0

type MP4H264Preset string

Preset specifies the encoding speed preset. Valid values (from fastest to slowest):

- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality

const (
	MP4H264PresetUltrafast MP4H264Preset = "ultrafast"
	MP4H264PresetSuperfast MP4H264Preset = "superfast"
	MP4H264PresetVeryfast  MP4H264Preset = "veryfast"
	MP4H264PresetFaster    MP4H264Preset = "faster"
	MP4H264PresetFast      MP4H264Preset = "fast"
	MP4H264PresetMedium    MP4H264Preset = "medium"
)

type MP4H264Profilev added in v0.6.0

type MP4H264Profilev string

Profilev specifies the H.264 profile. Valid values:

- baseline: Basic profile, good for mobile devices - main: Main profile, good for most applications - high: High profile, best quality but requires more processing - high10: High 10-bit profile, supports 10-bit color - high422: High 4:2:2 profile, supports 4:2:2 color sampling - high444: High 4:4:4 profile, supports 4:4:4 color sampling

const (
	MP4H264ProfilevBaseline MP4H264Profilev = "baseline"
	MP4H264ProfilevMain     MP4H264Profilev = "main"
	MP4H264ProfilevHigh     MP4H264Profilev = "high"
	MP4H264ProfilevHigh10   MP4H264Profilev = "high10"
	MP4H264ProfilevHigh422  MP4H264Profilev = "high422"
	MP4H264ProfilevHigh444  MP4H264Profilev = "high444"
)

type MP4H265 added in v0.6.0

type MP4H265 struct {
	ID constant.MP4H265 `json:"id" default:"mp4_h265"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
	// (main10). Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  int64  `json:"minrate"`
	Movflags string `json:"movflags"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt MP4H265Pixfmt `json:"pixfmt"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset MP4H265Preset `json:"preset"`
	// Profilev specifies the H.265 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev MP4H265Profilev `json:"profilev"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// X265KeyInt specifies the maximum number of frames between keyframes for H.265
	// encoding. Range: 1 to 300. Higher values can improve compression but may affect
	// seeking.
	X265Keyint int64 `json:"x265_keyint"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AudioBitrate respjson.Field
		Bufsize      respjson.Field
		Channels     respjson.Field
		Crf          respjson.Field
		DisableAudio respjson.Field
		DisableVideo respjson.Field
		Duration     respjson.Field
		Framerate    respjson.Field
		Gop          respjson.Field
		Height       respjson.Field
		Level        respjson.Field
		Maxrate      respjson.Field
		Minrate      respjson.Field
		Movflags     respjson.Field
		PerTitle     respjson.Field
		Pixfmt       respjson.Field
		Preset       respjson.Field
		Profilev     respjson.Field
		Seek         respjson.Field
		VideoBitrate respjson.Field
		Width        respjson.Field
		X265Keyint   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MP4H265) RawJSON added in v0.6.0

func (r MP4H265) RawJSON() string

Returns the unmodified JSON received from the API

func (MP4H265) ToParam added in v0.6.0

func (r MP4H265) ToParam() MP4H265Param

ToParam converts this MP4H265 to a MP4H265Param.

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 MP4H265Param.Overrides()

func (*MP4H265) UnmarshalJSON added in v0.6.0

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

type MP4H265Param added in v0.6.0

type MP4H265Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate  param.Opt[int64]  `json:"minrate,omitzero"`
	Movflags param.Opt[string] `json:"movflags,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// X265KeyInt specifies the maximum number of frames between keyframes for H.265
	// encoding. Range: 1 to 300. Higher values can improve compression but may affect
	// seeking.
	X265Keyint param.Opt[int64] `json:"x265_keyint,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
	// (main10). Higher levels support higher resolutions and bitrates but require more
	// processing power.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt MP4H265Pixfmt `json:"pixfmt,omitzero"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset MP4H265Preset `json:"preset,omitzero"`
	// Profilev specifies the H.265 profile. Valid values:
	//
	// - main: Main profile, good for most applications
	// - main10: Main 10-bit profile, supports 10-bit color
	// - mainstillpicture: Still picture profile, optimized for single images
	//
	// Any of "main", "main10", "mainstillpicture".
	Profilev MP4H265Profilev `json:"profilev,omitzero"`
	// This field can be elided, and will marshal its zero value as "mp4_h265".
	ID constant.MP4H265 `json:"id" default:"mp4_h265"`
	// contains filtered or unexported fields
}

The property ID is required.

func (MP4H265Param) MarshalJSON added in v0.6.0

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

func (*MP4H265Param) UnmarshalJSON added in v0.6.0

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

type MP4H265Pixfmt added in v0.6.0

type MP4H265Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	MP4H265PixfmtYuv410p     MP4H265Pixfmt = "yuv410p"
	MP4H265PixfmtYuv411p     MP4H265Pixfmt = "yuv411p"
	MP4H265PixfmtYuv420p     MP4H265Pixfmt = "yuv420p"
	MP4H265PixfmtYuv422p     MP4H265Pixfmt = "yuv422p"
	MP4H265PixfmtYuv440p     MP4H265Pixfmt = "yuv440p"
	MP4H265PixfmtYuv444p     MP4H265Pixfmt = "yuv444p"
	MP4H265PixfmtYuvJ411p    MP4H265Pixfmt = "yuvJ411p"
	MP4H265PixfmtYuvJ420p    MP4H265Pixfmt = "yuvJ420p"
	MP4H265PixfmtYuvJ422p    MP4H265Pixfmt = "yuvJ422p"
	MP4H265PixfmtYuvJ440p    MP4H265Pixfmt = "yuvJ440p"
	MP4H265PixfmtYuvJ444p    MP4H265Pixfmt = "yuvJ444p"
	MP4H265PixfmtYuv420p10le MP4H265Pixfmt = "yuv420p10le"
	MP4H265PixfmtYuv422p10le MP4H265Pixfmt = "yuv422p10le"
	MP4H265PixfmtYuv440p10le MP4H265Pixfmt = "yuv440p10le"
	MP4H265PixfmtYuv444p10le MP4H265Pixfmt = "yuv444p10le"
	MP4H265PixfmtYuv420p12le MP4H265Pixfmt = "yuv420p12le"
	MP4H265PixfmtYuv422p12le MP4H265Pixfmt = "yuv422p12le"
	MP4H265PixfmtYuv440p12le MP4H265Pixfmt = "yuv440p12le"
	MP4H265PixfmtYuv444p12le MP4H265Pixfmt = "yuv444p12le"
	MP4H265PixfmtYuv420p10be MP4H265Pixfmt = "yuv420p10be"
	MP4H265PixfmtYuv422p10be MP4H265Pixfmt = "yuv422p10be"
	MP4H265PixfmtYuv440p10be MP4H265Pixfmt = "yuv440p10be"
	MP4H265PixfmtYuv444p10be MP4H265Pixfmt = "yuv444p10be"
	MP4H265PixfmtYuv420p12be MP4H265Pixfmt = "yuv420p12be"
	MP4H265PixfmtYuv422p12be MP4H265Pixfmt = "yuv422p12be"
	MP4H265PixfmtYuv440p12be MP4H265Pixfmt = "yuv440p12be"
	MP4H265PixfmtYuv444p12be MP4H265Pixfmt = "yuv444p12be"
)

type MP4H265Preset added in v0.6.0

type MP4H265Preset string

Preset specifies the encoding speed preset. Valid values (from fastest to slowest):

- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality

const (
	MP4H265PresetUltrafast MP4H265Preset = "ultrafast"
	MP4H265PresetSuperfast MP4H265Preset = "superfast"
	MP4H265PresetVeryfast  MP4H265Preset = "veryfast"
	MP4H265PresetFaster    MP4H265Preset = "faster"
	MP4H265PresetFast      MP4H265Preset = "fast"
	MP4H265PresetMedium    MP4H265Preset = "medium"
)

type MP4H265Profilev added in v0.6.0

type MP4H265Profilev string

Profilev specifies the H.265 profile. Valid values:

- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images

const (
	MP4H265ProfilevMain             MP4H265Profilev = "main"
	MP4H265ProfilevMain10           MP4H265Profilev = "main10"
	MP4H265ProfilevMainstillpicture MP4H265Profilev = "mainstillpicture"
)

type MetricAssetsParams added in v0.17.0

type MetricAssetsParams struct {
	// Inclusive UTC start date, YYYY-MM-DD. Supply both dates for a custom range of at
	// most 366 days. Omit both for the past 7 UTC calendar days including today.
	From param.Opt[string] `query:"from,omitzero" json:"-"`
	// Exclusive UTC end date, YYYY-MM-DD. Must be after from and at most 366 days
	// later.
	To param.Opt[string] `query:"to,omitzero" json:"-"`
	// Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept
	// when supplied; errors remain JSON.
	//
	// Any of "json", "csv".
	Format MetricAssetsParamsFormat `query:"format,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MetricAssetsParams) URLQuery added in v0.17.0

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

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

type MetricAssetsParamsFormat added in v0.17.0

type MetricAssetsParamsFormat string

Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept when supplied; errors remain JSON.

const (
	MetricAssetsParamsFormatJson MetricAssetsParamsFormat = "json"
	MetricAssetsParamsFormatCsv  MetricAssetsParamsFormat = "csv"
)

type MetricAssetsResponseEnvelope added in v0.17.0

type MetricAssetsResponseEnvelope struct {
	// Data contains the requested report.
	Data MetricsAssets `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Successful metrics response.

func (MetricAssetsResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricAssetsResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type MetricService added in v0.17.0

type MetricService struct {
	Options []option.RequestOption
}

MetricService contains methods and other services that help with interacting with the chunkify API.

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

func NewMetricService added in v0.17.0

func NewMetricService(opts ...option.RequestOption) (r MetricService)

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

func (*MetricService) Assets added in v0.17.0

func (r *MetricService) Assets(ctx context.Context, query MetricAssetsParams, opts ...option.RequestOption) (res *MetricsAssets, err error)

Retrieve Asset outcomes, timings, output sizes and source profiles by UTC creation date.

func (*MetricService) Storage added in v0.17.0

func (r *MetricService) Storage(ctx context.Context, query MetricStorageParams, opts ...option.RequestOption) (res *MetricsStorage, err error)

Retrieve recorded additions and successful removals by storage and UTC date. Historical coverage depends on event retention.

func (*MetricService) Usage added in v0.17.0

func (r *MetricService) Usage(ctx context.Context, query MetricUsageParams, opts ...option.RequestOption) (res *MetricsUsage, err error)

Retrieve project usage totals and daily values for a UTC date range.

type MetricStorageParams added in v0.17.0

type MetricStorageParams struct {
	// Inclusive UTC start date, YYYY-MM-DD. Supply both dates for a custom range of at
	// most 366 days. Omit both for the past 7 UTC calendar days including today.
	From param.Opt[string] `query:"from,omitzero" json:"-"`
	// Filter to one persistent storage configuration in the authenticated project.
	StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
	// Exclusive UTC end date, YYYY-MM-DD. Must be after from and at most 366 days
	// later.
	To param.Opt[string] `query:"to,omitzero" json:"-"`
	// Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept
	// when supplied; errors remain JSON.
	//
	// Any of "json", "csv".
	Format MetricStorageParamsFormat `query:"format,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MetricStorageParams) URLQuery added in v0.17.0

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

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

type MetricStorageParamsFormat added in v0.17.0

type MetricStorageParamsFormat string

Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept when supplied; errors remain JSON.

const (
	MetricStorageParamsFormatJson MetricStorageParamsFormat = "json"
	MetricStorageParamsFormatCsv  MetricStorageParamsFormat = "csv"
)

type MetricStorageResponseEnvelope added in v0.17.0

type MetricStorageResponseEnvelope struct {
	// Data contains the requested report.
	Data MetricsStorage `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Successful metrics response.

func (MetricStorageResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricStorageResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type MetricUsageParams added in v0.17.0

type MetricUsageParams struct {
	// Inclusive UTC start date, YYYY-MM-DD. Supply both dates for a custom range of at
	// most 366 days. Omit both for the past 7 UTC calendar days including today.
	From param.Opt[string] `query:"from,omitzero" json:"-"`
	// Exclusive UTC end date, YYYY-MM-DD. Must be after from and at most 366 days
	// later.
	To param.Opt[string] `query:"to,omitzero" json:"-"`
	// Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept
	// when supplied; errors remain JSON.
	//
	// Any of "json", "csv".
	Format MetricUsageParamsFormat `query:"format,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MetricUsageParams) URLQuery added in v0.17.0

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

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

type MetricUsageParamsFormat added in v0.17.0

type MetricUsageParamsFormat string

Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept when supplied; errors remain JSON.

const (
	MetricUsageParamsFormatJson MetricUsageParamsFormat = "json"
	MetricUsageParamsFormatCsv  MetricUsageParamsFormat = "csv"
)

type MetricUsageResponseEnvelope added in v0.17.0

type MetricUsageResponseEnvelope struct {
	// Data contains the requested report.
	Data MetricsUsage `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Successful metrics response.

func (MetricUsageResponseEnvelope) RawJSON added in v0.17.0

func (r MetricUsageResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricUsageResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type MetricsAssets added in v0.17.0

type MetricsAssets struct {
	// Daily specifies one record for each selected creation day, oldest first.
	Daily []MetricsAssetsDaily `json:"daily" api:"required"`
	// From specifies the inclusive UTC start date.
	From string `json:"from" api:"required"`
	// Summary specifies the complete creation-date cohort.
	Summary MetricsAssetsSummary `json:"summary" api:"required"`
	// To specifies the exclusive UTC end date.
	To string `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Daily       respjson.Field
		From        respjson.Field
		Summary     respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Measurements saved on retained Assets. Explicit deletion can change historical results; temporary media cleanup does not erase saved Asset measurements.

func (MetricsAssets) RawJSON added in v0.17.0

func (r MetricsAssets) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssets) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsDaily added in v0.17.0

type MetricsAssetsDaily struct {
	// Asset outcomes grouped by Asset creation date.
	Assets MetricsAssetsDailyAssets `json:"assets" api:"required"`
	// Date specifies the UTC Asset creation day.
	Date string `json:"date" api:"required"`
	// Measured output sizes for completed Assets. Sample counts describe measurement
	// coverage.
	Outputs MetricsAssetsDailyOutputs `json:"outputs" api:"required"`
	// Source profiles count Assets, not unique Sources.
	Sources MetricsAssetsDailySources `json:"sources" api:"required"`
	// Streaming output distribution on completed Assets.
	Streaming MetricsAssetsDailyStreaming `json:"streaming" api:"required"`
	// Lifecycle timing measurements. Period medians use all samples, not averages of
	// daily medians.
	Timings MetricsAssetsDailyTimings `json:"timings" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets      respjson.Field
		Date        respjson.Field
		Outputs     respjson.Field
		Sources     respjson.Field
		Streaming   respjson.Field
		Timings     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asset measurements grouped by creation day.

func (MetricsAssetsDaily) RawJSON added in v0.17.0

func (r MetricsAssetsDaily) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsDaily) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsDailyAssets added in v0.17.0

type MetricsAssetsDailyAssets struct {
	// Completed specifies Assets with a recorded ready timestamp.
	Completed int64 `json:"completed" api:"required"`
	// Failed specifies retained Assets currently in failed status.
	Failed int64 `json:"failed" api:"required"`
	// ProcessedSeconds specifies measured media duration of completed Assets,
	// preserving fractional seconds.
	ProcessedSeconds float64 `json:"processed_seconds" api:"required"`
	// Saved specifies retained Assets created in the period.
	Saved int64 `json:"saved" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Completed        respjson.Field
		Failed           respjson.Field
		ProcessedSeconds respjson.Field
		Saved            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asset outcomes grouped by Asset creation date.

func (MetricsAssetsDailyAssets) RawJSON added in v0.17.0

func (r MetricsAssetsDailyAssets) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsDailyAssets) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsDailyOutputs added in v0.17.0

type MetricsAssetsDailyOutputs struct {
	// MeasuredAssetCount specifies completed Assets with at least one measured
	// rendition.
	MeasuredAssetCount int64 `json:"measured_asset_count" api:"required"`
	// StaticBytes specifies the sum of measured ready static rendition sizes. Null
	// when no measurements exist.
	StaticBytes int64 `json:"static_bytes" api:"required"`
	// StaticSampleCount specifies ready static renditions with measured sizes.
	StaticSampleCount int64 `json:"static_sample_count" api:"required"`
	// StreamingBytes specifies the sum of measured streaming rendition sizes. Null
	// when no measurements exist.
	StreamingBytes int64 `json:"streaming_bytes" api:"required"`
	// StreamingSampleCount specifies streaming renditions with measured sizes.
	StreamingSampleCount int64 `json:"streaming_sample_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MeasuredAssetCount   respjson.Field
		StaticBytes          respjson.Field
		StaticSampleCount    respjson.Field
		StreamingBytes       respjson.Field
		StreamingSampleCount respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Measured output sizes for completed Assets. Sample counts describe measurement coverage.

func (MetricsAssetsDailyOutputs) RawJSON added in v0.17.0

func (r MetricsAssetsDailyOutputs) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsDailyOutputs) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsDailySources added in v0.17.0

type MetricsAssetsDailySources struct {
	// AssetsByCodec specifies Asset counts by normalized source video codec, including
	// unknown. All recorded codecs are returned.
	AssetsByCodec map[string]int64 `json:"assets_by_codec" api:"required"`
	// AssetsByDuration specifies Asset counts by source duration. Keys are under_1m,
	// 1_to_5m, 5_to_10m, 10_to_30m, 30_to_60m, over_60m and unknown. Boundaries are
	// 60, 300, 600, 1800 and 3600 seconds; exactly 3600 belongs to 30_to_60m.
	AssetsByDuration map[string]int64 `json:"assets_by_duration" api:"required"`
	// AssetsByResolution specifies Asset counts by source resolution. Keys are
	// up_to_576, 577_to_720, 721_to_1080, 1081_to_2159, 2160_plus and unknown, using
	// the shorter pixel edge.
	AssetsByResolution map[string]int64 `json:"assets_by_resolution" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetsByCodec      respjson.Field
		AssetsByDuration   respjson.Field
		AssetsByResolution respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Source profiles count Assets, not unique Sources.

func (MetricsAssetsDailySources) RawJSON added in v0.17.0

func (r MetricsAssetsDailySources) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsDailySources) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsDailyStreaming added in v0.17.0

type MetricsAssetsDailyStreaming struct {
	// AssetCount specifies completed Assets, including those with no streaming
	// renditions.
	AssetCount int64 `json:"asset_count" api:"required"`
	// AssetsByHighestResolution specifies counts by highest measured streaming
	// resolution. Keys are up_to_576, 577_to_720, 721_to_1080, 1081_to_2159, 2160_plus
	// and unknown, using the shorter pixel edge.
	AssetsByHighestResolution map[string]int64 `json:"assets_by_highest_resolution" api:"required"`
	// RenditionCount specifies streaming renditions on completed Assets.
	RenditionCount int64 `json:"rendition_count" api:"required"`
	// RenditionsPerAsset specifies rendition_count divided by asset_count. Null when
	// no completed Assets exist.
	RenditionsPerAsset float64 `json:"renditions_per_asset" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetCount                respjson.Field
		AssetsByHighestResolution respjson.Field
		RenditionCount            respjson.Field
		RenditionsPerAsset        respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Streaming output distribution on completed Assets.

func (MetricsAssetsDailyStreaming) RawJSON added in v0.17.0

func (r MetricsAssetsDailyStreaming) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsDailyStreaming) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsDailyTimings added in v0.17.0

type MetricsAssetsDailyTimings struct {
	// CompletionMedianSeconds specifies the median elapsed time from creation to full
	// readiness. Null when no samples exist.
	CompletionMedianSeconds float64 `json:"completion_median_seconds" api:"required"`
	// CompletionSampleCount specifies Assets with a full readiness measurement.
	CompletionSampleCount int64 `json:"completion_sample_count" api:"required"`
	// PlaybackMedianSeconds specifies the median elapsed time from creation to
	// playback readiness. Null when no samples exist.
	PlaybackMedianSeconds float64 `json:"playback_median_seconds" api:"required"`
	// PlaybackSampleCount specifies Assets with a playback readiness measurement.
	PlaybackSampleCount int64 `json:"playback_sample_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletionMedianSeconds respjson.Field
		CompletionSampleCount   respjson.Field
		PlaybackMedianSeconds   respjson.Field
		PlaybackSampleCount     respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Lifecycle timing measurements. Period medians use all samples, not averages of daily medians.

func (MetricsAssetsDailyTimings) RawJSON added in v0.17.0

func (r MetricsAssetsDailyTimings) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsDailyTimings) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsSummary added in v0.17.0

type MetricsAssetsSummary struct {
	// Asset outcomes grouped by Asset creation date.
	Assets MetricsAssetsSummaryAssets `json:"assets" api:"required"`
	// Measured output sizes for completed Assets. Sample counts describe measurement
	// coverage.
	Outputs MetricsAssetsSummaryOutputs `json:"outputs" api:"required"`
	// Source profiles count Assets, not unique Sources.
	Sources MetricsAssetsSummarySources `json:"sources" api:"required"`
	// Streaming output distribution on completed Assets.
	Streaming MetricsAssetsSummaryStreaming `json:"streaming" api:"required"`
	// Lifecycle timing measurements. Period medians use all samples, not averages of
	// daily medians.
	Timings MetricsAssetsSummaryTimings `json:"timings" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets      respjson.Field
		Outputs     respjson.Field
		Sources     respjson.Field
		Streaming   respjson.Field
		Timings     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Summary specifies the complete creation-date cohort.

func (MetricsAssetsSummary) RawJSON added in v0.17.0

func (r MetricsAssetsSummary) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsSummary) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsSummaryAssets added in v0.17.0

type MetricsAssetsSummaryAssets struct {
	// Completed specifies Assets with a recorded ready timestamp.
	Completed int64 `json:"completed" api:"required"`
	// Failed specifies retained Assets currently in failed status.
	Failed int64 `json:"failed" api:"required"`
	// ProcessedSeconds specifies measured media duration of completed Assets,
	// preserving fractional seconds.
	ProcessedSeconds float64 `json:"processed_seconds" api:"required"`
	// Saved specifies retained Assets created in the period.
	Saved int64 `json:"saved" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Completed        respjson.Field
		Failed           respjson.Field
		ProcessedSeconds respjson.Field
		Saved            respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asset outcomes grouped by Asset creation date.

func (MetricsAssetsSummaryAssets) RawJSON added in v0.17.0

func (r MetricsAssetsSummaryAssets) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsSummaryAssets) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsSummaryOutputs added in v0.17.0

type MetricsAssetsSummaryOutputs struct {
	// MeasuredAssetCount specifies completed Assets with at least one measured
	// rendition.
	MeasuredAssetCount int64 `json:"measured_asset_count" api:"required"`
	// StaticBytes specifies the sum of measured ready static rendition sizes. Null
	// when no measurements exist.
	StaticBytes int64 `json:"static_bytes" api:"required"`
	// StaticSampleCount specifies ready static renditions with measured sizes.
	StaticSampleCount int64 `json:"static_sample_count" api:"required"`
	// StreamingBytes specifies the sum of measured streaming rendition sizes. Null
	// when no measurements exist.
	StreamingBytes int64 `json:"streaming_bytes" api:"required"`
	// StreamingSampleCount specifies streaming renditions with measured sizes.
	StreamingSampleCount int64 `json:"streaming_sample_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MeasuredAssetCount   respjson.Field
		StaticBytes          respjson.Field
		StaticSampleCount    respjson.Field
		StreamingBytes       respjson.Field
		StreamingSampleCount respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Measured output sizes for completed Assets. Sample counts describe measurement coverage.

func (MetricsAssetsSummaryOutputs) RawJSON added in v0.17.0

func (r MetricsAssetsSummaryOutputs) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsSummaryOutputs) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsSummarySources added in v0.17.0

type MetricsAssetsSummarySources struct {
	// AssetsByCodec specifies Asset counts by normalized source video codec, including
	// unknown. All recorded codecs are returned.
	AssetsByCodec map[string]int64 `json:"assets_by_codec" api:"required"`
	// AssetsByDuration specifies Asset counts by source duration. Keys are under_1m,
	// 1_to_5m, 5_to_10m, 10_to_30m, 30_to_60m, over_60m and unknown. Boundaries are
	// 60, 300, 600, 1800 and 3600 seconds; exactly 3600 belongs to 30_to_60m.
	AssetsByDuration map[string]int64 `json:"assets_by_duration" api:"required"`
	// AssetsByResolution specifies Asset counts by source resolution. Keys are
	// up_to_576, 577_to_720, 721_to_1080, 1081_to_2159, 2160_plus and unknown, using
	// the shorter pixel edge.
	AssetsByResolution map[string]int64 `json:"assets_by_resolution" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetsByCodec      respjson.Field
		AssetsByDuration   respjson.Field
		AssetsByResolution respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Source profiles count Assets, not unique Sources.

func (MetricsAssetsSummarySources) RawJSON added in v0.17.0

func (r MetricsAssetsSummarySources) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsSummarySources) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsSummaryStreaming added in v0.17.0

type MetricsAssetsSummaryStreaming struct {
	// AssetCount specifies completed Assets, including those with no streaming
	// renditions.
	AssetCount int64 `json:"asset_count" api:"required"`
	// AssetsByHighestResolution specifies counts by highest measured streaming
	// resolution. Keys are up_to_576, 577_to_720, 721_to_1080, 1081_to_2159, 2160_plus
	// and unknown, using the shorter pixel edge.
	AssetsByHighestResolution map[string]int64 `json:"assets_by_highest_resolution" api:"required"`
	// RenditionCount specifies streaming renditions on completed Assets.
	RenditionCount int64 `json:"rendition_count" api:"required"`
	// RenditionsPerAsset specifies rendition_count divided by asset_count. Null when
	// no completed Assets exist.
	RenditionsPerAsset float64 `json:"renditions_per_asset" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetCount                respjson.Field
		AssetsByHighestResolution respjson.Field
		RenditionCount            respjson.Field
		RenditionsPerAsset        respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Streaming output distribution on completed Assets.

func (MetricsAssetsSummaryStreaming) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsAssetsSummaryStreaming) UnmarshalJSON added in v0.17.0

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

type MetricsAssetsSummaryTimings added in v0.17.0

type MetricsAssetsSummaryTimings struct {
	// CompletionMedianSeconds specifies the median elapsed time from creation to full
	// readiness. Null when no samples exist.
	CompletionMedianSeconds float64 `json:"completion_median_seconds" api:"required"`
	// CompletionSampleCount specifies Assets with a full readiness measurement.
	CompletionSampleCount int64 `json:"completion_sample_count" api:"required"`
	// PlaybackMedianSeconds specifies the median elapsed time from creation to
	// playback readiness. Null when no samples exist.
	PlaybackMedianSeconds float64 `json:"playback_median_seconds" api:"required"`
	// PlaybackSampleCount specifies Assets with a playback readiness measurement.
	PlaybackSampleCount int64 `json:"playback_sample_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletionMedianSeconds respjson.Field
		CompletionSampleCount   respjson.Field
		PlaybackMedianSeconds   respjson.Field
		PlaybackSampleCount     respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Lifecycle timing measurements. Period medians use all samples, not averages of daily medians.

func (MetricsAssetsSummaryTimings) RawJSON added in v0.17.0

func (r MetricsAssetsSummaryTimings) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsAssetsSummaryTimings) UnmarshalJSON added in v0.17.0

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

type MetricsStorage added in v0.17.0

type MetricsStorage struct {
	// From specifies the inclusive UTC start date.
	From string `json:"from" api:"required"`
	// Storages specifies persistent project storage configurations, including those
	// without recorded activity. Chunkify temporary storage is excluded.
	Storages []MetricsStorageStorage `json:"storages" api:"required"`
	// To specifies the exclusive UTC end date.
	To string `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		Storages    respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Recorded additions and successful removals within event retention. Excludes external storage changes and does not measure current storage size.

func (MetricsStorage) RawJSON added in v0.17.0

func (r MetricsStorage) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsStorage) UnmarshalJSON added in v0.17.0

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

type MetricsStorageStorage added in v0.17.0

type MetricsStorageStorage struct {
	// Daily specifies one record for each selected event day, oldest first.
	Daily []MetricsStorageStorageDaily `json:"daily" api:"required"`
	// StorageId identifies the persistent storage configuration.
	StorageID string `json:"storage_id" api:"required"`
	// Summary specifies recorded activity in the selected period.
	Summary MetricsStorageStorageSummary `json:"summary" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Daily       respjson.Field
		StorageID   respjson.Field
		Summary     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Activity for one persistent storage configuration.

func (MetricsStorageStorage) RawJSON added in v0.17.0

func (r MetricsStorageStorage) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsStorageStorage) UnmarshalJSON added in v0.17.0

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

type MetricsStorageStorageDaily added in v0.17.0

type MetricsStorageStorageDaily struct {
	// AssetBytesAdded specifies recorded Asset package additions.
	AssetBytesAdded int64 `json:"asset_bytes_added" api:"required"`
	// BytesRemoved specifies recorded successful file removals as a positive amount.
	BytesRemoved int64 `json:"bytes_removed" api:"required"`
	// Date specifies the UTC event day.
	Date string `json:"date" api:"required"`
	// NetBytesChange specifies additions minus successful removals. This may be
	// negative and is not bucket occupancy.
	NetBytesChange int64 `json:"net_bytes_change" api:"required"`
	// SourceBytesAdded specifies recorded Source additions.
	SourceBytesAdded int64 `json:"source_bytes_added" api:"required"`
	// StaticRenditionBytesAdded specifies recorded static rendition additions.
	StaticRenditionBytesAdded int64 `json:"static_rendition_bytes_added" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetBytesAdded           respjson.Field
		BytesRemoved              respjson.Field
		Date                      respjson.Field
		NetBytesChange            respjson.Field
		SourceBytesAdded          respjson.Field
		StaticRenditionBytesAdded respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Recorded storage activity grouped by event day.

func (MetricsStorageStorageDaily) RawJSON added in v0.17.0

func (r MetricsStorageStorageDaily) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsStorageStorageDaily) UnmarshalJSON added in v0.17.0

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

type MetricsStorageStorageSummary added in v0.17.0

type MetricsStorageStorageSummary struct {
	// AssetBytesAdded specifies recorded Asset package additions.
	AssetBytesAdded int64 `json:"asset_bytes_added" api:"required"`
	// BytesRemoved specifies recorded successful file removals as a positive amount.
	BytesRemoved int64 `json:"bytes_removed" api:"required"`
	// NetBytesChange specifies additions minus successful removals. This may be
	// negative and is not bucket occupancy.
	NetBytesChange int64 `json:"net_bytes_change" api:"required"`
	// SourceBytesAdded specifies recorded Source additions.
	SourceBytesAdded int64 `json:"source_bytes_added" api:"required"`
	// StaticRenditionBytesAdded specifies recorded static rendition additions.
	StaticRenditionBytesAdded int64 `json:"static_rendition_bytes_added" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetBytesAdded           respjson.Field
		BytesRemoved              respjson.Field
		NetBytesChange            respjson.Field
		SourceBytesAdded          respjson.Field
		StaticRenditionBytesAdded respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Summary specifies recorded activity in the selected period.

func (MetricsStorageStorageSummary) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsStorageStorageSummary) UnmarshalJSON added in v0.17.0

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

type MetricsUsage added in v0.17.0

type MetricsUsage struct {
	// Daily specifies one record for every selected day, oldest first.
	Daily []MetricsUsageDaily `json:"daily" api:"required"`
	// From specifies the inclusive UTC start date.
	From string `json:"from" api:"required"`
	// Summary specifies totals across the selected period.
	Summary MetricsUsageSummary `json:"summary" api:"required"`
	// To specifies the exclusive UTC end date.
	To string `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Daily       respjson.Field
		From        respjson.Field
		Summary     respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Project usage for the selected UTC accounting period.

func (MetricsUsage) RawJSON added in v0.17.0

func (r MetricsUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsage) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDaily added in v0.17.0

type MetricsUsageDaily struct {
	// Asset processing usage.
	Assets MetricsUsageDailyAssets `json:"assets" api:"required"`
	// Caption processing usage.
	Captions MetricsUsageDailyCaptions `json:"captions" api:"required"`
	// Settled credits in integer units, with 10000 units equal to USD 1 of credits.
	// Category values are parts of total, not additional charges.
	CreditsSpent MetricsUsageDailyCreditsSpent `json:"credits_spent" api:"required"`
	// Date specifies the UTC accounting day.
	Date string `json:"date" api:"required"`
	// Recorded output egress eligible for the transfer tariff. Provider-exempt
	// transfers are excluded.
	Egress MetricsUsageDailyEgress `json:"egress" api:"required"`
	// Webhook delivery activity.
	Notifications MetricsUsageDailyNotifications `json:"notifications" api:"required"`
	// Source ingestion activity.
	Sources MetricsUsageDailySources `json:"sources" api:"required"`
	// Static rendition usage.
	StaticRenditions MetricsUsageDailyStaticRenditions `json:"static_renditions" api:"required"`
	// Thumbnail processing usage.
	Thumbnails MetricsUsageDailyThumbnails `json:"thumbnails" api:"required"`
	// Standalone Transcoding usage.
	Transcodings MetricsUsageDailyTranscodings `json:"transcodings" api:"required"`
	// Upload activity.
	Uploads MetricsUsageDailyUploads `json:"uploads" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets           respjson.Field
		Captions         respjson.Field
		CreditsSpent     respjson.Field
		Date             respjson.Field
		Egress           respjson.Field
		Notifications    respjson.Field
		Sources          respjson.Field
		StaticRenditions respjson.Field
		Thumbnails       respjson.Field
		Transcodings     respjson.Field
		Uploads          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Daily recorded usage. Inactive days contain zero counters.

func (MetricsUsageDaily) RawJSON added in v0.17.0

func (r MetricsUsageDaily) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDaily) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyAssets added in v0.17.0

type MetricsUsageDailyAssets struct {
	// Failed specifies recorded failed Asset outcomes.
	Failed int64 `json:"failed" api:"required"`
	// InputSeconds specifies settled billable Asset input duration.
	InputSeconds int64 `json:"input_seconds" api:"required"`
	// Video duration in seconds by pricing resolution tier: sd, hd, 2k and uhd.
	InputSecondsByResolution map[string]int64 `json:"input_seconds_by_resolution" api:"required"`
	// Ready specifies recorded successful Asset outcomes.
	Ready int64 `json:"ready" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed                   respjson.Field
		InputSeconds             respjson.Field
		InputSecondsByResolution respjson.Field
		Ready                    respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asset processing usage.

func (MetricsUsageDailyAssets) RawJSON added in v0.17.0

func (r MetricsUsageDailyAssets) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyAssets) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyCaptions added in v0.17.0

type MetricsUsageDailyCaptions struct {
	// TranscriptionSeconds specifies audio duration transcribed.
	TranscriptionSeconds int64 `json:"transcription_seconds" api:"required"`
	// TranslationSeconds specifies caption duration translated, counted once per
	// target language.
	TranslationSeconds int64 `json:"translation_seconds" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TranscriptionSeconds respjson.Field
		TranslationSeconds   respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Caption processing usage.

func (MetricsUsageDailyCaptions) RawJSON added in v0.17.0

func (r MetricsUsageDailyCaptions) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyCaptions) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyCreditsSpent added in v0.17.0

type MetricsUsageDailyCreditsSpent struct {
	// Amount specifies settled credits spent on assets. Integer units; 10000 units
	// equal USD 1 of credits.
	Assets int64 `json:"assets" api:"required"`
	// Amount specifies settled credits spent on egress. Integer units; 10000 units
	// equal USD 1 of credits.
	Egress int64 `json:"egress" api:"required"`
	// Amount specifies settled credits spent on static renditions. Integer units;
	// 10000 units equal USD 1 of credits.
	StaticRenditions int64 `json:"static_renditions" api:"required"`
	// Amount specifies settled credits spent on thumbnails. Integer units; 10000 units
	// equal USD 1 of credits.
	Thumbnails int64 `json:"thumbnails" api:"required"`
	// Total specifies the sum of these media-processing and output-egress charges.
	// Integer units; 10000 units equal USD 1 of credits.
	Total int64 `json:"total" api:"required"`
	// Amount specifies settled credits spent on transcodings. Integer units; 10000
	// units equal USD 1 of credits.
	Transcodings int64 `json:"transcodings" api:"required"`
	// Amount specifies settled credits spent on transcription. Integer units; 10000
	// units equal USD 1 of credits.
	Transcription int64 `json:"transcription" api:"required"`
	// Amount specifies settled credits spent on translation. Integer units; 10000
	// units equal USD 1 of credits.
	Translation int64 `json:"translation" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets           respjson.Field
		Egress           respjson.Field
		StaticRenditions respjson.Field
		Thumbnails       respjson.Field
		Total            respjson.Field
		Transcodings     respjson.Field
		Transcription    respjson.Field
		Translation      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Settled credits in integer units, with 10000 units equal to USD 1 of credits. Category values are parts of total, not additional charges.

func (MetricsUsageDailyCreditsSpent) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyCreditsSpent) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyEgress added in v0.17.0

type MetricsUsageDailyEgress struct {
	// Bytes specifies tariff-eligible output transfer bytes for Asset preparation.
	AssetPreparationBytes int64 `json:"asset_preparation_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for streaming renditions.
	AssetRenditionBytes int64 `json:"asset_rendition_bytes" api:"required"`
	// BillableBytes specifies external output bytes charged after the allowance.
	BillableBytes int64 `json:"billable_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for captions.
	CaptionBytes int64 `json:"caption_bytes" api:"required"`
	// IncludedBytes specifies external output bytes covered by the allowance.
	IncludedBytes int64 `json:"included_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for static renditions.
	StaticRenditionBytes int64 `json:"static_rendition_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for Thumbnails.
	ThumbnailBytes int64 `json:"thumbnail_bytes" api:"required"`
	// TotalBytes specifies the sum of tariff-eligible output transfers.
	TotalBytes int64 `json:"total_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for Transcodings.
	TranscodingBytes int64 `json:"transcoding_bytes" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetPreparationBytes respjson.Field
		AssetRenditionBytes   respjson.Field
		BillableBytes         respjson.Field
		CaptionBytes          respjson.Field
		IncludedBytes         respjson.Field
		StaticRenditionBytes  respjson.Field
		ThumbnailBytes        respjson.Field
		TotalBytes            respjson.Field
		TranscodingBytes      respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Recorded output egress eligible for the transfer tariff. Provider-exempt transfers are excluded.

func (MetricsUsageDailyEgress) RawJSON added in v0.17.0

func (r MetricsUsageDailyEgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyEgress) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyNotifications added in v0.17.0

type MetricsUsageDailyNotifications struct {
	// Failed specifies recorded failed webhook delivery attempts.
	Failed int64 `json:"failed" api:"required"`
	// Sent specifies recorded successful webhook deliveries.
	Sent int64 `json:"sent" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Sent        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook delivery activity.

func (MetricsUsageDailyNotifications) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyNotifications) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailySources added in v0.17.0

type MetricsUsageDailySources struct {
	// Bytes specifies cumulative ingested Source bytes, not current storage occupancy.
	Bytes int64 `json:"bytes" api:"required"`
	// Created specifies the number of ingested Sources.
	Created int64 `json:"created" api:"required"`
	// IngestedSeconds specifies ingested media duration in seconds.
	IngestedSeconds int64 `json:"ingested_seconds" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes           respjson.Field
		Created         respjson.Field
		IngestedSeconds respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Source ingestion activity.

func (MetricsUsageDailySources) RawJSON added in v0.17.0

func (r MetricsUsageDailySources) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDailySources) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyStaticRenditions added in v0.17.0

type MetricsUsageDailyStaticRenditions struct {
	// AudioOutputSeconds specifies the audio-only subset of output_seconds.
	AudioOutputSeconds int64 `json:"audio_output_seconds" api:"required"`
	// OutputSeconds specifies settled billable output duration, including audio-only
	// output.
	OutputSeconds int64 `json:"output_seconds" api:"required"`
	// Video duration in seconds by pricing resolution tier. Contains sd, hd, 2k and
	// uhd keys; audio is reported separately.
	OutputSecondsByResolution map[string]int64 `json:"output_seconds_by_resolution" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AudioOutputSeconds        respjson.Field
		OutputSeconds             respjson.Field
		OutputSecondsByResolution respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Static rendition usage.

func (MetricsUsageDailyStaticRenditions) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyStaticRenditions) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyThumbnails added in v0.17.0

type MetricsUsageDailyThumbnails struct {
	// ImagesPublished specifies the number of published thumbnail images.
	ImagesPublished int64 `json:"images_published" api:"required"`
	// SetsFailed specifies recorded failed Thumbnail requests.
	SetsFailed int64 `json:"sets_failed" api:"required"`
	// SetsReady specifies recorded successful Thumbnail requests.
	SetsReady int64 `json:"sets_ready" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ImagesPublished respjson.Field
		SetsFailed      respjson.Field
		SetsReady       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Thumbnail processing usage.

func (MetricsUsageDailyThumbnails) RawJSON added in v0.17.0

func (r MetricsUsageDailyThumbnails) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyThumbnails) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyTranscodings added in v0.17.0

type MetricsUsageDailyTranscodings struct {
	// AudioOutputSeconds specifies the audio-only subset of output_seconds.
	AudioOutputSeconds int64 `json:"audio_output_seconds" api:"required"`
	// Failed specifies recorded failed Transcoding outcomes.
	Failed int64 `json:"failed" api:"required"`
	// OutputSeconds specifies settled billable output duration, including audio-only
	// output.
	OutputSeconds int64 `json:"output_seconds" api:"required"`
	// Video duration in seconds by pricing resolution tier. Contains sd, hd, 2k and
	// uhd keys; audio is reported separately.
	OutputSecondsByResolution map[string]int64 `json:"output_seconds_by_resolution" api:"required"`
	// Ready specifies recorded successful Transcoding outcomes.
	Ready int64 `json:"ready" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AudioOutputSeconds        respjson.Field
		Failed                    respjson.Field
		OutputSeconds             respjson.Field
		OutputSecondsByResolution respjson.Field
		Ready                     respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standalone Transcoding usage.

func (MetricsUsageDailyTranscodings) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyTranscodings) UnmarshalJSON added in v0.17.0

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

type MetricsUsageDailyUploads added in v0.17.0

type MetricsUsageDailyUploads struct {
	// Bytes specifies successfully uploaded bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Completed specifies successfully completed Uploads.
	Completed int64 `json:"completed" api:"required"`
	// Failed specifies recorded failed Uploads.
	Failed int64 `json:"failed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Completed   respjson.Field
		Failed      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Upload activity.

func (MetricsUsageDailyUploads) RawJSON added in v0.17.0

func (r MetricsUsageDailyUploads) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageDailyUploads) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummary added in v0.17.0

type MetricsUsageSummary struct {
	// Asset processing usage.
	Assets MetricsUsageSummaryAssets `json:"assets" api:"required"`
	// Caption processing usage.
	Captions MetricsUsageSummaryCaptions `json:"captions" api:"required"`
	// Settled credits in integer units, with 10000 units equal to USD 1 of credits.
	// Category values are parts of total, not additional charges.
	CreditsSpent MetricsUsageSummaryCreditsSpent `json:"credits_spent" api:"required"`
	// Recorded output egress eligible for the transfer tariff. Provider-exempt
	// transfers are excluded.
	Egress MetricsUsageSummaryEgress `json:"egress" api:"required"`
	// Webhook delivery activity.
	Notifications MetricsUsageSummaryNotifications `json:"notifications" api:"required"`
	// Source ingestion activity.
	Sources MetricsUsageSummarySources `json:"sources" api:"required"`
	// Static rendition usage.
	StaticRenditions MetricsUsageSummaryStaticRenditions `json:"static_renditions" api:"required"`
	// Thumbnail processing usage.
	Thumbnails MetricsUsageSummaryThumbnails `json:"thumbnails" api:"required"`
	// Standalone Transcoding usage.
	Transcodings MetricsUsageSummaryTranscodings `json:"transcodings" api:"required"`
	// Upload activity.
	Uploads MetricsUsageSummaryUploads `json:"uploads" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets           respjson.Field
		Captions         respjson.Field
		CreditsSpent     respjson.Field
		Egress           respjson.Field
		Notifications    respjson.Field
		Sources          respjson.Field
		StaticRenditions respjson.Field
		Thumbnails       respjson.Field
		Transcodings     respjson.Field
		Uploads          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Summary specifies totals across the selected period.

func (MetricsUsageSummary) RawJSON added in v0.17.0

func (r MetricsUsageSummary) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageSummary) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryAssets added in v0.17.0

type MetricsUsageSummaryAssets struct {
	// Failed specifies recorded failed Asset outcomes.
	Failed int64 `json:"failed" api:"required"`
	// InputSeconds specifies settled billable Asset input duration.
	InputSeconds int64 `json:"input_seconds" api:"required"`
	// Video duration in seconds by pricing resolution tier: sd, hd, 2k and uhd.
	InputSecondsByResolution map[string]int64 `json:"input_seconds_by_resolution" api:"required"`
	// Ready specifies recorded successful Asset outcomes.
	Ready int64 `json:"ready" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed                   respjson.Field
		InputSeconds             respjson.Field
		InputSecondsByResolution respjson.Field
		Ready                    respjson.Field
		ExtraFields              map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Asset processing usage.

func (MetricsUsageSummaryAssets) RawJSON added in v0.17.0

func (r MetricsUsageSummaryAssets) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryAssets) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryCaptions added in v0.17.0

type MetricsUsageSummaryCaptions struct {
	// TranscriptionSeconds specifies audio duration transcribed.
	TranscriptionSeconds int64 `json:"transcription_seconds" api:"required"`
	// TranslationSeconds specifies caption duration translated, counted once per
	// target language.
	TranslationSeconds int64 `json:"translation_seconds" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		TranscriptionSeconds respjson.Field
		TranslationSeconds   respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Caption processing usage.

func (MetricsUsageSummaryCaptions) RawJSON added in v0.17.0

func (r MetricsUsageSummaryCaptions) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryCaptions) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryCreditsSpent added in v0.17.0

type MetricsUsageSummaryCreditsSpent struct {
	// Amount specifies settled credits spent on assets. Integer units; 10000 units
	// equal USD 1 of credits.
	Assets int64 `json:"assets" api:"required"`
	// Amount specifies settled credits spent on egress. Integer units; 10000 units
	// equal USD 1 of credits.
	Egress int64 `json:"egress" api:"required"`
	// Amount specifies settled credits spent on static renditions. Integer units;
	// 10000 units equal USD 1 of credits.
	StaticRenditions int64 `json:"static_renditions" api:"required"`
	// Amount specifies settled credits spent on thumbnails. Integer units; 10000 units
	// equal USD 1 of credits.
	Thumbnails int64 `json:"thumbnails" api:"required"`
	// Total specifies the sum of these media-processing and output-egress charges.
	// Integer units; 10000 units equal USD 1 of credits.
	Total int64 `json:"total" api:"required"`
	// Amount specifies settled credits spent on transcodings. Integer units; 10000
	// units equal USD 1 of credits.
	Transcodings int64 `json:"transcodings" api:"required"`
	// Amount specifies settled credits spent on transcription. Integer units; 10000
	// units equal USD 1 of credits.
	Transcription int64 `json:"transcription" api:"required"`
	// Amount specifies settled credits spent on translation. Integer units; 10000
	// units equal USD 1 of credits.
	Translation int64 `json:"translation" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Assets           respjson.Field
		Egress           respjson.Field
		StaticRenditions respjson.Field
		Thumbnails       respjson.Field
		Total            respjson.Field
		Transcodings     respjson.Field
		Transcription    respjson.Field
		Translation      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Settled credits in integer units, with 10000 units equal to USD 1 of credits. Category values are parts of total, not additional charges.

func (MetricsUsageSummaryCreditsSpent) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryCreditsSpent) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryEgress added in v0.17.0

type MetricsUsageSummaryEgress struct {
	// Bytes specifies tariff-eligible output transfer bytes for Asset preparation.
	AssetPreparationBytes int64 `json:"asset_preparation_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for streaming renditions.
	AssetRenditionBytes int64 `json:"asset_rendition_bytes" api:"required"`
	// BillableBytes specifies external output bytes charged after the allowance.
	BillableBytes int64 `json:"billable_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for captions.
	CaptionBytes int64 `json:"caption_bytes" api:"required"`
	// IncludedBytes specifies external output bytes covered by the allowance.
	IncludedBytes int64 `json:"included_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for static renditions.
	StaticRenditionBytes int64 `json:"static_rendition_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for Thumbnails.
	ThumbnailBytes int64 `json:"thumbnail_bytes" api:"required"`
	// TotalBytes specifies the sum of tariff-eligible output transfers.
	TotalBytes int64 `json:"total_bytes" api:"required"`
	// Bytes specifies tariff-eligible output transfer bytes for Transcodings.
	TranscodingBytes int64 `json:"transcoding_bytes" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AssetPreparationBytes respjson.Field
		AssetRenditionBytes   respjson.Field
		BillableBytes         respjson.Field
		CaptionBytes          respjson.Field
		IncludedBytes         respjson.Field
		StaticRenditionBytes  respjson.Field
		ThumbnailBytes        respjson.Field
		TotalBytes            respjson.Field
		TranscodingBytes      respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Recorded output egress eligible for the transfer tariff. Provider-exempt transfers are excluded.

func (MetricsUsageSummaryEgress) RawJSON added in v0.17.0

func (r MetricsUsageSummaryEgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryEgress) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryNotifications added in v0.17.0

type MetricsUsageSummaryNotifications struct {
	// Failed specifies recorded failed webhook delivery attempts.
	Failed int64 `json:"failed" api:"required"`
	// Sent specifies recorded successful webhook deliveries.
	Sent int64 `json:"sent" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Sent        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook delivery activity.

func (MetricsUsageSummaryNotifications) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryNotifications) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummarySources added in v0.17.0

type MetricsUsageSummarySources struct {
	// Bytes specifies cumulative ingested Source bytes, not current storage occupancy.
	Bytes int64 `json:"bytes" api:"required"`
	// Created specifies the number of ingested Sources.
	Created int64 `json:"created" api:"required"`
	// IngestedSeconds specifies ingested media duration in seconds.
	IngestedSeconds int64 `json:"ingested_seconds" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes           respjson.Field
		Created         respjson.Field
		IngestedSeconds respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Source ingestion activity.

func (MetricsUsageSummarySources) RawJSON added in v0.17.0

func (r MetricsUsageSummarySources) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageSummarySources) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryStaticRenditions added in v0.17.0

type MetricsUsageSummaryStaticRenditions struct {
	// AudioOutputSeconds specifies the audio-only subset of output_seconds.
	AudioOutputSeconds int64 `json:"audio_output_seconds" api:"required"`
	// OutputSeconds specifies settled billable output duration, including audio-only
	// output.
	OutputSeconds int64 `json:"output_seconds" api:"required"`
	// Video duration in seconds by pricing resolution tier. Contains sd, hd, 2k and
	// uhd keys; audio is reported separately.
	OutputSecondsByResolution map[string]int64 `json:"output_seconds_by_resolution" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AudioOutputSeconds        respjson.Field
		OutputSeconds             respjson.Field
		OutputSecondsByResolution respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Static rendition usage.

func (MetricsUsageSummaryStaticRenditions) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryStaticRenditions) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryThumbnails added in v0.17.0

type MetricsUsageSummaryThumbnails struct {
	// ImagesPublished specifies the number of published thumbnail images.
	ImagesPublished int64 `json:"images_published" api:"required"`
	// SetsFailed specifies recorded failed Thumbnail requests.
	SetsFailed int64 `json:"sets_failed" api:"required"`
	// SetsReady specifies recorded successful Thumbnail requests.
	SetsReady int64 `json:"sets_ready" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ImagesPublished respjson.Field
		SetsFailed      respjson.Field
		SetsReady       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Thumbnail processing usage.

func (MetricsUsageSummaryThumbnails) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryThumbnails) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryTranscodings added in v0.17.0

type MetricsUsageSummaryTranscodings struct {
	// AudioOutputSeconds specifies the audio-only subset of output_seconds.
	AudioOutputSeconds int64 `json:"audio_output_seconds" api:"required"`
	// Failed specifies recorded failed Transcoding outcomes.
	Failed int64 `json:"failed" api:"required"`
	// OutputSeconds specifies settled billable output duration, including audio-only
	// output.
	OutputSeconds int64 `json:"output_seconds" api:"required"`
	// Video duration in seconds by pricing resolution tier. Contains sd, hd, 2k and
	// uhd keys; audio is reported separately.
	OutputSecondsByResolution map[string]int64 `json:"output_seconds_by_resolution" api:"required"`
	// Ready specifies recorded successful Transcoding outcomes.
	Ready int64 `json:"ready" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AudioOutputSeconds        respjson.Field
		Failed                    respjson.Field
		OutputSeconds             respjson.Field
		OutputSecondsByResolution respjson.Field
		Ready                     respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Standalone Transcoding usage.

func (MetricsUsageSummaryTranscodings) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryTranscodings) UnmarshalJSON added in v0.17.0

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

type MetricsUsageSummaryUploads added in v0.17.0

type MetricsUsageSummaryUploads struct {
	// Bytes specifies successfully uploaded bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Completed specifies successfully completed Uploads.
	Completed int64 `json:"completed" api:"required"`
	// Failed specifies recorded failed Uploads.
	Failed int64 `json:"failed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Completed   respjson.Field
		Failed      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Upload activity.

func (MetricsUsageSummaryUploads) RawJSON added in v0.17.0

func (r MetricsUsageSummaryUploads) RawJSON() string

Returns the unmodified JSON received from the API

func (*MetricsUsageSummaryUploads) UnmarshalJSON added in v0.17.0

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

type NewEventWebhookEvent added in v0.6.0

type NewEventWebhookEvent struct {
	// Unique identifier of the notification
	ID string `json:"id" api:"required"`
	// Payload for the event named in event. Replays preserve the original data;
	// retrieve the resource for current state and fresh signed URLs.
	Data NewEventWebhookEventDataUnion `json:"data" api:"required"`
	// Timestamp of the event payload.
	Date time.Time `json:"date" api:"required" format:"date-time"`
	// Type of event that triggered the notification.
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Event NewEventWebhookEventEvent `json:"event" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Data        respjson.Field
		Date        respjson.Field
		Event       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewEventWebhookEvent) RawJSON added in v0.6.0

func (r NewEventWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewEventWebhookEvent) UnmarshalJSON added in v0.6.0

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

type NewEventWebhookEventDataNotificationPayloadAsset added in v0.17.0

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

func (NewEventWebhookEventDataNotificationPayloadAsset) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadAsset) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadAssetDeleted added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadAssetDeleted struct {
	Asset Asset `json:"asset" api:"required"`
	// FilesDeleted indicates whether the requested cleanup of the Asset's generated
	// files completed without error. Missing files count as successful cleanup. False
	// means these files were not removed at event time. Private transcript text and
	// saved subtitle copies are always scheduled for asynchronous cleanup.
	FilesDeleted bool `json:"files_deleted" api:"required"`
	// DeletedSize specifies the recorded generated-file bytes removed with the Asset,
	// including attached outputs. Omitted when cleanup was not requested or the total
	// is unavailable. Missing storage objects still contribute their recorded sizes.
	DeletedSize int64 `json:"deleted_size"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Asset        respjson.Field
		FilesDeleted respjson.Field
		DeletedSize  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for asset.deleted. The Asset snapshot is preserved after record deletion.

func (NewEventWebhookEventDataNotificationPayloadAssetDeleted) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadAssetDeleted) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadAssetOutput added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadAssetOutput struct {
	// Output contains the canonical typed output snapshot at the event time, matching
	// the output API.
	Output AssetOutputUnion `json:"output" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Output      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for Asset output creation, readiness, and failure events.

func (NewEventWebhookEventDataNotificationPayloadAssetOutput) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadAssetOutput) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadAssetOutputDeleted added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadAssetOutputDeleted struct {
	// FilesDeleted indicates whether the requested cleanup of the output files
	// completed without error. Missing files count as successful cleanup. False means
	// these files were not removed at event time. Private transcript text and saved
	// subtitle copies are always scheduled for asynchronous cleanup.
	FilesDeleted bool `json:"files_deleted" api:"required"`
	// Output contains the canonical typed output snapshot before removal.
	Output AssetOutputUnion `json:"output" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FilesDeleted respjson.Field
		Output       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for asset.output.deleted. The output snapshot is preserved after removal.

func (NewEventWebhookEventDataNotificationPayloadAssetOutputDeleted) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadAssetOutputDeleted) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadJobCompleted struct {
	// List of files generated by the job
	Files []JobFile `json:"files" api:"required"`
	Job   Job       `json:"job" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files       respjson.Field
		Job         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload data structure for job.completed events

func (NewEventWebhookEventDataNotificationPayloadJobCompleted) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadJobCompleted) UnmarshalJSON added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadJobCreated added in v0.17.0

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

Payload for job.created. A standalone Job has been accepted for processing; execution may not have started.

func (NewEventWebhookEventDataNotificationPayloadJobCreated) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadJobCreated) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

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

Payload data structure for job.failed and job.cancelled events

func (NewEventWebhookEventDataNotificationPayloadJobFailed) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadJobFailed) UnmarshalJSON added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadSourceCreated added in v0.17.0

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

Payload for source.created. The Source has been validated and saved. Thumbnails may still be pending.

func (NewEventWebhookEventDataNotificationPayloadSourceCreated) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadSourceCreated) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadTranscoding added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadTranscoding struct {
	// Transcoding contains the canonical resource snapshot at the event time.
	Transcoding Transcoding `json:"transcoding" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Transcoding respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for transcoding.created, transcoding.ready, transcoding.failed, transcoding.cancelled, transcoding.expired and transcoding.deleted events.

func (NewEventWebhookEventDataNotificationPayloadTranscoding) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadTranscoding) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadUploadCompleted struct {
	Source Source `json:"source" api:"required"`
	Upload Upload `json:"upload" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Source      respjson.Field
		Upload      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload data structure for upload.completed events

func (NewEventWebhookEventDataNotificationPayloadUploadCompleted) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadUploadCompleted) UnmarshalJSON added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadUploadCreated added in v0.17.0

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

Payload for upload.created. A waiting upload session has been created; its Source is created only after successful completion. Transfer credentials are not included.

func (NewEventWebhookEventDataNotificationPayloadUploadCreated) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadUploadCreated) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

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

Payload data structure for upload.failed and upload.expired events

func (NewEventWebhookEventDataNotificationPayloadUploadFailed) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadUploadFailed) UnmarshalJSON added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadWorkflowRun added in v0.17.0

type NewEventWebhookEventDataNotificationPayloadWorkflowRun struct {
	// ActionRuns specifies every action admitted by this run, including its rule and
	// action IDs, type, input, status, output reference, and any skip or failure
	// reason. Actions from other runs are excluded.
	ActionRuns []AssetActionRun `json:"action_runs" api:"required"`
	// Snapshot of the Workflow run when the event was recorded.
	WorkflowRun WorkflowRun `json:"workflow_run" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActionRuns  respjson.Field
		WorkflowRun respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for workflow_run.created, workflow_run.completed, workflow_run.failed, and workflow_run.cancelled. The run and its actions are snapshots taken when the event was recorded.

func (NewEventWebhookEventDataNotificationPayloadWorkflowRun) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataNotificationPayloadWorkflowRun) UnmarshalJSON added in v0.17.0

type NewEventWebhookEventDataThumbnailEventData added in v0.17.0

type NewEventWebhookEventDataThumbnailEventData struct {
	// Thumbnail contains the resource at the event time.
	Thumbnail Thumbnail `json:"thumbnail" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Thumbnail   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A canonical thumbnail snapshot for standalone thumbnail.\* events. Asset-owned thumbnails use the Asset output event payload.

func (NewEventWebhookEventDataThumbnailEventData) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataThumbnailEventData) UnmarshalJSON added in v0.17.0

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

type NewEventWebhookEventDataUnion added in v0.6.0

type NewEventWebhookEventDataUnion struct {
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadJobCompleted].
	Files []JobFile `json:"files"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadJobCompleted].
	Job Job `json:"job"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadSourceCreated].
	Source Source `json:"source"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadUploadCreated].
	Upload Upload `json:"upload"`
	// This field is from variant [NewEventWebhookEventDataNotificationPayloadAsset].
	Asset Asset `json:"asset"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadAssetOutput].
	Output       AssetOutputUnion `json:"output"`
	FilesDeleted bool             `json:"files_deleted"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadAssetDeleted].
	DeletedSize int64 `json:"deleted_size"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadWorkflowRun].
	ActionRuns []AssetActionRun `json:"action_runs"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadWorkflowRun].
	WorkflowRun WorkflowRun `json:"workflow_run"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadTranscoding].
	Transcoding Transcoding `json:"transcoding"`
	// This field is from variant [NewEventWebhookEventDataThumbnailEventData].
	Thumbnail Thumbnail `json:"thumbnail"`
	JSON      struct {
		Files        respjson.Field
		Job          respjson.Field
		Source       respjson.Field
		Upload       respjson.Field
		Asset        respjson.Field
		Output       respjson.Field
		FilesDeleted respjson.Field
		DeletedSize  respjson.Field
		ActionRuns   respjson.Field
		WorkflowRun  respjson.Field
		Transcoding  respjson.Field
		Thumbnail    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

NewEventWebhookEventDataUnion contains all possible properties and values from NewEventWebhookEventDataNotificationPayloadJobCompleted, NewEventWebhookEventDataNotificationPayloadJobFailed, NewEventWebhookEventDataNotificationPayloadJobCreated, NewEventWebhookEventDataNotificationPayloadSourceCreated, NewEventWebhookEventDataNotificationPayloadUploadCreated, NewEventWebhookEventDataNotificationPayloadUploadCompleted, NewEventWebhookEventDataNotificationPayloadUploadFailed, NewEventWebhookEventDataNotificationPayloadAsset, NewEventWebhookEventDataNotificationPayloadAssetOutput, NewEventWebhookEventDataNotificationPayloadAssetOutputDeleted, NewEventWebhookEventDataNotificationPayloadAssetDeleted, NewEventWebhookEventDataNotificationPayloadWorkflowRun, NewEventWebhookEventDataNotificationPayloadTranscoding, NewEventWebhookEventDataThumbnailEventData.

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

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAsset added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAsset() (v NewEventWebhookEventDataNotificationPayloadAsset)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAssetDeleted added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAssetDeleted() (v NewEventWebhookEventDataNotificationPayloadAssetDeleted)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAssetOutput added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAssetOutput() (v NewEventWebhookEventDataNotificationPayloadAssetOutput)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAssetOutputDeleted added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadAssetOutputDeleted() (v NewEventWebhookEventDataNotificationPayloadAssetOutputDeleted)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobCompleted() (v NewEventWebhookEventDataNotificationPayloadJobCompleted)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobCreated added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobCreated() (v NewEventWebhookEventDataNotificationPayloadJobCreated)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobFailed() (v NewEventWebhookEventDataNotificationPayloadJobFailed)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadSourceCreated added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadSourceCreated() (v NewEventWebhookEventDataNotificationPayloadSourceCreated)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadTranscoding added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadTranscoding() (v NewEventWebhookEventDataNotificationPayloadTranscoding)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadCompleted() (v NewEventWebhookEventDataNotificationPayloadUploadCompleted)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadCreated added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadCreated() (v NewEventWebhookEventDataNotificationPayloadUploadCreated)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadFailed() (v NewEventWebhookEventDataNotificationPayloadUploadFailed)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadWorkflowRun added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadWorkflowRun() (v NewEventWebhookEventDataNotificationPayloadWorkflowRun)

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataThumbnailEventData added in v0.17.0

func (u NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataThumbnailEventData() (v NewEventWebhookEventDataThumbnailEventData)

func (NewEventWebhookEventDataUnion) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NewEventWebhookEventDataUnion) UnmarshalJSON added in v0.6.0

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

type NewEventWebhookEventEvent added in v0.6.0

type NewEventWebhookEventEvent string

Type of event that triggered the notification.

const (
	NewEventWebhookEventEventJobCreated           NewEventWebhookEventEvent = "job.created"
	NewEventWebhookEventEventJobCompleted         NewEventWebhookEventEvent = "job.completed"
	NewEventWebhookEventEventJobFailed            NewEventWebhookEventEvent = "job.failed"
	NewEventWebhookEventEventJobCancelled         NewEventWebhookEventEvent = "job.cancelled"
	NewEventWebhookEventEventSourceCreated        NewEventWebhookEventEvent = "source.created"
	NewEventWebhookEventEventSourceDeleted        NewEventWebhookEventEvent = "source.deleted"
	NewEventWebhookEventEventUploadCreated        NewEventWebhookEventEvent = "upload.created"
	NewEventWebhookEventEventUploadCompleted      NewEventWebhookEventEvent = "upload.completed"
	NewEventWebhookEventEventUploadFailed         NewEventWebhookEventEvent = "upload.failed"
	NewEventWebhookEventEventUploadExpired        NewEventWebhookEventEvent = "upload.expired"
	NewEventWebhookEventEventAssetCreated         NewEventWebhookEventEvent = "asset.created"
	NewEventWebhookEventEventAssetReady           NewEventWebhookEventEvent = "asset.ready"
	NewEventWebhookEventEventAssetPlaybackReady   NewEventWebhookEventEvent = "asset.playback_ready"
	NewEventWebhookEventEventAssetFailed          NewEventWebhookEventEvent = "asset.failed"
	NewEventWebhookEventEventAssetExpired         NewEventWebhookEventEvent = "asset.expired"
	NewEventWebhookEventEventAssetDeleted         NewEventWebhookEventEvent = "asset.deleted"
	NewEventWebhookEventEventAssetOutputCreated   NewEventWebhookEventEvent = "asset.output.created"
	NewEventWebhookEventEventAssetOutputReady     NewEventWebhookEventEvent = "asset.output.ready"
	NewEventWebhookEventEventAssetOutputFailed    NewEventWebhookEventEvent = "asset.output.failed"
	NewEventWebhookEventEventAssetOutputDeleted   NewEventWebhookEventEvent = "asset.output.deleted"
	NewEventWebhookEventEventWorkflowRunCreated   NewEventWebhookEventEvent = "workflow_run.created"
	NewEventWebhookEventEventWorkflowRunCompleted NewEventWebhookEventEvent = "workflow_run.completed"
	NewEventWebhookEventEventWorkflowRunFailed    NewEventWebhookEventEvent = "workflow_run.failed"
	NewEventWebhookEventEventWorkflowRunCancelled NewEventWebhookEventEvent = "workflow_run.cancelled"
	NewEventWebhookEventEventTranscodingCreated   NewEventWebhookEventEvent = "transcoding.created"
	NewEventWebhookEventEventTranscodingReady     NewEventWebhookEventEvent = "transcoding.ready"
	NewEventWebhookEventEventTranscodingFailed    NewEventWebhookEventEvent = "transcoding.failed"
	NewEventWebhookEventEventTranscodingCancelled NewEventWebhookEventEvent = "transcoding.cancelled"
	NewEventWebhookEventEventTranscodingExpired   NewEventWebhookEventEvent = "transcoding.expired"
	NewEventWebhookEventEventTranscodingDeleted   NewEventWebhookEventEvent = "transcoding.deleted"
	NewEventWebhookEventEventThumbnailCreated     NewEventWebhookEventEvent = "thumbnail.created"
	NewEventWebhookEventEventThumbnailReady       NewEventWebhookEventEvent = "thumbnail.ready"
	NewEventWebhookEventEventThumbnailFailed      NewEventWebhookEventEvent = "thumbnail.failed"
	NewEventWebhookEventEventThumbnailExpired     NewEventWebhookEventEvent = "thumbnail.expired"
	NewEventWebhookEventEventThumbnailDeleted     NewEventWebhookEventEvent = "thumbnail.deleted"
)

type Notification

type Notification struct {
	// Unique identifier of the notification
	ID string `json:"id" api:"required"`
	// Timestamp when the notification was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Type of event that triggered this notification
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Event NotificationEvent `json:"event" api:"required"`
	// ID of the object that triggered this notification
	ObjectID string `json:"object_id" api:"required"`
	// JSON payload that was sent to the webhook endpoint
	Payload string `json:"payload" api:"required"`
	// Webhook endpoint configuration that received this notification
	Webhook Webhook `json:"webhook" api:"required"`
	// Originating event ID, when recorded by the event log.
	EventID string `json:"event_id"`
	// HTTP status code received from the webhook endpoint
	ResponseStatusCode int64 `json:"response_status_code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		CreatedAt          respjson.Field
		Event              respjson.Field
		ObjectID           respjson.Field
		Payload            respjson.Field
		Webhook            respjson.Field
		EventID            respjson.Field
		ResponseStatusCode respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Notification) RawJSON added in v0.6.0

func (r Notification) RawJSON() string

Returns the unmodified JSON received from the API

func (*Notification) UnmarshalJSON added in v0.6.0

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

type NotificationEvent added in v0.6.0

type NotificationEvent string

Type of event that triggered this notification

const (
	NotificationEventJobCreated           NotificationEvent = "job.created"
	NotificationEventJobCompleted         NotificationEvent = "job.completed"
	NotificationEventJobFailed            NotificationEvent = "job.failed"
	NotificationEventJobCancelled         NotificationEvent = "job.cancelled"
	NotificationEventSourceCreated        NotificationEvent = "source.created"
	NotificationEventSourceDeleted        NotificationEvent = "source.deleted"
	NotificationEventUploadCreated        NotificationEvent = "upload.created"
	NotificationEventUploadCompleted      NotificationEvent = "upload.completed"
	NotificationEventUploadFailed         NotificationEvent = "upload.failed"
	NotificationEventUploadExpired        NotificationEvent = "upload.expired"
	NotificationEventAssetCreated         NotificationEvent = "asset.created"
	NotificationEventAssetReady           NotificationEvent = "asset.ready"
	NotificationEventAssetPlaybackReady   NotificationEvent = "asset.playback_ready"
	NotificationEventAssetFailed          NotificationEvent = "asset.failed"
	NotificationEventAssetExpired         NotificationEvent = "asset.expired"
	NotificationEventAssetDeleted         NotificationEvent = "asset.deleted"
	NotificationEventAssetOutputCreated   NotificationEvent = "asset.output.created"
	NotificationEventAssetOutputReady     NotificationEvent = "asset.output.ready"
	NotificationEventAssetOutputFailed    NotificationEvent = "asset.output.failed"
	NotificationEventAssetOutputDeleted   NotificationEvent = "asset.output.deleted"
	NotificationEventWorkflowRunCreated   NotificationEvent = "workflow_run.created"
	NotificationEventWorkflowRunCompleted NotificationEvent = "workflow_run.completed"
	NotificationEventWorkflowRunFailed    NotificationEvent = "workflow_run.failed"
	NotificationEventWorkflowRunCancelled NotificationEvent = "workflow_run.cancelled"
	NotificationEventTranscodingCreated   NotificationEvent = "transcoding.created"
	NotificationEventTranscodingReady     NotificationEvent = "transcoding.ready"
	NotificationEventTranscodingFailed    NotificationEvent = "transcoding.failed"
	NotificationEventTranscodingCancelled NotificationEvent = "transcoding.cancelled"
	NotificationEventTranscodingExpired   NotificationEvent = "transcoding.expired"
	NotificationEventTranscodingDeleted   NotificationEvent = "transcoding.deleted"
	NotificationEventThumbnailCreated     NotificationEvent = "thumbnail.created"
	NotificationEventThumbnailReady       NotificationEvent = "thumbnail.ready"
	NotificationEventThumbnailFailed      NotificationEvent = "thumbnail.failed"
	NotificationEventThumbnailExpired     NotificationEvent = "thumbnail.expired"
	NotificationEventThumbnailDeleted     NotificationEvent = "thumbnail.deleted"
)

type NotificationGetResponseEnvelope added in v0.6.0

type NotificationGetResponseEnvelope struct {
	// Data contains the response object
	Data Notification `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NotificationGetResponseEnvelope) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NotificationGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type NotificationListParams

type NotificationListParams struct {
	// Filter deliveries by their originating event ID.
	EventID param.Opt[string] `query:"event_id,omitzero" json:"-"`
	// Pagination limit (max 100)
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by object ID
	ObjectID param.Opt[string] `query:"object_id,omitzero" json:"-"`
	// Pagination offset
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter by webhook ID
	WebhookID param.Opt[string]             `query:"webhook_id,omitzero" json:"-"`
	Created   NotificationListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by events
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Events             []string                                 `query:"events,omitzero" json:"-"`
	ResponseStatusCode NotificationListParamsResponseStatusCode `query:"response_status_code,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NotificationListParams) URLQuery added in v0.6.0

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

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

type NotificationListParamsCreated added in v0.6.0

type NotificationListParamsCreated struct {
	// Filter by creation date greater than or equal (UNIX epoch time)
	Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
	// Sort by creation date (asc/desc)
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NotificationListParamsCreated) URLQuery added in v0.6.0

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

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

type NotificationListParamsResponseStatusCode added in v0.6.0

type NotificationListParamsResponseStatusCode struct {
	// Filter by exact response status code
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by response status code greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by response status code less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NotificationListParamsResponseStatusCode) URLQuery added in v0.6.0

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

type NotificationNewParams added in v0.6.0

type NotificationNewParams struct {
	// Event specifies the type of event that triggered the notification.
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Event NotificationNewParamsEvent `json:"event,omitzero" api:"required"`
	// ID of the resource that triggered the event. Use the caption, static rendition,
	// or thumbnail ID for their Asset child events. Replaying asset events,
	// job.created, or source.created requires a retained snapshot. Resource deletion
	// does not prevent replay.
	ObjectID string `json:"object_id" api:"required"`
	// WebhookId specifies the webhook endpoint that will receive the notification.
	WebhookID string `json:"webhook_id" api:"required"`
	// contains filtered or unexported fields
}

func (NotificationNewParams) MarshalJSON added in v0.6.0

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

func (*NotificationNewParams) UnmarshalJSON added in v0.6.0

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

type NotificationNewParamsEvent added in v0.6.0

type NotificationNewParamsEvent string

Event specifies the type of event that triggered the notification.

const (
	NotificationNewParamsEventJobCreated           NotificationNewParamsEvent = "job.created"
	NotificationNewParamsEventJobCompleted         NotificationNewParamsEvent = "job.completed"
	NotificationNewParamsEventJobFailed            NotificationNewParamsEvent = "job.failed"
	NotificationNewParamsEventJobCancelled         NotificationNewParamsEvent = "job.cancelled"
	NotificationNewParamsEventSourceCreated        NotificationNewParamsEvent = "source.created"
	NotificationNewParamsEventSourceDeleted        NotificationNewParamsEvent = "source.deleted"
	NotificationNewParamsEventUploadCreated        NotificationNewParamsEvent = "upload.created"
	NotificationNewParamsEventUploadCompleted      NotificationNewParamsEvent = "upload.completed"
	NotificationNewParamsEventUploadFailed         NotificationNewParamsEvent = "upload.failed"
	NotificationNewParamsEventUploadExpired        NotificationNewParamsEvent = "upload.expired"
	NotificationNewParamsEventAssetCreated         NotificationNewParamsEvent = "asset.created"
	NotificationNewParamsEventAssetReady           NotificationNewParamsEvent = "asset.ready"
	NotificationNewParamsEventAssetPlaybackReady   NotificationNewParamsEvent = "asset.playback_ready"
	NotificationNewParamsEventAssetFailed          NotificationNewParamsEvent = "asset.failed"
	NotificationNewParamsEventAssetExpired         NotificationNewParamsEvent = "asset.expired"
	NotificationNewParamsEventAssetDeleted         NotificationNewParamsEvent = "asset.deleted"
	NotificationNewParamsEventAssetOutputCreated   NotificationNewParamsEvent = "asset.output.created"
	NotificationNewParamsEventAssetOutputReady     NotificationNewParamsEvent = "asset.output.ready"
	NotificationNewParamsEventAssetOutputFailed    NotificationNewParamsEvent = "asset.output.failed"
	NotificationNewParamsEventAssetOutputDeleted   NotificationNewParamsEvent = "asset.output.deleted"
	NotificationNewParamsEventWorkflowRunCreated   NotificationNewParamsEvent = "workflow_run.created"
	NotificationNewParamsEventWorkflowRunCompleted NotificationNewParamsEvent = "workflow_run.completed"
	NotificationNewParamsEventWorkflowRunFailed    NotificationNewParamsEvent = "workflow_run.failed"
	NotificationNewParamsEventWorkflowRunCancelled NotificationNewParamsEvent = "workflow_run.cancelled"
	NotificationNewParamsEventTranscodingCreated   NotificationNewParamsEvent = "transcoding.created"
	NotificationNewParamsEventTranscodingReady     NotificationNewParamsEvent = "transcoding.ready"
	NotificationNewParamsEventTranscodingFailed    NotificationNewParamsEvent = "transcoding.failed"
	NotificationNewParamsEventTranscodingCancelled NotificationNewParamsEvent = "transcoding.cancelled"
	NotificationNewParamsEventTranscodingExpired   NotificationNewParamsEvent = "transcoding.expired"
	NotificationNewParamsEventTranscodingDeleted   NotificationNewParamsEvent = "transcoding.deleted"
	NotificationNewParamsEventThumbnailCreated     NotificationNewParamsEvent = "thumbnail.created"
	NotificationNewParamsEventThumbnailReady       NotificationNewParamsEvent = "thumbnail.ready"
	NotificationNewParamsEventThumbnailFailed      NotificationNewParamsEvent = "thumbnail.failed"
	NotificationNewParamsEventThumbnailExpired     NotificationNewParamsEvent = "thumbnail.expired"
	NotificationNewParamsEventThumbnailDeleted     NotificationNewParamsEvent = "thumbnail.deleted"
)

type NotificationNewResponseEnvelope added in v0.6.0

type NotificationNewResponseEnvelope struct {
	// Data contains the response object
	Data Notification `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NotificationNewResponseEnvelope) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*NotificationNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type NotificationService added in v0.6.0

type NotificationService struct {
	Options []option.RequestOption
}

NotificationService contains methods and other services that help with interacting with the chunkify 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 NewNotificationService method instead.

func NewNotificationService added in v0.6.0

func NewNotificationService(opts ...option.RequestOption) (r NotificationService)

NewNotificationService 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 (*NotificationService) Delete added in v0.6.0

func (r *NotificationService) Delete(ctx context.Context, notificationID string, opts ...option.RequestOption) (err error)

Delete a notification.

func (*NotificationService) Get added in v0.6.0

func (r *NotificationService) Get(ctx context.Context, notificationID string, opts ...option.RequestOption) (res *Notification, err error)

Retrieve details of a specific notification

func (*NotificationService) List added in v0.6.0

Retrieve a list of notifications with optional filtering and pagination

func (*NotificationService) ListAutoPaging added in v0.6.0

Retrieve a list of notifications with optional filtering and pagination

func (*NotificationService) New added in v0.6.0

Send an event notification to a webhook endpoint. Recorded events replay their original payload.

type Project

type Project struct {
	// Id is the unique identifier for the project.
	ID string `json:"id" api:"required"`
	// Defaults for new Assets, including Assets created from Uploads.
	AssetDefaults ProjectAssetDefaults `json:"asset_defaults" api:"required"`
	// Timestamp when the project was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Name of the project
	Name string `json:"name" api:"required"`
	// Slug is the slug for the project.
	Slug string `json:"slug" api:"required"`
	// StorageId identifier where project files are stored
	StorageID string `json:"storage_id" api:"required"`
	// DefaultWorkflowId specifies the default Workflow for new Assets. Set null to
	// clear it.
	DefaultWorkflowID string `json:"default_workflow_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		AssetDefaults     respjson.Field
		CreatedAt         respjson.Field
		Name              respjson.Field
		Slug              respjson.Field
		StorageID         respjson.Field
		DefaultWorkflowID respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Project) RawJSON added in v0.6.0

func (r Project) RawJSON() string

Returns the unmodified JSON received from the API

func (*Project) UnmarshalJSON added in v0.6.0

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

type ProjectAnalyticsConnectionGetResponseEnvelope added in v0.17.0

type ProjectAnalyticsConnectionGetResponseEnvelope struct {
	// A saved source for analytics reports. The dashboard player default is
	// independent of the connection selected in reports. External players keep their
	// own configuration. Only the public ingest key is included; read and management
	// credentials stay private.
	Data   AnalyticsConnection `json:"data" api:"required"`
	Status constant.Success    `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionKeyListResponse added in v0.17.0

type ProjectAnalyticsConnectionKeyListResponse struct {
	Data   []AnalyticsKey   `json:"data" api:"required"`
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionKeyListResponse) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionKeyListResponse) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionKeyNewParams added in v0.17.0

type ProjectAnalyticsConnectionKeyNewParams struct {
	// Purpose distinguishes player ingestion, read-only API access and a separate
	// read-only MCP credential. Read and MCP keys have the same collector permissions.
	//
	// Any of "player", "read", "mcp".
	Purpose ProjectAnalyticsConnectionKeyNewParamsPurpose `json:"purpose,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (ProjectAnalyticsConnectionKeyNewParams) MarshalJSON added in v0.17.0

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

func (*ProjectAnalyticsConnectionKeyNewParams) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionKeyNewParamsPurpose added in v0.17.0

type ProjectAnalyticsConnectionKeyNewParamsPurpose string

Purpose distinguishes player ingestion, read-only API access and a separate read-only MCP credential. Read and MCP keys have the same collector permissions.

const (
	ProjectAnalyticsConnectionKeyNewParamsPurposePlayer ProjectAnalyticsConnectionKeyNewParamsPurpose = "player"
	ProjectAnalyticsConnectionKeyNewParamsPurposeRead   ProjectAnalyticsConnectionKeyNewParamsPurpose = "read"
	ProjectAnalyticsConnectionKeyNewParamsPurposeMcp    ProjectAnalyticsConnectionKeyNewParamsPurpose = "mcp"
)

type ProjectAnalyticsConnectionKeyNewResponse added in v0.17.0

type ProjectAnalyticsConnectionKeyNewResponse struct {
	// One key per purpose. Public player values remain available; read and MCP values
	// are returned only on creation or rotation.
	Data AnalyticsKey `json:"data" api:"required"`
	// Key is the new credential. Save read and MCP keys now; later reads omit their
	// values. Public keys remain available.
	Key    string           `json:"key" api:"required"`
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Key         respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionKeyNewResponse) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionKeyNewResponse) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionKeyRotateResponse added in v0.17.0

type ProjectAnalyticsConnectionKeyRotateResponse struct {
	// One key per purpose. Public player values remain available; read and MCP values
	// are returned only on creation or rotation.
	Data AnalyticsKey `json:"data" api:"required"`
	// Key is the new credential. Save read and MCP keys now; later reads omit their
	// values. Public keys remain available.
	Key    string           `json:"key" api:"required"`
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Key         respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionKeyRotateResponse) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionKeyRotateResponse) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionKeyService added in v0.17.0

type ProjectAnalyticsConnectionKeyService struct {
	Options []option.RequestOption
}

ProjectAnalyticsConnectionKeyService contains methods and other services that help with interacting with the chunkify 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 NewProjectAnalyticsConnectionKeyService method instead.

func NewProjectAnalyticsConnectionKeyService added in v0.17.0

func NewProjectAnalyticsConnectionKeyService(opts ...option.RequestOption) (r ProjectAnalyticsConnectionKeyService)

NewProjectAnalyticsConnectionKeyService 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 (*ProjectAnalyticsConnectionKeyService) List added in v0.17.0

List keys for a hosted Chunkify Analytics server: the public key used by players to send events, and read-only secret key records for dashboard and MCP access. Secret values are not returned. Requires a team owner and a Team Access Key.

func (*ProjectAnalyticsConnectionKeyService) New added in v0.17.0

Generate a public key for players to send events, or a read-only secret key for a dashboard or MCP client to query a hosted Chunkify Analytics server. Save secret keys when returned. Requires a team owner and a Team Access Key.

func (*ProjectAnalyticsConnectionKeyService) Rotate added in v0.17.0

Rotate a public or read-only secret key for a hosted Chunkify Analytics server. Update the player, dashboard, or MCP client with the new key; the old key stops working immediately. Requires a team owner and a Team Access Key.

type ProjectAnalyticsConnectionListResponse added in v0.17.0

type ProjectAnalyticsConnectionListResponse struct {
	// Saved connections in creation order.
	Data   []AnalyticsConnection `json:"data" api:"required"`
	Status constant.Success      `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionListResponse) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionListResponse) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionNewParams added in v0.17.0

type ProjectAnalyticsConnectionNewParams struct {
	// Name identifies this connection in the dashboard.
	Name string `json:"name" api:"required"`
	// Type specifies whether Chunkify manages the analytics project.
	//
	// Any of "hosted", "custom".
	Type ProjectAnalyticsConnectionNewParamsType `json:"type,omitzero" api:"required"`
	// Endpoint specifies the custom server base URL. Required for custom connections
	// and omitted for hosted connections.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// PublicIngestKey optionally enables preview tracking for a custom connection.
	// Supply the public ingestion key for the same analytics project as read_key. It
	// is returned in connection reads and used in browser code. Omit for hosted
	// connections.
	PublicIngestKey param.Opt[string] `json:"public_ingest_key,omitzero"`
	// ReadKey supplies a read-only project credential for a custom connection.
	// Required for custom connections and omitted for hosted connections. Stored
	// encrypted and never returned.
	ReadKey param.Opt[string] `json:"read_key,omitzero"`
	// contains filtered or unexported fields
}

func (ProjectAnalyticsConnectionNewParams) MarshalJSON added in v0.17.0

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

func (*ProjectAnalyticsConnectionNewParams) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionNewParamsType added in v0.17.0

type ProjectAnalyticsConnectionNewParamsType string

Type specifies whether Chunkify manages the analytics project.

const (
	ProjectAnalyticsConnectionNewParamsTypeHosted ProjectAnalyticsConnectionNewParamsType = "hosted"
	ProjectAnalyticsConnectionNewParamsTypeCustom ProjectAnalyticsConnectionNewParamsType = "custom"
)

type ProjectAnalyticsConnectionNewResponse added in v0.17.0

type ProjectAnalyticsConnectionNewResponse struct {
	// A saved source for analytics reports. The dashboard player default is
	// independent of the connection selected in reports. External players keep their
	// own configuration. Only the public ingest key is included; read and management
	// credentials stay private.
	Data   AnalyticsConnection `json:"data" api:"required"`
	Status constant.Success    `json:"status" default:"success"`
	// PublicKey is the hosted ingestion key. It remains available as public_ingest_key
	// on the connection. Omitted for custom connections.
	PublicKey string `json:"public_key"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		PublicKey   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionNewResponse) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionNewResponse) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionService added in v0.17.0

type ProjectAnalyticsConnectionService struct {
	Options []option.RequestOption
	Keys    ProjectAnalyticsConnectionKeyService
}

ProjectAnalyticsConnectionService contains methods and other services that help with interacting with the chunkify 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 NewProjectAnalyticsConnectionService method instead.

func NewProjectAnalyticsConnectionService added in v0.17.0

func NewProjectAnalyticsConnectionService(opts ...option.RequestOption) (r ProjectAnalyticsConnectionService)

NewProjectAnalyticsConnectionService 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 (*ProjectAnalyticsConnectionService) Delete added in v0.17.0

func (r *ProjectAnalyticsConnectionService) Delete(ctx context.Context, projectID string, connectionID string, opts ...option.RequestOption) (err error)

For hosted connections, delete the linked analytics project and invalidate its keys before removing the saved connection. Stored events expire under the collector retention policy. For custom connections, remove only the saved credentials and connection; the remote server, project and data remain unchanged. Only team owners can delete connections. An uncertain remote result preserves the connection for reconciliation.

func (*ProjectAnalyticsConnectionService) Get added in v0.17.0

func (r *ProjectAnalyticsConnectionService) Get(ctx context.Context, projectID string, connectionID string, opts ...option.RequestOption) (res *AnalyticsConnection, err error)

Retrieve non-secret connection metadata within its owning project.

func (*ProjectAnalyticsConnectionService) List added in v0.17.0

List the saved connections for this project. No connection is activated by this request.

func (*ProjectAnalyticsConnectionService) New added in v0.17.0

Add a hosted connection or validate and save a custom server. Only team owners can create connections. Retry a known failed hosted setup with the same name to resume its saved project; an unknown creation outcome requires operator reconciliation.

func (*ProjectAnalyticsConnectionService) Update added in v0.17.0

Rename a connection or validate replacement custom credentials. Only team owners can update connections. Existing settings remain unchanged if validation fails.

type ProjectAnalyticsConnectionUpdateParams added in v0.17.0

type ProjectAnalyticsConnectionUpdateParams struct {
	// DefaultForDashboard selects this ready connection for Chunkify dashboard
	// players, public previews, the playground and newly generated snippets. Requires
	// a public ingest key. Setting true replaces the previous default atomically.
	// Setting false disables dashboard tracking if no default remains; another
	// connection is not selected automatically. Existing external players keep their
	// own configuration.
	DefaultForDashboard param.Opt[bool] `json:"default_for_dashboard,omitzero"`
	// Endpoint specifies a replacement custom server base URL. Supply read_key
	// together with it.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Name identifies this connection in the dashboard.
	Name param.Opt[string] `json:"name,omitzero"`
	// PublicIngestKey optionally enables preview tracking for a custom connection.
	// Supply the public ingestion key for the same analytics project as read_key. It
	// is returned in connection reads and used in browser code. Omit for hosted
	// connections. An empty string disables preview tracking. A replacement endpoint
	// clears the saved public key unless a replacement is supplied.
	PublicIngestKey param.Opt[string] `json:"public_ingest_key,omitzero"`
	// ReadKey replaces the custom connection credential after validation. Its value is
	// never returned.
	ReadKey param.Opt[string] `json:"read_key,omitzero"`
	// AllowedOrigins lists additional website origins permitted to ingest events for a
	// hosted connection. Shared installation origins remain allowed. An empty list
	// clears project-specific origins. Custom servers manage origins on their own
	// infrastructure.
	AllowedOrigins []string `json:"allowed_origins,omitzero"`
	// contains filtered or unexported fields
}

func (ProjectAnalyticsConnectionUpdateParams) MarshalJSON added in v0.17.0

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

func (*ProjectAnalyticsConnectionUpdateParams) UnmarshalJSON added in v0.17.0

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

type ProjectAnalyticsConnectionUpdateResponseEnvelope added in v0.17.0

type ProjectAnalyticsConnectionUpdateResponseEnvelope struct {
	// A saved source for analytics reports. The dashboard player default is
	// independent of the connection selected in reports. External players keep their
	// own configuration. Only the public ingest key is included; read and management
	// credentials stay private.
	Data   AnalyticsConnection `json:"data" api:"required"`
	Status constant.Success    `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectAnalyticsConnectionUpdateResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ProjectAnalyticsConnectionUpdateResponseEnvelope) UnmarshalJSON added in v0.17.0

type ProjectAnalyticsService added in v0.17.0

type ProjectAnalyticsService struct {
	Options     []option.RequestOption
	Connections ProjectAnalyticsConnectionService
}

ProjectAnalyticsService contains methods and other services that help with interacting with the chunkify 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 NewProjectAnalyticsService method instead.

func NewProjectAnalyticsService added in v0.17.0

func NewProjectAnalyticsService(opts ...option.RequestOption) (r ProjectAnalyticsService)

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

type ProjectAssetDefaults added in v0.17.0

type ProjectAssetDefaults struct {
	// Delete generated and partial files from the output Storage when a new Asset
	// fails. The Asset record and original Source are preserved. Cleanup is attempted
	// once after a delay and requires delete permission on the Storage. Defaults to
	// false. Existing Assets are unchanged.
	DeleteFilesOnFailure bool `json:"delete_files_on_failure"`
	// Maximum streaming resolution. Defaults to 1080p on Hobby and 2160p on other
	// plans. 2160p requires Starter or above. Smaller sources are not upscaled. Does
	// not affect static renditions.
	//
	// Any of "1080p", "2160p".
	MaxResolution string `json:"max_resolution"`
	// Minimum streaming resolution. Defaults to auto, with no minimum. Must not exceed
	// max_resolution. Smaller sources are not upscaled. Does not affect static
	// renditions.
	//
	// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
	MinResolution string `json:"min_resolution"`
	// PathTemplate specifies the Asset output folder relative to Storage base_prefix.
	// Supports {assetID} and case-sensitive {metadata.<key>}; referenced values must
	// be non-empty. Ignored for Chunkify storage, which always uses {assetID}.
	// Defaults to {assetID}. Maximum template size: 1024 UTF-8 bytes. Expanded prefix:
	// 768 bytes including base_prefix and trailing slash.
	PathTemplate string `json:"path_template"`
	// Allow public preview access for new Assets without an API token. Defaults to
	// true. Existing Assets are unchanged.
	PreviewEnabled bool `json:"preview_enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DeleteFilesOnFailure respjson.Field
		MaxResolution        respjson.Field
		MinResolution        respjson.Field
		PathTemplate         respjson.Field
		PreviewEnabled       respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Defaults for new Assets, including Assets created from Uploads.

func (ProjectAssetDefaults) RawJSON added in v0.17.0

func (r ProjectAssetDefaults) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProjectAssetDefaults) UnmarshalJSON added in v0.17.0

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

type ProjectGetResponseEnvelope added in v0.6.0

type ProjectGetResponseEnvelope struct {
	// Data contains the response object
	Data Project `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectGetResponseEnvelope) RawJSON added in v0.6.0

func (r ProjectGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProjectGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type ProjectListResponse added in v0.6.0

type ProjectListResponse struct {
	// Data contains the project items
	Data []Project `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing the list of projects for a team

func (ProjectListResponse) RawJSON added in v0.6.0

func (r ProjectListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProjectListResponse) UnmarshalJSON added in v0.6.0

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

type ProjectNewParams added in v0.6.0

type ProjectNewParams struct {
	// Name is the name of the project, which must be between 4 and 32 characters.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (ProjectNewParams) MarshalJSON added in v0.6.0

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

func (*ProjectNewParams) UnmarshalJSON added in v0.6.0

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

type ProjectNewResponseEnvelope added in v0.6.0

type ProjectNewResponseEnvelope struct {
	// Data contains the response object
	Data Project `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProjectNewResponseEnvelope) RawJSON added in v0.6.0

func (r ProjectNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProjectNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type ProjectService added in v0.6.0

type ProjectService struct {
	Options   []option.RequestOption
	Analytics ProjectAnalyticsService
}

ProjectService contains methods and other services that help with interacting with the chunkify 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 NewProjectService method instead.

func NewProjectService added in v0.6.0

func NewProjectService(opts ...option.RequestOption) (r ProjectService)

NewProjectService 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 (*ProjectService) Delete added in v0.6.0

func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (err error)

Delete a project and revoke all associated access tokens. Only team owners can delete projects. Customer output files remain in Storage; managed temporary files retain their original expiry.

func (*ProjectService) Get added in v0.6.0

func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *Project, err error)

Retrieve details of a specific project by its slug

func (*ProjectService) List added in v0.6.0

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

Retrieve a list of all projects for a team

func (*ProjectService) New added in v0.6.0

func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)

Create a new project with the specified name. The project will be created with default Chunkify storage settings.

func (*ProjectService) Update added in v0.6.0

func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, opts ...option.RequestOption) (err error)

Update a project's name or storage settings. Only team owners can update projects.

type ProjectUpdateParams

type ProjectUpdateParams struct {
	// DefaultWorkflowId specifies the default Workflow for new Assets. Set null to
	// clear it.
	DefaultWorkflowID param.Opt[string] `json:"default_workflow_id,omitzero"`
	// Project name.
	Name param.Opt[string] `json:"name,omitzero"`
	// ID of this Project's default Storage.
	StorageID param.Opt[string] `json:"storage_id,omitzero"`
	// Defaults for new Assets and automatic Uploads. Replaces the whole object.
	// Omitted fields reset to their defaults. Existing Assets are unchanged.
	AssetDefaults ProjectUpdateParamsAssetDefaults `json:"asset_defaults,omitzero"`
	// contains filtered or unexported fields
}

func (ProjectUpdateParams) MarshalJSON added in v0.6.0

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

func (*ProjectUpdateParams) UnmarshalJSON added in v0.6.0

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

type ProjectUpdateParamsAssetDefaults added in v0.17.0

type ProjectUpdateParamsAssetDefaults struct {
	// Delete generated and partial files from the output Storage when a new Asset
	// fails. The Asset record and original Source are preserved. Cleanup is attempted
	// once after a delay and requires delete permission on the Storage. Defaults to
	// false. Existing Assets are unchanged.
	DeleteFilesOnFailure param.Opt[bool] `json:"delete_files_on_failure,omitzero"`
	// PathTemplate specifies the Asset output folder relative to Storage base_prefix.
	// Supports {assetID} and case-sensitive {metadata.<key>}; referenced values must
	// be non-empty. Ignored for Chunkify storage, which always uses {assetID}.
	// Defaults to {assetID}. Maximum template size: 1024 UTF-8 bytes. Expanded prefix:
	// 768 bytes including base_prefix and trailing slash.
	PathTemplate param.Opt[string] `json:"path_template,omitzero"`
	// Allow public preview access for new Assets without an API token. Defaults to
	// true. Existing Assets are unchanged.
	PreviewEnabled param.Opt[bool] `json:"preview_enabled,omitzero"`
	// Maximum streaming resolution. Defaults to 1080p on Hobby and 2160p on other
	// plans. 2160p requires Starter or above. Smaller sources are not upscaled. Does
	// not affect static renditions.
	//
	// Any of "1080p", "2160p".
	MaxResolution string `json:"max_resolution,omitzero"`
	// Minimum streaming resolution. Defaults to auto, with no minimum. Must not exceed
	// max_resolution. Smaller sources are not upscaled. Does not affect static
	// renditions.
	//
	// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
	MinResolution string `json:"min_resolution,omitzero"`
	// contains filtered or unexported fields
}

Defaults for new Assets and automatic Uploads. Replaces the whole object. Omitted fields reset to their defaults. Existing Assets are unchanged.

func (ProjectUpdateParamsAssetDefaults) MarshalJSON added in v0.17.0

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

func (*ProjectUpdateParamsAssetDefaults) UnmarshalJSON added in v0.17.0

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

type Source

type Source struct {
	// Unique identifier of the source
	ID string `json:"id" api:"required"`
	// Audio bitrate in bits per second
	AudioBitrate int64 `json:"audio_bitrate" api:"required"`
	// Audio codec used
	AudioCodec string `json:"audio_codec" api:"required"`
	// Timestamp when the source was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Device used to record the video
	Device string `json:"device" api:"required"`
	// Duration of the video in seconds
	Duration int64 `json:"duration" api:"required"`
	// Height of the video in pixels
	Height int64 `json:"height" api:"required"`
	// Additional metadata for the source
	Metadata map[string]string `json:"metadata" api:"required"`
	// Size of the source file in bytes
	Size int64 `json:"size" api:"required"`
	// Video bitrate in bits per second
	VideoBitrate int64 `json:"video_bitrate" api:"required"`
	// Video codec used
	VideoCodec string `json:"video_codec" api:"required"`
	// Video framerate in frames per second
	VideoFramerate float64 `json:"video_framerate" api:"required"`
	// Width of the video in pixels
	Width int64 `json:"width" api:"required"`
	// Exact object key in the configured bucket, 1 to 1024 UTF-8 bytes. The output
	// base_prefix is not added.
	Path string `json:"path"`
	// Connected Storage belonging to this Project.
	StorageID string `json:"storage_id"`
	// URL where the source video can be accessed
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		AudioBitrate   respjson.Field
		AudioCodec     respjson.Field
		CreatedAt      respjson.Field
		Device         respjson.Field
		Duration       respjson.Field
		Height         respjson.Field
		Metadata       respjson.Field
		Size           respjson.Field
		VideoBitrate   respjson.Field
		VideoCodec     respjson.Field
		VideoFramerate respjson.Field
		Width          respjson.Field
		Path           respjson.Field
		StorageID      respjson.Field
		URL            respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Source) RawJSON added in v0.6.0

func (r Source) RawJSON() string

Returns the unmodified JSON received from the API

func (*Source) UnmarshalJSON added in v0.6.0

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

type SourceGetResponseEnvelope added in v0.6.0

type SourceGetResponseEnvelope struct {
	// Data contains the response object
	Data Source `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SourceGetResponseEnvelope) RawJSON added in v0.6.0

func (r SourceGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*SourceGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type SourceListParams

type SourceListParams struct {
	// Filter by source ID
	ID param.Opt[string] `query:"id,omitzero" json:"-"`
	// Filter by audio codec
	AudioCodec param.Opt[string] `query:"audio_codec,omitzero" json:"-"`
	// Pagination limit (max 100)
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Pagination offset
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter by video codec
	VideoCodec param.Opt[string]       `query:"video_codec,omitzero" json:"-"`
	Created    SourceListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by device (apple/android)
	//
	// Any of "apple", "android", "unknown".
	Device   SourceListParamsDevice   `query:"device,omitzero" json:"-"`
	Duration SourceListParamsDuration `query:"duration,omitzero" json:"-"`
	Height   SourceListParamsHeight   `query:"height,omitzero" json:"-"`
	// Filter by metadata
	Metadata [][]string            `query:"metadata,omitzero" json:"-"`
	Size     SourceListParamsSize  `query:"size,omitzero" json:"-"`
	Width    SourceListParamsWidth `query:"width,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SourceListParams) URLQuery added in v0.6.0

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

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

type SourceListParamsCreated added in v0.6.0

type SourceListParamsCreated struct {
	// Filter by creation date greater than or equal (UNIX epoch time)
	Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
	// Sort by creation date (asc/desc)
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SourceListParamsCreated) URLQuery added in v0.6.0

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

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

type SourceListParamsDevice added in v0.6.0

type SourceListParamsDevice string

Filter by device (apple/android)

const (
	SourceListParamsDeviceApple   SourceListParamsDevice = "apple"
	SourceListParamsDeviceAndroid SourceListParamsDevice = "android"
	SourceListParamsDeviceUnknown SourceListParamsDevice = "unknown"
)

type SourceListParamsDuration added in v0.6.0

type SourceListParamsDuration struct {
	// Filter by exact duration
	Eq param.Opt[float64] `query:"eq,omitzero" json:"-"`
	// Filter by duration greater than
	Gt param.Opt[float64] `query:"gt,omitzero" json:"-"`
	// Filter by duration greater than or equal
	Gte param.Opt[float64] `query:"gte,omitzero" json:"-"`
	// Filter by duration less than
	Lt param.Opt[float64] `query:"lt,omitzero" json:"-"`
	// Filter by duration less than or equal
	Lte param.Opt[float64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SourceListParamsDuration) URLQuery added in v0.6.0

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

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

type SourceListParamsHeight added in v0.6.0

type SourceListParamsHeight struct {
	// Filter by exact height
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by height greater than
	Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
	// Filter by height greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by height less than
	Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
	// Filter by height less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SourceListParamsHeight) URLQuery added in v0.6.0

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

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

type SourceListParamsSize added in v0.6.0

type SourceListParamsSize struct {
	// Filter by exact file size
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by file size greater than
	Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
	// Filter by file size greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by file size less than
	Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
	// Filter by file size less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SourceListParamsSize) URLQuery added in v0.6.0

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

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

type SourceListParamsWidth added in v0.6.0

type SourceListParamsWidth struct {
	// Filter by exact width
	Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
	// Filter by width greater than
	Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
	// Filter by width greater than or equal
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Filter by width less than
	Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
	// Filter by width less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SourceListParamsWidth) URLQuery added in v0.6.0

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

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

type SourceNewParams added in v0.6.0

type SourceNewParams struct {
	// Url is the URL of the source, which must be a valid HTTP URL.
	URL param.Opt[string] `json:"url,omitzero" format:"http-url"`
	// Metadata allows for additional information to be attached to the source, with a
	// maximum size of 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Storage input configuration. Provide this or url, never both.
	Storage SourceNewParamsStorage `json:"storage,omitzero"`
	// contains filtered or unexported fields
}

func (SourceNewParams) MarshalJSON added in v0.6.0

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

func (*SourceNewParams) UnmarshalJSON added in v0.6.0

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

type SourceNewParamsStorage added in v0.16.3

type SourceNewParamsStorage struct {
	// Exact object key in the configured bucket, 1 to 1024 UTF-8 bytes. The output
	// base_prefix is not added.
	Path string `json:"path" api:"required"`
	// Connected external storage belonging to this project. If omitted, uses the
	// project default storage, which must be external. The resolved storage ID is
	// saved on the source.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Storage input configuration. Provide this or url, never both.

The property Path is required.

func (SourceNewParamsStorage) MarshalJSON added in v0.16.3

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

func (*SourceNewParamsStorage) UnmarshalJSON added in v0.16.3

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

type SourceNewResponseEnvelope added in v0.6.0

type SourceNewResponseEnvelope struct {
	// Data contains the response object
	Data Source `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SourceNewResponseEnvelope) RawJSON added in v0.6.0

func (r SourceNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*SourceNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type SourceService added in v0.6.0

type SourceService struct {
	Options []option.RequestOption
}

SourceService contains methods and other services that help with interacting with the chunkify 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 NewSourceService method instead.

func NewSourceService added in v0.6.0

func NewSourceService(opts ...option.RequestOption) (r SourceService)

NewSourceService 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 (*SourceService) Delete added in v0.6.0

func (r *SourceService) Delete(ctx context.Context, sourceID string, opts ...option.RequestOption) (err error)

Delete a source. It will fail if there are processing jobs using this source.

func (*SourceService) Get added in v0.6.0

func (r *SourceService) Get(ctx context.Context, sourceID string, opts ...option.RequestOption) (res *Source, err error)

Retrieve details of a specific source by its ID, including metadata, media properties, and associated jobs.

func (*SourceService) List added in v0.6.0

Retrieve a list of all sources with optional filtering and pagination. Supports filtering by various media properties like duration, dimensions, codecs, etc.

func (*SourceService) ListAutoPaging added in v0.6.0

Retrieve a list of all sources with optional filtering and pagination. Supports filtering by various media properties like duration, dimensions, codecs, etc.

func (*SourceService) New added in v0.6.0

func (r *SourceService) New(ctx context.Context, body SourceNewParams, opts ...option.RequestOption) (res *Source, err error)

Create a new source from a media URL. The source will be analyzed to extract metadata and generate a thumbnail. The source will be automatically deleted after the data retention period.

type StorageAws added in v0.6.0

type StorageAws struct {
	// Unique identifier of the storage configuration
	ID string `json:"id" api:"required"`
	// Canonical object-key prefix prepended to every final job output in this
	// customer-owned storage. An empty string means the bucket root.
	BasePrefix string `json:"base_prefix" api:"required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket" api:"required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Provider specifies the storage provider.
	Provider constant.Aws `json:"provider" default:"aws"`
	// Public indicates whether the storage is publicly accessible.
	Public bool `json:"public" api:"required"`
	// Region specifies the region of the storage provider.
	//
	// Any of "us-east-1", "us-east-2", "us-central-1", "us-west-1", "us-west-2",
	// "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "eu-north-1",
	// "ap-east-1", "ap-east-2", "ap-northeast-1", "ap-northeast-2", "ap-south-1",
	// "ap-southeast-1", "ap-southeast-2".
	Region string `json:"region" api:"required"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug" api:"required"`
	// Optional customer-managed HTTPS delivery origin used to build stable CDN URLs
	// for objects in this storage.
	CdnBaseURL string `json:"cdn_base_url" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		BasePrefix  respjson.Field
		Bucket      respjson.Field
		CreatedAt   respjson.Field
		Provider    respjson.Field
		Public      respjson.Field
		Region      respjson.Field
		Slug        respjson.Field
		CdnBaseURL  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageAws) RawJSON added in v0.6.0

func (r StorageAws) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageAws) UnmarshalJSON added in v0.6.0

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

type StorageChunkify added in v0.6.0

type StorageChunkify struct {
	// Unique identifier of the storage configuration
	ID string `json:"id" api:"required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Provider specifies the storage provider.
	Provider constant.Chunkify `json:"provider" default:"chunkify"`
	// Region specifies the region of the storage provider.
	//
	// Any of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1",
	// "eu-west-2", "ap-northeast-1", "ap-southeast-1".
	Region string `json:"region" api:"required"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Provider    respjson.Field
		Region      respjson.Field
		Slug        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageChunkify) RawJSON added in v0.6.0

func (r StorageChunkify) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageChunkify) UnmarshalJSON added in v0.6.0

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

type StorageCloudflare added in v0.6.0

type StorageCloudflare struct {
	// Unique identifier of the storage configuration
	ID string `json:"id" api:"required"`
	// Canonical object-key prefix prepended to every final job output in this
	// customer-owned storage. An empty string means the bucket root.
	BasePrefix string `json:"base_prefix" api:"required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket" api:"required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Endpoint is the endpoint of the storage provider.
	Endpoint string `json:"endpoint" api:"required" format:"uri"`
	// Location specifies the location of the storage provider.
	//
	// Any of "US", "EU", "ASIA".
	Location string `json:"location" api:"required"`
	// Provider specifies the storage provider.
	Provider constant.Cloudflare `json:"provider" default:"cloudflare"`
	// Public indicates whether the storage is publicly accessible.
	Public bool `json:"public" api:"required"`
	// Region specifies the region of the storage provider.
	Region constant.Auto `json:"region" default:"auto"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug" api:"required"`
	// Optional customer-managed HTTPS delivery origin used to build stable CDN URLs
	// for objects in this storage.
	CdnBaseURL string `json:"cdn_base_url" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		BasePrefix  respjson.Field
		Bucket      respjson.Field
		CreatedAt   respjson.Field
		Endpoint    respjson.Field
		Location    respjson.Field
		Provider    respjson.Field
		Public      respjson.Field
		Region      respjson.Field
		Slug        respjson.Field
		CdnBaseURL  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageCloudflare) RawJSON added in v0.6.0

func (r StorageCloudflare) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageCloudflare) UnmarshalJSON added in v0.6.0

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

type StorageGetResponseEnvelope added in v0.6.0

type StorageGetResponseEnvelope struct {
	// Data contains the response object
	Data StorageUnion `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageGetResponseEnvelope) RawJSON added in v0.6.0

func (r StorageGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type StorageListResponse added in v0.6.0

type StorageListResponse struct {
	// Data contains the storage items
	Data []StorageUnion `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing the list of storages configurations for a project

func (StorageListResponse) RawJSON added in v0.6.0

func (r StorageListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageListResponse) UnmarshalJSON added in v0.6.0

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

type StorageNewParams added in v0.6.0

type StorageNewParams struct {

	// This field is a request body variant, only one variant field can be set. Storage
	// parameters for AWS S3 storage.
	OfAws *StorageNewParamsStorageAws `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Storage
	// parameters for Chunkify ephemeral storage.
	OfChunkify *StorageNewParamsStorageChunkify `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Storage
	// parameters for Cloudflare R2 storage.
	OfCloudflare *StorageNewParamsStorageCloudflare `json:",inline"`
	// This field is a request body variant, only one variant field can be set. Storage
	// parameters for a public S3-compatible service such as MinIO, Wasabi, or
	// Backblaze B2.
	OfS3Compatible *StorageNewParamsStorageS3Compatible `json:",inline"`
	// contains filtered or unexported fields
}

func (StorageNewParams) MarshalJSON added in v0.6.0

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

func (*StorageNewParams) UnmarshalJSON added in v0.6.0

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

type StorageNewParamsStorageAws added in v0.6.0

type StorageNewParamsStorageAws struct {
	// AccessKeyId is the access key for the storage provider. Required if not using
	// Chunkify storage.
	AccessKeyID string `json:"access_key_id" api:"required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket" api:"required"`
	// Region specifies the region of the storage provider.
	//
	// Any of "us-east-1", "us-east-2", "us-central-1", "us-west-1", "us-west-2",
	// "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "eu-north-1",
	// "ap-east-1", "ap-east-2", "ap-northeast-1", "ap-northeast-2", "ap-south-1",
	// "ap-southeast-1", "ap-southeast-2".
	Region string `json:"region,omitzero" api:"required"`
	// SecretAccessKey is the secret key for the storage provider. Required if not
	// using Chunkify storage.
	SecretAccessKey string `json:"secret_access_key" api:"required"`
	// Optional customer-managed HTTPS delivery origin. It must not contain
	// credentials, a path, query string, or fragment.
	CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
	// Object-key prefix for final job outputs. The API normalizes it without a leading
	// slash and with one trailing slash. Omit it or send an empty string to use the
	// bucket root.
	BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
	// Public indicates whether the storage is publicly accessible.
	Public param.Opt[bool] `json:"public,omitzero"`
	// Provider specifies the storage provider.
	//
	// This field can be elided, and will marshal its zero value as "aws".
	Provider constant.Aws `json:"provider" default:"aws"`
	// contains filtered or unexported fields
}

Storage parameters for AWS S3 storage.

The properties AccessKeyID, Bucket, Provider, Region, SecretAccessKey are required.

func (StorageNewParamsStorageAws) MarshalJSON added in v0.6.0

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

func (*StorageNewParamsStorageAws) UnmarshalJSON added in v0.6.0

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

type StorageNewParamsStorageChunkify added in v0.6.0

type StorageNewParamsStorageChunkify struct {
	// Region specifies the region of the storage provider.
	//
	// Any of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1",
	// "eu-west-2", "ap-northeast-1", "ap-southeast-1".
	Region string `json:"region,omitzero" api:"required"`
	// Unsupported for Chunkify-managed temporary storage. Requests that provide this
	// field are rejected.
	CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
	// Provider specifies the storage provider.
	//
	// This field can be elided, and will marshal its zero value as "chunkify".
	Provider constant.Chunkify `json:"provider" default:"chunkify"`
	// contains filtered or unexported fields
}

Storage parameters for Chunkify ephemeral storage.

The properties Provider, Region are required.

func (StorageNewParamsStorageChunkify) MarshalJSON added in v0.6.0

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

func (*StorageNewParamsStorageChunkify) UnmarshalJSON added in v0.6.0

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

type StorageNewParamsStorageCloudflare added in v0.6.0

type StorageNewParamsStorageCloudflare struct {
	// AccessKeyId is the access key for the storage provider.
	AccessKeyID string `json:"access_key_id" api:"required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket" api:"required"`
	// Endpoint is the endpoint of the storage provider.
	Endpoint string `json:"endpoint" api:"required" format:"uri"`
	// Location specifies the location of the storage provider.
	//
	// Any of "US", "EU", "ASIA".
	Location string `json:"location,omitzero" api:"required"`
	// SecretAccessKey is the secret key for the storage provider.
	SecretAccessKey string `json:"secret_access_key" api:"required"`
	// Optional customer-managed HTTPS delivery origin. It must not contain
	// credentials, a path, query string, or fragment.
	CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
	// Object-key prefix for final job outputs. The API normalizes it without a leading
	// slash and with one trailing slash. Omit it or send an empty string to use the
	// bucket root.
	BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
	// Public indicates whether the storage is publicly accessible.
	Public param.Opt[bool] `json:"public,omitzero"`
	// Provider specifies the storage provider.
	//
	// This field can be elided, and will marshal its zero value as "cloudflare".
	Provider constant.Cloudflare `json:"provider" default:"cloudflare"`
	// Region must be set to 'auto'.
	//
	// This field can be elided, and will marshal its zero value as "auto".
	Region constant.Auto `json:"region" default:"auto"`
	// contains filtered or unexported fields
}

Storage parameters for Cloudflare R2 storage.

The properties AccessKeyID, Bucket, Endpoint, Location, Provider, Region, SecretAccessKey are required.

func (StorageNewParamsStorageCloudflare) MarshalJSON added in v0.6.0

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

func (*StorageNewParamsStorageCloudflare) UnmarshalJSON added in v0.6.0

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

type StorageNewParamsStorageS3Compatible added in v0.16.3

type StorageNewParamsStorageS3Compatible struct {
	// Access key for the storage provider.
	AccessKeyID string `json:"access_key_id" api:"required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket" api:"required"`
	// Public HTTPS origin for the S3-compatible service. Credentials, paths, queries,
	// fragments, and non-public destinations are rejected.
	Endpoint string `json:"endpoint" api:"required" format:"uri"`
	// Chunkify workload location. It controls where Chunkify processes the workload
	// and is independent from the provider region.
	//
	// Any of "US", "EU", "ASIA".
	Location string `json:"location,omitzero" api:"required"`
	// Explicit provider region used for S3 request signing. Vendor-specific
	// identifiers are accepted.
	Region string `json:"region" api:"required"`
	// Secret key for the storage provider.
	SecretAccessKey string `json:"secret_access_key" api:"required"`
	// Optional customer-managed HTTPS delivery origin. It must not contain
	// credentials, a path, query string, or fragment.
	CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
	// Object-key prefix for final job outputs. The API normalizes it without a leading
	// slash and with one trailing slash. Omit it or send an empty string to use the
	// bucket root.
	BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
	// Whether the bucket is publicly readable.
	Public param.Opt[bool] `json:"public,omitzero"`
	// Stable provider identifier for generic S3-compatible storage.
	//
	// This field can be elided, and will marshal its zero value as "s3_compatible".
	Provider constant.S3Compatible `json:"provider" default:"s3_compatible"`
	// contains filtered or unexported fields
}

Storage parameters for a public S3-compatible service such as MinIO, Wasabi, or Backblaze B2.

The properties AccessKeyID, Bucket, Endpoint, Location, Provider, Region, SecretAccessKey are required.

func (StorageNewParamsStorageS3Compatible) MarshalJSON added in v0.16.3

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

func (*StorageNewParamsStorageS3Compatible) UnmarshalJSON added in v0.16.3

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

type StorageNewResponseEnvelope added in v0.6.0

type StorageNewResponseEnvelope struct {
	// Data contains the response object
	Data StorageUnion `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (StorageNewResponseEnvelope) RawJSON added in v0.6.0

func (r StorageNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type StorageS3Compatible added in v0.16.3

type StorageS3Compatible struct {
	// Unique identifier of the storage configuration
	ID string `json:"id" api:"required"`
	// Addressing style detected during connection validation and used for later S3
	// operations.
	//
	// Any of "virtual", "path".
	AddressingStyle string `json:"addressing_style" api:"required"`
	// Canonical object-key prefix prepended to every final job output in this
	// customer-owned storage. An empty string means the bucket root.
	BasePrefix string `json:"base_prefix" api:"required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket" api:"required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Public HTTPS origin for the S3-compatible service. Credentials, paths, queries,
	// fragments, and non-public destinations are rejected.
	Endpoint string `json:"endpoint" api:"required" format:"uri"`
	// Chunkify workload location. This is independent from the provider signing
	// region.
	//
	// Any of "US", "EU", "ASIA".
	Location string `json:"location" api:"required"`
	// Stable provider identifier for generic S3-compatible storage.
	Provider constant.S3Compatible `json:"provider" default:"s3_compatible"`
	// Public indicates whether the storage is publicly accessible.
	Public bool `json:"public" api:"required"`
	// Provider region used for S3 request signing. This is independent from the
	// Chunkify workload location.
	Region string `json:"region" api:"required"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug" api:"required"`
	// Optional customer-managed HTTPS delivery origin used to build stable CDN URLs
	// for objects in this storage.
	CdnBaseURL string `json:"cdn_base_url" api:"nullable" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		AddressingStyle respjson.Field
		BasePrefix      respjson.Field
		Bucket          respjson.Field
		CreatedAt       respjson.Field
		Endpoint        respjson.Field
		Location        respjson.Field
		Provider        respjson.Field
		Public          respjson.Field
		Region          respjson.Field
		Slug            respjson.Field
		CdnBaseURL      respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A customer-owned storage connection using the standard S3 API.

func (StorageS3Compatible) RawJSON added in v0.16.3

func (r StorageS3Compatible) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageS3Compatible) UnmarshalJSON added in v0.16.3

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

type StorageService added in v0.6.0

type StorageService struct {
	Options []option.RequestOption
}

StorageService contains methods and other services that help with interacting with the chunkify 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 NewStorageService method instead.

func NewStorageService added in v0.6.0

func NewStorageService(opts ...option.RequestOption) (r StorageService)

NewStorageService 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 (*StorageService) Delete added in v0.6.0

func (r *StorageService) Delete(ctx context.Context, storageID string, opts ...option.RequestOption) (err error)

Delete a storage configuration. The storage must not be currently attached to the project.

func (*StorageService) Get added in v0.6.0

func (r *StorageService) Get(ctx context.Context, storageID string, opts ...option.RequestOption) (res *StorageUnion, err error)

Retrieve details of a specific storage configuration by its id.

func (*StorageService) List added in v0.6.0

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

Retrieve a list of all storage configurations for the current project.

func (*StorageService) New added in v0.6.0

func (r *StorageService) New(ctx context.Context, body StorageNewParams, opts ...option.RequestOption) (res *StorageUnion, err error)

Create a new storage configuration for cloud storage providers like AWS S3, Cloudflare R2, etc. The storage credentials will be validated before saving.

func (*StorageService) Update added in v0.16.2

func (r *StorageService) Update(ctx context.Context, storageID string, body StorageUpdateParams, opts ...option.RequestOption) (err error)

Update customer-owned storage settings. Send access_key_id and secret_access_key together to rotate credentials for AWS S3, Cloudflare R2, or S3-compatible storage. Both values must be non-empty and non-null. Omitting both preserves the saved pair and skips connection validation. Replacement credentials are checked against the saved bucket, endpoint, region, and addressing style using the creation upload, metadata, and download checks with best-effort probe cleanup. A prefix changed in the same request is used for validation. Both credentials are encrypted and saved atomically with other settings; a failed update preserves the previous values. Credential-only updates keep the Storage ID, resource associations, object paths, and Project default. Subsequent storage lookups use the new pair; running work may retain an existing client or signed URL. Rotation does not renew issued URLs, and revoking old keys can invalidate them. Prefix changes apply to final outputs that have not been uploaded yet. Existing files keep their stored object keys.

type StorageUnion added in v0.6.0

type StorageUnion struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"created_at"`
	// Any of "chunkify", "cloudflare", "aws", "s3_compatible".
	Provider   string `json:"provider"`
	Region     string `json:"region"`
	Slug       string `json:"slug"`
	BasePrefix string `json:"base_prefix"`
	Bucket     string `json:"bucket"`
	Endpoint   string `json:"endpoint"`
	Location   string `json:"location"`
	Public     bool   `json:"public"`
	CdnBaseURL string `json:"cdn_base_url"`
	// This field is from variant [StorageS3Compatible].
	AddressingStyle string `json:"addressing_style"`
	JSON            struct {
		ID              respjson.Field
		CreatedAt       respjson.Field
		Provider        respjson.Field
		Region          respjson.Field
		Slug            respjson.Field
		BasePrefix      respjson.Field
		Bucket          respjson.Field
		Endpoint        respjson.Field
		Location        respjson.Field
		Public          respjson.Field
		CdnBaseURL      respjson.Field
		AddressingStyle respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

StorageUnion contains all possible properties and values from StorageChunkify, StorageCloudflare, StorageAws, StorageS3Compatible.

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

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

func (StorageUnion) AsAny added in v0.6.0

func (u StorageUnion) AsAny() anyStorage

Use the following switch statement to find the correct variant

switch variant := StorageUnion.AsAny().(type) {
case chunkify.StorageChunkify:
case chunkify.StorageCloudflare:
case chunkify.StorageAws:
case chunkify.StorageS3Compatible:
default:
  fmt.Errorf("no variant present")
}

func (StorageUnion) AsAws added in v0.6.0

func (u StorageUnion) AsAws() (v StorageAws)

func (StorageUnion) AsChunkify added in v0.6.0

func (u StorageUnion) AsChunkify() (v StorageChunkify)

func (StorageUnion) AsCloudflare added in v0.6.0

func (u StorageUnion) AsCloudflare() (v StorageCloudflare)

func (StorageUnion) AsS3Compatible added in v0.16.3

func (u StorageUnion) AsS3Compatible() (v StorageS3Compatible)

func (StorageUnion) RawJSON added in v0.6.0

func (u StorageUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*StorageUnion) UnmarshalJSON added in v0.6.0

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

type StorageUpdateParams added in v0.16.2

type StorageUpdateParams struct {
	// Customer-managed HTTPS delivery origin, or null to remove the current value.
	CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
	// Replacement access key ID for customer-managed storage. Send with a non-empty
	// secret_access_key. Omit both credential fields to keep the saved pair. Null and
	// empty values are rejected. Credentials are validated before either value is
	// saved and are never returned.
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	// Object-key prefix for future final job outputs. Existing files keep their stored
	// object keys. Send an empty string to use the bucket root.
	BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
	// Replacement secret access key. Required with access_key_id; cannot be null or
	// empty. The pair is encrypted and saved atomically only after validation
	// succeeds.
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	// contains filtered or unexported fields
}

func (StorageUpdateParams) MarshalJSON added in v0.16.2

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

func (*StorageUpdateParams) UnmarshalJSON added in v0.16.2

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

type Thumbnail added in v0.17.0

type Thumbnail struct {
	// Id identifies this thumbnail request. Standalone requests use thm* IDs;
	// Asset-owned outputs use aop* IDs.
	ID string `json:"id" api:"required"`
	// AssetId identifies the owning Asset for Workflow outputs, or null for standalone
	// requests.
	AssetID string `json:"asset_id" api:"required"`
	// CreatedAt records when the request was accepted.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Files contains all published images or sheets and the WebVTT index. Empty while
	// preparing.
	Files []ThumbnailFile `json:"files" api:"required"`
	// Metadata contains the accepted string metadata.
	Metadata map[string]string `json:"metadata" api:"required"`
	// Samples contains published thumbnails ordered by timestamp. Empty while
	// preparing. A ready resource may contain fewer samples than requested.
	Samples []ThumbnailSample `json:"samples" api:"required"`
	// Settings contains the accepted sampling and output settings.
	Settings ThumbnailSettings `json:"settings" api:"required"`
	// SourceId identifies the input Source, or null if it has been deleted.
	SourceID string `json:"source_id" api:"required"`
	// Status reports processing or output expiry.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status ThumbnailStatus `json:"status" api:"required"`
	// StorageId identifies the accepted output Storage.
	StorageID string `json:"storage_id" api:"required"`
	// StoragePath specifies the accepted filename template relative to the Storage
	// base_prefix, or null when Chunkify generated the file names.
	StoragePath string `json:"storage_path" api:"required"`
	// StoragePrefix specifies the complete output folder saved at creation. File and
	// sample paths are relative to this folder.
	StoragePrefix string `json:"storage_prefix" api:"required"`
	// UpdatedAt records the last lifecycle update.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// CreatedByTokenId specifies the Project token used to create the resource. It
	// remains set after the token is revoked. Omitted for dashboard requests, MCP
	// OAuth connections, Workflow actions, and unknown creators.
	CreatedByTokenID string `json:"created_by_token_id"`
	// CreatedByUserId specifies the team member who created the resource. Omitted for
	// Workflow actions, unknown creators, and deleted accounts.
	CreatedByUserID string `json:"created_by_user_id"`
	// CreatedVia specifies how the resource was created: api for API requests,
	// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
	// Workflow actions. Omitted when the creator is unknown.
	//
	// Any of "api", "dashboard", "mcp", "workflow".
	CreatedVia ThumbnailCreatedVia `json:"created_via"`
	// DeleteAt specifies when this standalone request is deleted: three days after its
	// temporary output expires, otherwise when the team's data retention period ends,
	// counted from when the request was accepted, and no sooner than three days after
	// it finished. It does not delete files in customer-owned Storage. Omitted while
	// preparing and for Asset-owned thumbnails, which follow their Asset.
	DeleteAt time.Time `json:"delete_at" format:"date-time"`
	// Error explains a failed request. Omitted otherwise.
	Error ThumbnailError `json:"error"`
	// ExpiresAt specifies when temporary output files expire. Omitted for customer
	// output Storage.
	ExpiresAt time.Time `json:"expires_at" format:"date-time"`
	// ReadyAt records when the complete available set was published. Omitted before
	// publication.
	ReadyAt time.Time `json:"ready_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		AssetID          respjson.Field
		CreatedAt        respjson.Field
		Files            respjson.Field
		Metadata         respjson.Field
		Samples          respjson.Field
		Settings         respjson.Field
		SourceID         respjson.Field
		Status           respjson.Field
		StorageID        respjson.Field
		StoragePath      respjson.Field
		StoragePrefix    respjson.Field
		UpdatedAt        respjson.Field
		CreatedByTokenID respjson.Field
		CreatedByUserID  respjson.Field
		CreatedVia       respjson.Field
		DeleteAt         respjson.Field
		Error            respjson.Field
		ExpiresAt        respjson.Field
		ReadyAt          respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One thumbnail generation request. At least one sample and its companion files must be published before the resource is ready.

func (Thumbnail) RawJSON added in v0.17.0

func (r Thumbnail) RawJSON() string

Returns the unmodified JSON received from the API

func (*Thumbnail) UnmarshalJSON added in v0.17.0

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

type ThumbnailCreateStorageParam added in v0.17.0

type ThumbnailCreateStorageParam struct {
	// Id identifies output Storage in this Project. Omit to use the Project default.
	ID param.Opt[string] `json:"id,omitzero"`
	// Path specifies the output filename template relative to the selected Storage
	// base_prefix. Required for customer storage; generated for Chunkify temporary
	// storage. The filename must contain one %05d placeholder, replaced by the image
	// or sprite sheet number starting at 1, and end in .jpg for jpeg or .webp for
	// webp. The WebVTT file uses the filename without the placeholder and its adjacent
	// separator, such as thumb.vtt for thumb-%05d.jpg. The combined path may contain
	// at most 1024 bytes.
	Path param.Opt[string] `json:"path,omitzero"`
	// contains filtered or unexported fields
}

Output Storage selection, independent of Source storage.

func (ThumbnailCreateStorageParam) MarshalJSON added in v0.17.0

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

func (*ThumbnailCreateStorageParam) UnmarshalJSON added in v0.17.0

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

type ThumbnailCreatedVia added in v0.17.0

type ThumbnailCreatedVia string

CreatedVia specifies how the resource was created: api for API requests, dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for Workflow actions. Omitted when the creator is unknown.

const (
	ThumbnailCreatedViaAPI       ThumbnailCreatedVia = "api"
	ThumbnailCreatedViaDashboard ThumbnailCreatedVia = "dashboard"
	ThumbnailCreatedViaMcp       ThumbnailCreatedVia = "mcp"
	ThumbnailCreatedViaWorkflow  ThumbnailCreatedVia = "workflow"
)

type ThumbnailDeleteParams added in v0.17.0

type ThumbnailDeleteParams struct {
	// DeleteFiles specifies whether to permanently delete this Thumbnail's owned
	// images, sprite sheets, VTT and partial outputs at their saved storage prefix.
	// Defaults to false. The Source and unrelated files are preserved. If deletion
	// fails, records remain for retry, but some files may already be deleted.
	// Temporary outputs still expire when this option is false.
	DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ThumbnailDeleteParams) URLQuery added in v0.17.0

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

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

type ThumbnailError added in v0.17.0

type ThumbnailError struct {
	// Code identifies the processing failure.
	Code string `json:"code" api:"required"`
	// Message explains the processing failure.
	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 explains a failed request. Omitted otherwise.

func (ThumbnailError) RawJSON added in v0.17.0

func (r ThumbnailError) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThumbnailError) UnmarshalJSON added in v0.17.0

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

type ThumbnailFile added in v0.17.0

type ThumbnailFile struct {
	// Kind identifies an individual image, sprite sheet, or WebVTT index.
	//
	// Any of "image", "sprite", "vtt".
	Kind string `json:"kind" api:"required"`
	// Path specifies the file relative to storage_prefix.
	Path string `json:"path" api:"required"`
	// Size specifies the measured encoded file size in bytes.
	Size int64 `json:"size" api:"required"`
	// CdnUrl provides delivery through the configured CDN. Omitted without a CDN or
	// after expiry.
	CdnURL string `json:"cdn_url"`
	// Height specifies the measured image or complete sprite canvas height. Omitted
	// for WebVTT.
	Height int64 `json:"height"`
	// Url provides temporary authorized delivery. Omitted after expiry or when
	// unavailable.
	URL string `json:"url"`
	// Width specifies the measured image or complete sprite canvas width. Omitted for
	// WebVTT.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Kind        respjson.Field
		Path        respjson.Field
		Size        respjson.Field
		CdnURL      respjson.Field
		Height      respjson.Field
		URL         respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One published image, sprite sheet, or WebVTT file.

func (ThumbnailFile) RawJSON added in v0.17.0

func (r ThumbnailFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThumbnailFile) UnmarshalJSON added in v0.17.0

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

type ThumbnailGetResponseEnvelope added in v0.17.0

type ThumbnailGetResponseEnvelope struct {
	// Data contains the thumbnail resource.
	Data Thumbnail `json:"data" api:"required"`
	// Status is success for a successful request.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A thumbnail resource response.

func (ThumbnailGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ThumbnailGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type ThumbnailListParams added in v0.17.0

type ThumbnailListParams struct {
	// Id filters by an exact Thumbnail ID. Omit to include all matching resources.
	ID param.Opt[string] `query:"id,omitzero" json:"-"`
	// Maximum number of Thumbnails to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of Thumbnails to skip.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter Thumbnails linked to this Source. Omit to include Thumbnails from all
	// Sources in the Project.
	SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
	// Filter by output Storage ID.
	StorageID param.Opt[string]          `query:"storage_id,omitzero" json:"-"`
	Created   ThumbnailListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by Thumbnail status.
	//
	// Any of "preparing", "ready", "failed", "expired".
	Status ThumbnailListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ThumbnailListParams) URLQuery added in v0.17.0

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

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

type ThumbnailListParamsCreated added in v0.17.0

type ThumbnailListParamsCreated struct {
	// Created at or after this Unix timestamp in seconds.
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Created at or before this Unix timestamp in seconds.
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// Creation-time ordering. Defaults to newest first.
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ThumbnailListParamsCreated) URLQuery added in v0.17.0

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

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

type ThumbnailListParamsStatus added in v0.17.0

type ThumbnailListParamsStatus string

Filter by Thumbnail status.

const (
	ThumbnailListParamsStatusPreparing ThumbnailListParamsStatus = "preparing"
	ThumbnailListParamsStatusReady     ThumbnailListParamsStatus = "ready"
	ThumbnailListParamsStatusFailed    ThumbnailListParamsStatus = "failed"
	ThumbnailListParamsStatusExpired   ThumbnailListParamsStatus = "expired"
)

type ThumbnailNewParams added in v0.17.0

type ThumbnailNewParams struct {
	// SourceId identifies a video Source in this Project.
	SourceID string `json:"source_id" api:"required"`
	// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
	// selected range.
	Count param.Opt[int64] `json:"count,omitzero"`
	// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
	// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
	// cropping or upscaling.
	Size param.Opt[int64] `json:"size,omitzero"`
	// Format selects JPEG or WebP. Defaults to JPEG.
	//
	// Any of "jpeg", "webp".
	Format ThumbnailNewParamsFormat `json:"format,omitzero"`
	// Metadata attaches string values to this request. The serialized object may
	// contain at most 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Output selects images or sprites. Defaults to images.
	//
	// Any of "images", "sprites".
	Output ThumbnailNewParamsOutput `json:"output,omitzero"`
	// Range limits sampling to part of the Source. Defaults to the whole Source
	// duration.
	Range ThumbnailNewParamsRange `json:"range,omitzero"`
	// Storage overrides the Project output destination and names the output files.
	// Source storage remains independent.
	Storage ThumbnailCreateStorageParam `json:"storage,omitzero"`
	// Timestamps specifies 1 to 100 Source-relative target times in seconds. Every
	// time must be within the selected range. Repeated targets produce separate
	// outputs.
	Timestamps []float64 `json:"timestamps,omitzero"`
	// contains filtered or unexported fields
}

func (ThumbnailNewParams) MarshalJSON added in v0.17.0

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

func (*ThumbnailNewParams) UnmarshalJSON added in v0.17.0

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

type ThumbnailNewParamsFormat added in v0.17.0

type ThumbnailNewParamsFormat string

Format selects JPEG or WebP. Defaults to JPEG.

const (
	ThumbnailNewParamsFormatJpeg ThumbnailNewParamsFormat = "jpeg"
	ThumbnailNewParamsFormatWebp ThumbnailNewParamsFormat = "webp"
)

type ThumbnailNewParamsOutput added in v0.17.0

type ThumbnailNewParamsOutput string

Output selects images or sprites. Defaults to images.

const (
	ThumbnailNewParamsOutputImages  ThumbnailNewParamsOutput = "images"
	ThumbnailNewParamsOutputSprites ThumbnailNewParamsOutput = "sprites"
)

type ThumbnailNewParamsRange added in v0.17.0

type ThumbnailNewParamsRange struct {
	// End specifies the exclusive upper bound in seconds. Defaults to the Source
	// duration.
	End param.Opt[float64] `json:"end,omitzero"`
	// Start specifies the inclusive lower bound in seconds. Defaults to zero.
	Start param.Opt[float64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

Range limits sampling to part of the Source. Defaults to the whole Source duration.

func (ThumbnailNewParamsRange) MarshalJSON added in v0.17.0

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

func (*ThumbnailNewParamsRange) UnmarshalJSON added in v0.17.0

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

type ThumbnailNewResponseEnvelope added in v0.17.0

type ThumbnailNewResponseEnvelope struct {
	// Data contains the thumbnail resource.
	Data Thumbnail `json:"data" api:"required"`
	// Status is success for a successful request.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A thumbnail resource response.

func (ThumbnailNewResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*ThumbnailNewResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type ThumbnailSample added in v0.17.0

type ThumbnailSample struct {
	// Height specifies this image or tile height in pixels.
	Height int64 `json:"height" api:"required"`
	// Path identifies the image or sprite sheet in files.
	Path string `json:"path" api:"required"`
	// Timestamp specifies the measured Source-relative presentation time of the
	// selected frame in seconds. Compatible cached inputs use millisecond timestamps,
	// which can select a neighboring frame compared with the original Source.
	Timestamp float64 `json:"timestamp" api:"required"`
	// Width specifies this image or tile width in pixels.
	Width int64 `json:"width" api:"required"`
	// Crop specifies the tile origin in its sprite sheet. Omitted for individual
	// images; width and height give the tile dimensions.
	Crop ThumbnailSampleCrop `json:"crop"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Height      respjson.Field
		Path        respjson.Field
		Timestamp   respjson.Field
		Width       respjson.Field
		Crop        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One successfully published requested sample. Repeated samples remain separate entries.

func (ThumbnailSample) RawJSON added in v0.17.0

func (r ThumbnailSample) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThumbnailSample) UnmarshalJSON added in v0.17.0

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

type ThumbnailSampleCrop added in v0.17.0

type ThumbnailSampleCrop struct {
	// X specifies the left edge in pixels.
	X int64 `json:"x" api:"required"`
	// Y specifies the top edge in pixels.
	Y int64 `json:"y" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		X           respjson.Field
		Y           respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Crop specifies the tile origin in its sprite sheet. Omitted for individual images; width and height give the tile dimensions.

func (ThumbnailSampleCrop) RawJSON added in v0.17.0

func (r ThumbnailSampleCrop) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThumbnailSampleCrop) UnmarshalJSON added in v0.17.0

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

type ThumbnailService added in v0.17.0

type ThumbnailService struct {
	Options []option.RequestOption
}

ThumbnailService contains methods and other services that help with interacting with the chunkify 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 NewThumbnailService method instead.

func NewThumbnailService added in v0.17.0

func NewThumbnailService(opts ...option.RequestOption) (r ThumbnailService)

NewThumbnailService 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 (*ThumbnailService) Delete added in v0.17.0

func (r *ThumbnailService) Delete(ctx context.Context, thumbnailID string, body ThumbnailDeleteParams, opts ...option.RequestOption) (err error)

Delete a ready, failed or expired Thumbnail after all workers have stopped. The Source and settled usage are preserved. Files remain unless delete_files is true; temporary files retain their original 24-hour expiry. Deletion remains available for inactive teams.

func (*ThumbnailService) Get added in v0.17.0

func (r *ThumbnailService) Get(ctx context.Context, thumbnailID string, opts ...option.RequestOption) (res *Thumbnail, err error)

Retrieve the accepted settings, published files and current state of one Thumbnail.

func (*ThumbnailService) List added in v0.17.0

List Thumbnails in the authenticated Project, newest first by default.

func (*ThumbnailService) ListAutoPaging added in v0.17.0

List Thumbnails in the authenticated Project, newest first by default.

func (*ThumbnailService) New added in v0.17.0

func (r *ThumbnailService) New(ctx context.Context, body ThumbnailNewParams, opts ...option.RequestOption) (res *Thumbnail, err error)

Generate individual images or sprite sheets from a Source. Each accepted request creates a new resource. Processing continues after the response.

type ThumbnailSettings added in v0.17.0

type ThumbnailSettings struct {
	// Format specifies the accepted image encoding.
	//
	// Any of "jpeg", "webp".
	Format string `json:"format" api:"required"`
	// Output specifies the accepted output mode.
	//
	// Any of "images", "sprites".
	Output string `json:"output" api:"required"`
	// Range contains the accepted sampling boundaries.
	Range ThumbnailSettingsRange `json:"range" api:"required"`
	// Size specifies the accepted maximum image or tile edge in pixels.
	Size int64 `json:"size" api:"required"`
	// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
	// selected range.
	Count int64 `json:"count"`
	// Timestamps specifies 1 to 100 Source-relative target times in seconds. Every
	// time must be within the selected range. Repeated targets produce separate
	// outputs.
	Timestamps []float64 `json:"timestamps"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Format      respjson.Field
		Output      respjson.Field
		Range       respjson.Field
		Size        respjson.Field
		Count       respjson.Field
		Timestamps  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Settings contains the accepted sampling and output settings.

func (ThumbnailSettings) RawJSON added in v0.17.0

func (r ThumbnailSettings) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThumbnailSettings) UnmarshalJSON added in v0.17.0

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

type ThumbnailSettingsRange added in v0.17.0

type ThumbnailSettingsRange struct {
	// End specifies the exclusive upper bound in seconds.
	End float64 `json:"end" api:"required"`
	// Start specifies the inclusive lower bound in seconds.
	Start float64 `json:"start" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Range contains the accepted sampling boundaries.

func (ThumbnailSettingsRange) RawJSON added in v0.17.0

func (r ThumbnailSettingsRange) RawJSON() string

Returns the unmodified JSON received from the API

func (*ThumbnailSettingsRange) UnmarshalJSON added in v0.17.0

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

type ThumbnailStatus added in v0.17.0

type ThumbnailStatus string

Status reports processing or output expiry.

const (
	ThumbnailStatusPreparing ThumbnailStatus = "preparing"
	ThumbnailStatusReady     ThumbnailStatus = "ready"
	ThumbnailStatusFailed    ThumbnailStatus = "failed"
	ThumbnailStatusExpired   ThumbnailStatus = "expired"
)

type Token

type Token struct {
	// Unique identifier of the token
	ID string `json:"id" api:"required"`
	// The actual token value (only returned on creation)
	Token string `json:"token" api:"required"`
	// Timestamp when the token was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Name given to the token
	Name string `json:"name" api:"required"`
	// ID of the project this token belongs to
	ProjectID string `json:"project_id" api:"required"`
	// Access scope of the token
	//
	// Any of "project", "team".
	Scope TokenScope `json:"scope" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Token       respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		ProjectID   respjson.Field
		Scope       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Token) RawJSON added in v0.6.0

func (r Token) RawJSON() string

Returns the unmodified JSON received from the API

func (*Token) UnmarshalJSON added in v0.6.0

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

type TokenListResponse added in v0.6.0

type TokenListResponse struct {
	// Data contains the token items
	Data []Token `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing the list of all tokens for a team. Including project and team tokens.

func (TokenListResponse) RawJSON added in v0.6.0

func (r TokenListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*TokenListResponse) UnmarshalJSON added in v0.6.0

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

type TokenNewParams added in v0.6.0

type TokenNewParams struct {
	// Scope specifies the scope of the token, which must be either "team" or
	// "project".
	//
	// Any of "project", "team".
	Scope TokenNewParamsScope `json:"scope,omitzero" api:"required"`
	// Name is the name of the token, which can be up to 64 characters long.
	Name param.Opt[string] `json:"name,omitzero"`
	// ProjectId is required if the scope is set to "project".
	ProjectID param.Opt[string] `json:"project_id,omitzero"`
	// contains filtered or unexported fields
}

func (TokenNewParams) MarshalJSON added in v0.6.0

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

func (*TokenNewParams) UnmarshalJSON added in v0.6.0

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

type TokenNewParamsScope added in v0.6.0

type TokenNewParamsScope string

Scope specifies the scope of the token, which must be either "team" or "project".

const (
	TokenNewParamsScopeProject TokenNewParamsScope = "project"
	TokenNewParamsScopeTeam    TokenNewParamsScope = "team"
)

type TokenNewResponseEnvelope added in v0.6.0

type TokenNewResponseEnvelope struct {
	// Data contains the response object
	Data Token `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TokenNewResponseEnvelope) RawJSON added in v0.6.0

func (r TokenNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*TokenNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type TokenScope added in v0.6.0

type TokenScope string

Access scope of the token

const (
	TokenScopeProject TokenScope = "project"
	TokenScopeTeam    TokenScope = "team"
)

type TokenService added in v0.6.0

type TokenService struct {
	Options []option.RequestOption
}

TokenService contains methods and other services that help with interacting with the chunkify API.

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

func NewTokenService added in v0.6.0

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

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

func (*TokenService) List added in v0.6.0

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

Retrieve a list of all API tokens for your account, including both team-scoped and project-scoped tokens. For each token, the response includes its name, scope, creation date, and usage statistics. The token values are not included in the response for security reasons.

func (*TokenService) New added in v0.6.0

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

Create a new access token for either account-wide or project-specific access. Project tokens require a valid project slug.

func (*TokenService) Revoke added in v0.6.0

func (r *TokenService) Revoke(ctx context.Context, tokenID string, opts ...option.RequestOption) (err error)

Revoke an access token by its ID. This action is irreversible and will immediately invalidate the token.

type Transcoding added in v0.17.0

type Transcoding struct {
	// Id uniquely identifies the Transcoding.
	ID string `json:"id" api:"required"`
	// CreatedAt specifies when the request was accepted.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Files contains the published output files and their measured properties, ordered
	// by creation time. Empty until publication. Presigned URLs are refreshed on each
	// read and included in lifecycle webhooks when available.
	Files []TranscodingFile `json:"files" api:"required"`
	// Format contains the resolved encoding settings accepted at creation, including
	// defaults, dimensions, frame rate and normalized seek and duration. Per-title
	// rate control is resolved during processing. Measured media properties are
	// available in Files.
	Format TranscodingFormat `json:"format" api:"required"`
	// Metadata contains the string values attached to the Transcoding.
	Metadata map[string]string `json:"metadata" api:"required"`
	// Status reports processing or output expiry.
	//
	// Any of "preparing", "ready", "failed", "cancelled", "expired".
	Status TranscodingStatus `json:"status" api:"required"`
	// Storage contains the resolved output destination.
	Storage TranscodingStorage `json:"storage" api:"required"`
	// UpdatedAt specifies when the request was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// CreatedByTokenId specifies the Project token used to create the resource. It
	// remains set after the token is revoked. Omitted for dashboard requests, MCP
	// OAuth connections, Workflow actions, and unknown creators.
	CreatedByTokenID string `json:"created_by_token_id"`
	// CreatedByUserId specifies the team member who created the resource. Omitted for
	// Workflow actions, unknown creators, and deleted accounts.
	CreatedByUserID string `json:"created_by_user_id"`
	// CreatedVia specifies how the resource was created: api for API requests,
	// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
	// Workflow actions. Omitted when the creator is unknown.
	//
	// Any of "api", "dashboard", "mcp", "workflow".
	CreatedVia TranscodingCreatedVia `json:"created_via"`
	// DeleteAt specifies when this record is deleted: three days after its temporary
	// output expires, otherwise when the team's data retention period ends, counted
	// from when the request was accepted, and no sooner than three days after it
	// finished. It does not delete files in customer-owned Storage. Omitted while the
	// Transcoding is preparing.
	DeleteAt time.Time `json:"delete_at" format:"date-time"`
	// Error describes why processing failed. Omitted when no processing error exists.
	Error TranscodingError `json:"error"`
	// ExpiresAt specifies when temporary output files expire. Omitted for customer
	// output Storage and before the Transcoding is ready.
	ExpiresAt time.Time `json:"expires_at" format:"date-time"`
	// ProcessingStage specifies the current activity while the status is preparing.
	// Omitted otherwise.
	//
	// Any of "queued", "starting", "encoding", "finalizing", "uploading".
	ProcessingStage TranscodingProcessingStage `json:"processing_stage"`
	// Progress specifies the video encoding percentage. Available once processing
	// starts and after the output is ready. Omitted for audio-only output; 100
	// requires published output.
	Progress float64 `json:"progress"`
	// ReadyAt specifies when the output was published. Omitted before the Transcoding
	// is ready.
	ReadyAt time.Time `json:"ready_at" format:"date-time"`
	// SourceId identifies the original Source. Omitted after Source deletion.
	SourceID string `json:"source_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		Files            respjson.Field
		Format           respjson.Field
		Metadata         respjson.Field
		Status           respjson.Field
		Storage          respjson.Field
		UpdatedAt        respjson.Field
		CreatedByTokenID respjson.Field
		CreatedByUserID  respjson.Field
		CreatedVia       respjson.Field
		DeleteAt         respjson.Field
		Error            respjson.Field
		ExpiresAt        respjson.Field
		ProcessingStage  respjson.Field
		Progress         respjson.Field
		ReadyAt          respjson.Field
		SourceID         respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A standalone file-encoding request with its accepted settings and published files.

func (Transcoding) RawJSON added in v0.17.0

func (r Transcoding) RawJSON() string

Returns the unmodified JSON received from the API

func (*Transcoding) UnmarshalJSON added in v0.17.0

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

type TranscodingCreatedVia added in v0.17.0

type TranscodingCreatedVia string

CreatedVia specifies how the resource was created: api for API requests, dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for Workflow actions. Omitted when the creator is unknown.

const (
	TranscodingCreatedViaAPI       TranscodingCreatedVia = "api"
	TranscodingCreatedViaDashboard TranscodingCreatedVia = "dashboard"
	TranscodingCreatedViaMcp       TranscodingCreatedVia = "mcp"
	TranscodingCreatedViaWorkflow  TranscodingCreatedVia = "workflow"
)

type TranscodingDeleteParams added in v0.17.0

type TranscodingDeleteParams struct {
	// DeleteFiles specifies whether to permanently delete this Transcoding's output
	// files at their saved storage paths. Defaults to false. The original Source and
	// unrelated files are preserved. If deletion fails, records remain for retry, but
	// some files may already be deleted. Managed dashboard images are removed with the
	// resource; temporary outputs still expire after 24 hours when this option is
	// false.
	DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (TranscodingDeleteParams) URLQuery added in v0.17.0

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

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

type TranscodingError added in v0.17.0

type TranscodingError struct {
	// Code identifies the processing failure.
	Code string `json:"code" api:"required"`
	// Message describes the failure without internal worker or provider diagnostics.
	Message string `json:"message" api:"required"`
	// Stage identifies where processing failed.
	//
	// Any of "queued", "starting", "encoding", "finalizing", "uploading".
	Stage string `json:"stage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		Stage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error describes why processing failed. Omitted when no processing error exists.

func (TranscodingError) RawJSON added in v0.17.0

func (r TranscodingError) RawJSON() string

Returns the unmodified JSON received from the API

func (*TranscodingError) UnmarshalJSON added in v0.17.0

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

type TranscodingFile added in v0.17.0

type TranscodingFile struct {
	// Id identifies this published Transcoding file.
	ID string `json:"id" api:"required"`
	// CreatedAt records when the validated file was published.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Duration specifies the measured output duration in seconds.
	Duration float64 `json:"duration" api:"required"`
	// MimeType specifies the media content type.
	MimeType string `json:"mime_type" api:"required"`
	// Path specifies the output path relative to the Storage base_prefix saved when
	// the Transcoding was created. Later Storage prefix changes do not move this file.
	Path string `json:"path" api:"required"`
	// Size specifies the measured file size in bytes.
	Size int64 `json:"size" api:"required"`
	// StorageId identifies the output Storage.
	StorageID string `json:"storage_id" api:"required"`
	// Thumbnails contains available dashboard preview images. Empty for audio-only
	// files, failed previews or expired files.
	Thumbnails []TranscodingFileThumbnail `json:"thumbnails" api:"required"`
	// TranscodingId identifies the Transcoding that produced this file.
	TranscodingID string `json:"transcoding_id" api:"required"`
	// AudioBitrate specifies measured audio bits per second, or zero when unavailable.
	// Omitted without audio.
	AudioBitrate int64 `json:"audio_bitrate"`
	// AudioCodec specifies the measured audio codec. Omitted without audio.
	AudioCodec string `json:"audio_codec"`
	// AudioSamplerate specifies measured audio samples per second. Omitted without
	// audio.
	AudioSamplerate int64 `json:"audio_samplerate"`
	// CdnUrl provides the URL from the Storage CDN configuration. Omitted without a
	// configured CDN or after file expiry.
	CdnURL string `json:"cdn_url"`
	// ExpiresAt specifies when a temporary output expires. Omitted for customer-owned
	// output storage.
	ExpiresAt time.Time `json:"expires_at" format:"date-time"`
	// Height specifies the measured video height in pixels. Omitted for audio-only
	// files.
	Height int64 `json:"height"`
	// ThumbnailStatus reports the optional dashboard preview result. Failure does not
	// affect the media file. Omitted for audio-only files.
	//
	// Any of "ready", "failed".
	ThumbnailStatus string `json:"thumbnail_status"`
	// Url provides a signed download valid for at most ten minutes. Omitted when the
	// file has expired or signing is unavailable.
	URL string `json:"url"`
	// VideoBitrate specifies measured video bits per second, or zero when unavailable.
	// Omitted without video.
	VideoBitrate int64 `json:"video_bitrate"`
	// VideoCodec specifies the measured video codec. Omitted for audio-only files.
	VideoCodec string `json:"video_codec"`
	// VideoFramerate specifies measured video frames per second. Omitted without
	// video.
	VideoFramerate float64 `json:"video_framerate"`
	// Width specifies the measured video width in pixels. Omitted for audio-only
	// files.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CreatedAt       respjson.Field
		Duration        respjson.Field
		MimeType        respjson.Field
		Path            respjson.Field
		Size            respjson.Field
		StorageID       respjson.Field
		Thumbnails      respjson.Field
		TranscodingID   respjson.Field
		AudioBitrate    respjson.Field
		AudioCodec      respjson.Field
		AudioSamplerate respjson.Field
		CdnURL          respjson.Field
		ExpiresAt       respjson.Field
		Height          respjson.Field
		ThumbnailStatus respjson.Field
		URL             respjson.Field
		VideoBitrate    respjson.Field
		VideoCodec      respjson.Field
		VideoFramerate  respjson.Field
		Width           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A validated media file published by a Transcoding.

func (TranscodingFile) RawJSON added in v0.17.0

func (r TranscodingFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*TranscodingFile) UnmarshalJSON added in v0.17.0

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

type TranscodingFileThumbnail added in v0.17.0

type TranscodingFileThumbnail struct {
	// Format specifies the image encoding.
	//
	// Any of "jpeg", "webp".
	Format string `json:"format" api:"required"`
	// Height specifies the measured image height in pixels.
	Height int64 `json:"height" api:"required"`
	// Size specifies the measured image size in bytes.
	Size int64 `json:"size" api:"required"`
	// Url provides a signed image URL valid for at most ten minutes.
	URL string `json:"url" api:"required"`
	// Width specifies the measured image width in pixels.
	Width int64 `json:"width" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Format      respjson.Field
		Height      respjson.Field
		Size        respjson.Field
		URL         respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An optional dashboard preview of the completed output.

func (TranscodingFileThumbnail) RawJSON added in v0.17.0

func (r TranscodingFileThumbnail) RawJSON() string

Returns the unmodified JSON received from the API

func (*TranscodingFileThumbnail) UnmarshalJSON added in v0.17.0

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

type TranscodingFormat added in v0.17.0

type TranscodingFormat struct {
	// Id specifies the resolved container and codec selection.
	//
	// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "m4a_aac".
	ID string `json:"id" api:"required"`
	// Duration specifies the accepted output duration in seconds, including normalized
	// trims.
	Duration float64 `json:"duration" api:"required"`
	// Seek specifies the accepted start position in source seconds, normalized to the
	// output timeline.
	Seek float64 `json:"seek" api:"required"`
	// AudioBitrate specifies the resolved audio bitrate in bits per second. Omitted
	// for video-only output.
	AudioBitrate int64 `json:"audio_bitrate"`
	// AudioSamplerate specifies the resolved audio samples per second. Omitted for
	// video-only output.
	AudioSamplerate int64 `json:"audio_samplerate"`
	// Bufsize specifies the resolved video buffer size in bits, including codec-level
	// defaults. Omitted when no buffer applies.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the resolved audio channel count: 1, 2, 6 or 8. Omitted for
	// video-only output.
	Channels int64 `json:"channels"`
	// CpuUsed specifies the accepted VP9 encoder speed setting from 0 through 8.
	// Omitted for other codecs.
	CPUUsed string `json:"cpu_used"`
	// Crf specifies the accepted constant quality. Omitted for bitrate-controlled,
	// per-title and audio-only encoding.
	Crf int64 `json:"crf"`
	// DisableAudio is true for video-only output. Omitted when audio is selected.
	DisableAudio bool `json:"disable_audio"`
	// Framerate specifies the resolved video frames per second. Omitted for audio-only
	// output.
	Framerate float64 `json:"framerate"`
	// Gop specifies the resolved maximum keyframe interval in frames. Omitted for
	// audio-only output.
	Gop int64 `json:"gop"`
	// Height specifies the resolved video height in pixels. Omitted for audio-only
	// output.
	Height int64 `json:"height"`
	// Level specifies the accepted codec level when explicitly selected.
	Level int64 `json:"level"`
	// Maxrate specifies the resolved maximum video bitrate in bits per second,
	// including codec-level defaults. Omitted when no maximum applies.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the accepted minimum video bitrate in bits per second, when
	// configured.
	Minrate int64 `json:"minrate"`
	// Movflags specifies MP4 packaging. MP4 video exports use faststart.
	Movflags string `json:"movflags"`
	// PerTitle specifies whether video rate control is selected during content
	// analysis. Omitted for audio-only output.
	PerTitle bool `json:"per_title"`
	// Pixfmt specifies the accepted video pixel format. Omitted for audio-only output.
	Pixfmt string `json:"pixfmt"`
	// Preset specifies the accepted codec preset. Omitted when the codec does not use
	// presets.
	Preset string `json:"preset"`
	// Profilev specifies the accepted codec profile when explicitly selected.
	Profilev string `json:"profilev"`
	// Quality specifies the accepted VP9 deadline policy: good, best or realtime.
	// Omitted for other codecs.
	Quality string `json:"quality"`
	// VideoBitrate specifies the accepted video bitrate in bits per second. Omitted
	// for CRF and per-title encoding.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the resolved video width in pixels. Omitted for audio-only
	// output.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Duration        respjson.Field
		Seek            respjson.Field
		AudioBitrate    respjson.Field
		AudioSamplerate respjson.Field
		Bufsize         respjson.Field
		Channels        respjson.Field
		CPUUsed         respjson.Field
		Crf             respjson.Field
		DisableAudio    respjson.Field
		Framerate       respjson.Field
		Gop             respjson.Field
		Height          respjson.Field
		Level           respjson.Field
		Maxrate         respjson.Field
		Minrate         respjson.Field
		Movflags        respjson.Field
		PerTitle        respjson.Field
		Pixfmt          respjson.Field
		Preset          respjson.Field
		Profilev        respjson.Field
		Quality         respjson.Field
		VideoBitrate    respjson.Field
		Width           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Format contains the resolved encoding settings accepted at creation, including defaults, dimensions, frame rate and normalized seek and duration. Per-title rate control is resolved during processing. Measured media properties are available in Files.

func (TranscodingFormat) RawJSON added in v0.17.0

func (r TranscodingFormat) RawJSON() string

Returns the unmodified JSON received from the API

func (*TranscodingFormat) UnmarshalJSON added in v0.17.0

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

type TranscodingGetResponseEnvelope added in v0.17.0

type TranscodingGetResponseEnvelope struct {
	// Data contains the Transcoding.
	Data Transcoding `json:"data" api:"required"`
	// Status is success for a successful request.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Project-scoped Transcoding response.

func (TranscodingGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*TranscodingGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type TranscodingListParams added in v0.17.0

type TranscodingListParams struct {
	// Id filters by an exact Transcoding ID. Omit to include all matching resources.
	ID param.Opt[string] `query:"id,omitzero" json:"-"`
	// Maximum number of Transcodings to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of Transcodings to skip.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter Transcodings linked to this Source. Omit to include Transcodings from all
	// Sources in the Project.
	SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
	// Filter by output Storage ID.
	StorageID param.Opt[string]            `query:"storage_id,omitzero" json:"-"`
	Created   TranscodingListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by Transcoding status.
	//
	// Any of "preparing", "ready", "failed", "cancelled", "expired".
	Status TranscodingListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (TranscodingListParams) URLQuery added in v0.17.0

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

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

type TranscodingListParamsCreated added in v0.17.0

type TranscodingListParamsCreated struct {
	// Created at or after this Unix timestamp in seconds.
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Created at or before this Unix timestamp in seconds.
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// Creation-time ordering. Defaults to newest first.
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (TranscodingListParamsCreated) URLQuery added in v0.17.0

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

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

type TranscodingListParamsStatus added in v0.17.0

type TranscodingListParamsStatus string

Filter by Transcoding status.

const (
	TranscodingListParamsStatusPreparing TranscodingListParamsStatus = "preparing"
	TranscodingListParamsStatusReady     TranscodingListParamsStatus = "ready"
	TranscodingListParamsStatusFailed    TranscodingListParamsStatus = "failed"
	TranscodingListParamsStatusCancelled TranscodingListParamsStatus = "cancelled"
	TranscodingListParamsStatusExpired   TranscodingListParamsStatus = "expired"
)

type TranscodingM4aAacParam added in v0.17.0

type TranscodingM4aAacParam struct {
	// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
	// to 128000.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Duration specifies the requested output length in seconds. Defaults to the
	// remaining source duration and is capped at the source end. Audio-only output
	// must resolve to at least 0.001 seconds after trimming and sample rounding. The
	// accepted interval determines the fixed price.
	Duration param.Opt[float64] `json:"duration,omitzero"`
	// Seek specifies the start in source seconds. Defaults to zero and must precede
	// the source end. The accepted interval uses the output frame or sample timeline.
	// Audio-only output must retain at least 0.001 seconds after sample rounding.
	Seek param.Opt[float64] `json:"seek,omitzero"`
	// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
	// Opus audio uses 48000.
	//
	// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
	// 88200, 96000.
	AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
	// Channels specifies the output channel count. Defaults to stereo. Six channels
	// means 5.1; eight means 7.1.
	//
	// Any of 1, 2, 6, 8.
	Channels int64 `json:"channels,omitzero"`
	// Id specifies an AAC M4A export.
	//
	// This field can be elided, and will marshal its zero value as "m4a_aac".
	ID constant.M4aAac `json:"id" default:"m4a_aac"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TranscodingM4aAacParam) MarshalJSON added in v0.17.0

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

func (*TranscodingM4aAacParam) UnmarshalJSON added in v0.17.0

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

type TranscodingMP4Av1Movflags added in v0.17.0

type TranscodingMP4Av1Movflags string

Movflags specifies MP4 packaging. Defaults to faststart, which places playback metadata before the media.

const (
	TranscodingMP4Av1MovflagsFaststart TranscodingMP4Av1Movflags = "faststart"
)

type TranscodingMP4Av1Param added in v0.17.0

type TranscodingMP4Av1Param struct {
	// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
	// to 128000.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
	// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 63. Recommended
	// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio omits the audio stream. Defaults to false. A source without audio
	// produces video only.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
	// must contain audio.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the requested output length in seconds. Defaults to the
	// remaining source duration and is capped at the source end. Audio-only output
	// must resolve to at least 0.001 seconds after trimming and sample rounding. The
	// accepted interval determines the fixed price.
	Duration param.Opt[float64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Defaults to the source rate and
	// must be between 0.001 and 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
	// at the accepted frame rate, capped at 960 frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
	// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
	// AV1 requires CRF mode.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// PerTitle enables independent content-based bitrate prediction for each part of
	// the video. Analysis uses only the selected trim interval. Defaults to false.
	// Explicit rate-control settings cannot be combined with it.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the start in source seconds. Defaults to zero and must precede
	// the source end. The accepted interval uses the output frame or sample timeline.
	// Audio-only output must retain at least 0.001 seconds after sample rounding.
	Seek param.Opt[float64] `json:"seek,omitzero"`
	// VideoBitrate specifies the target video bitrate in bits per second, from 1000
	// through 100000000. Omit it for CRF or per-title encoding.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
	// Opus audio uses 48000.
	//
	// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
	// 88200, 96000.
	AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
	// Channels specifies the output channel count. Defaults to stereo. Six channels
	// means 5.1; eight means 7.1.
	//
	// Any of 1, 2, 6, 8.
	Channels int64 `json:"channels,omitzero"`
	// Level specifies the AV1 level using its two-digit representation, such as 31 for
	// level 3.1. The dimensions, frame rate and rate controls must fit this level.
	// Omitted rate limits resolve to level-compatible defaults.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level,omitzero"`
	// Movflags specifies MP4 packaging. Defaults to faststart, which places playback
	// metadata before the media.
	//
	// Any of "faststart".
	Movflags TranscodingMP4Av1Movflags `json:"movflags,omitzero"`
	// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
	// profile must support it.
	//
	// Any of "yuv420p", "yuv420p10le".
	Pixfmt TranscodingMP4Av1Pixfmt `json:"pixfmt,omitzero"`
	// Preset controls the encoding efficiency and processing intensity. Lower presets
	// use more optimization features, creating smaller files with better quality but
	// requiring more compute time. Higher presets encode faster but produce larger
	// files.
	//
	// Preset ranges:
	//
	// - 6-7: Fast encoding for real-time applications (smaller files)
	// - 8-10: Balanced efficiency and speed for general use
	// - 11-13: Fastest encoding for real-time applications (larger files)
	//
	// Any of "6", "7", "8", "9", "10", "11", "12", "13".
	Preset TranscodingMP4Av1Preset `json:"preset,omitzero"`
	// Profilev selects the AV1 Main profile. Use pixfmt to select 8-bit or 10-bit
	// output.
	//
	// Any of "main".
	Profilev TranscodingMP4Av1Profilev `json:"profilev,omitzero"`
	// Id specifies the output format.
	//
	// This field can be elided, and will marshal its zero value as "mp4_av1".
	ID constant.MP4Av1 `json:"id" default:"mp4_av1"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TranscodingMP4Av1Param) MarshalJSON added in v0.17.0

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

func (*TranscodingMP4Av1Param) UnmarshalJSON added in v0.17.0

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

type TranscodingMP4Av1Pixfmt added in v0.17.0

type TranscodingMP4Av1Pixfmt string

Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.

const (
	TranscodingMP4Av1PixfmtYuv420p     TranscodingMP4Av1Pixfmt = "yuv420p"
	TranscodingMP4Av1PixfmtYuv420p10le TranscodingMP4Av1Pixfmt = "yuv420p10le"
)

type TranscodingMP4Av1Preset added in v0.17.0

type TranscodingMP4Av1Preset string

Preset controls the encoding efficiency and processing intensity. Lower presets use more optimization features, creating smaller files with better quality but requiring more compute time. Higher presets encode faster but produce larger files.

Preset ranges:

- 6-7: Fast encoding for real-time applications (smaller files) - 8-10: Balanced efficiency and speed for general use - 11-13: Fastest encoding for real-time applications (larger files)

const (
	TranscodingMP4Av1Preset6  TranscodingMP4Av1Preset = "6"
	TranscodingMP4Av1Preset7  TranscodingMP4Av1Preset = "7"
	TranscodingMP4Av1Preset8  TranscodingMP4Av1Preset = "8"
	TranscodingMP4Av1Preset9  TranscodingMP4Av1Preset = "9"
	TranscodingMP4Av1Preset10 TranscodingMP4Av1Preset = "10"
	TranscodingMP4Av1Preset11 TranscodingMP4Av1Preset = "11"
	TranscodingMP4Av1Preset12 TranscodingMP4Av1Preset = "12"
	TranscodingMP4Av1Preset13 TranscodingMP4Av1Preset = "13"
)

type TranscodingMP4Av1Profilev added in v0.17.0

type TranscodingMP4Av1Profilev string

Profilev selects the AV1 Main profile. Use pixfmt to select 8-bit or 10-bit output.

const (
	TranscodingMP4Av1ProfilevMain TranscodingMP4Av1Profilev = "main"
)

type TranscodingMP4H264Movflags added in v0.17.0

type TranscodingMP4H264Movflags string

Movflags specifies MP4 packaging. Defaults to faststart, which places playback metadata before the media.

const (
	TranscodingMP4H264MovflagsFaststart TranscodingMP4H264Movflags = "faststart"
)

type TranscodingMP4H264Param added in v0.17.0

type TranscodingMP4H264Param struct {
	// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
	// to 128000.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
	// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio omits the audio stream. Defaults to false. A source without audio
	// produces video only.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
	// must contain audio.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the requested output length in seconds. Defaults to the
	// remaining source duration and is capped at the source end. Audio-only output
	// must resolve to at least 0.001 seconds after trimming and sample rounding. The
	// accepted interval determines the fixed price.
	Duration param.Opt[float64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Defaults to the source rate and
	// must be between 0.001 and 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
	// at the accepted frame rate, capped at 960 frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
	// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
	// AV1 requires CRF mode.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// PerTitle enables independent content-based bitrate prediction for each part of
	// the video. Analysis uses only the selected trim interval. Defaults to false.
	// Explicit rate-control settings cannot be combined with it.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the start in source seconds. Defaults to zero and must precede
	// the source end. The accepted interval uses the output frame or sample timeline.
	// Audio-only output must retain at least 0.001 seconds after sample rounding.
	Seek param.Opt[float64] `json:"seek,omitzero"`
	// VideoBitrate specifies the target video bitrate in bits per second, from 1000
	// through 100000000. Omit it for CRF or per-title encoding.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// X264KeyInt specifies the maximum number of frames between keyframes for H.264
	// encoding. Range: 1 to 960. Higher values can improve compression but may affect
	// seeking.
	X264Keyint param.Opt[int64] `json:"x264_keyint,omitzero"`
	// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
	// Opus audio uses 48000.
	//
	// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
	// 88200, 96000.
	AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
	// Channels specifies the output channel count. Defaults to stereo. Six channels
	// means 5.1; eight means 7.1.
	//
	// Any of 1, 2, 6, 8.
	Channels int64 `json:"channels,omitzero"`
	// Level specifies the H.264 decoder level using its two-digit representation, such
	// as 41 for level 4.1. The dimensions, frame rate and rate controls must fit this
	// level and the effective profile. Omitted rate limits resolve to level-compatible
	// defaults.
	//
	// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
	Level int64 `json:"level,omitzero"`
	// Movflags specifies MP4 packaging. Defaults to faststart, which places playback
	// metadata before the media.
	//
	// Any of "faststart".
	Movflags TranscodingMP4H264Movflags `json:"movflags,omitzero"`
	// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
	// profile must support it.
	//
	// Any of "yuv420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le",
	// "yuv444p10le".
	Pixfmt TranscodingMP4H264Pixfmt `json:"pixfmt,omitzero"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset TranscodingMP4H264Preset `json:"preset,omitzero"`
	// Profilev specifies the H.264 profile. Valid values:
	//
	// - baseline: Basic profile, good for mobile devices
	// - main: Main profile, good for most applications
	// - high: High profile, best quality but requires more processing
	// - high10: High 10-bit profile, supports 10-bit color
	// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
	// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
	//
	// Any of "baseline", "main", "high", "high10", "high422", "high444".
	Profilev TranscodingMP4H264Profilev `json:"profilev,omitzero"`
	// Id specifies the output format.
	//
	// This field can be elided, and will marshal its zero value as "mp4_h264".
	ID constant.MP4H264 `json:"id" default:"mp4_h264"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TranscodingMP4H264Param) MarshalJSON added in v0.17.0

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

func (*TranscodingMP4H264Param) UnmarshalJSON added in v0.17.0

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

type TranscodingMP4H264Pixfmt added in v0.17.0

type TranscodingMP4H264Pixfmt string

Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.

const (
	TranscodingMP4H264PixfmtYuv420p     TranscodingMP4H264Pixfmt = "yuv420p"
	TranscodingMP4H264PixfmtYuv422p     TranscodingMP4H264Pixfmt = "yuv422p"
	TranscodingMP4H264PixfmtYuv444p     TranscodingMP4H264Pixfmt = "yuv444p"
	TranscodingMP4H264PixfmtYuv420p10le TranscodingMP4H264Pixfmt = "yuv420p10le"
	TranscodingMP4H264PixfmtYuv422p10le TranscodingMP4H264Pixfmt = "yuv422p10le"
	TranscodingMP4H264PixfmtYuv444p10le TranscodingMP4H264Pixfmt = "yuv444p10le"
)

type TranscodingMP4H264Preset added in v0.17.0

type TranscodingMP4H264Preset string

Preset specifies the encoding speed preset. Valid values (from fastest to slowest):

- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality

const (
	TranscodingMP4H264PresetUltrafast TranscodingMP4H264Preset = "ultrafast"
	TranscodingMP4H264PresetSuperfast TranscodingMP4H264Preset = "superfast"
	TranscodingMP4H264PresetVeryfast  TranscodingMP4H264Preset = "veryfast"
	TranscodingMP4H264PresetFaster    TranscodingMP4H264Preset = "faster"
	TranscodingMP4H264PresetFast      TranscodingMP4H264Preset = "fast"
	TranscodingMP4H264PresetMedium    TranscodingMP4H264Preset = "medium"
)

type TranscodingMP4H264Profilev added in v0.17.0

type TranscodingMP4H264Profilev string

Profilev specifies the H.264 profile. Valid values:

- baseline: Basic profile, good for mobile devices - main: Main profile, good for most applications - high: High profile, best quality but requires more processing - high10: High 10-bit profile, supports 10-bit color - high422: High 4:2:2 profile, supports 4:2:2 color sampling - high444: High 4:4:4 profile, supports 4:4:4 color sampling

const (
	TranscodingMP4H264ProfilevBaseline TranscodingMP4H264Profilev = "baseline"
	TranscodingMP4H264ProfilevMain     TranscodingMP4H264Profilev = "main"
	TranscodingMP4H264ProfilevHigh     TranscodingMP4H264Profilev = "high"
	TranscodingMP4H264ProfilevHigh10   TranscodingMP4H264Profilev = "high10"
	TranscodingMP4H264ProfilevHigh422  TranscodingMP4H264Profilev = "high422"
	TranscodingMP4H264ProfilevHigh444  TranscodingMP4H264Profilev = "high444"
)

type TranscodingMP4H265Movflags added in v0.17.0

type TranscodingMP4H265Movflags string

Movflags specifies MP4 packaging. Defaults to faststart, which places playback metadata before the media.

const (
	TranscodingMP4H265MovflagsFaststart TranscodingMP4H265Movflags = "faststart"
)

type TranscodingMP4H265Param added in v0.17.0

type TranscodingMP4H265Param struct {
	// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
	// to 128000.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
	// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 16 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio omits the audio stream. Defaults to false. A source without audio
	// produces video only.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
	// must contain audio.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the requested output length in seconds. Defaults to the
	// remaining source duration and is capped at the source end. Audio-only output
	// must resolve to at least 0.001 seconds after trimming and sample rounding. The
	// accepted interval determines the fixed price.
	Duration param.Opt[float64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Defaults to the source rate and
	// must be between 0.001 and 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
	// at the accepted frame rate, capped at 960 frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
	// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
	// AV1 requires CRF mode.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// PerTitle enables independent content-based bitrate prediction for each part of
	// the video. Analysis uses only the selected trim interval. Defaults to false.
	// Explicit rate-control settings cannot be combined with it.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the start in source seconds. Defaults to zero and must precede
	// the source end. The accepted interval uses the output frame or sample timeline.
	// Audio-only output must retain at least 0.001 seconds after sample rounding.
	Seek param.Opt[float64] `json:"seek,omitzero"`
	// VideoBitrate specifies the target video bitrate in bits per second, from 1000
	// through 100000000. Omit it for CRF or per-title encoding.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// X265KeyInt specifies the maximum number of frames between keyframes for H.265
	// encoding. Range: 1 to 300. Higher values can improve compression but may affect
	// seeking.
	X265Keyint param.Opt[int64] `json:"x265_keyint,omitzero"`
	// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
	// Opus audio uses 48000.
	//
	// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
	// 88200, 96000.
	AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
	// Channels specifies the output channel count. Defaults to stereo. Six channels
	// means 5.1; eight means 7.1.
	//
	// Any of 1, 2, 6, 8.
	Channels int64 `json:"channels,omitzero"`
	// Level specifies the HEVC level using its two-digit representation, such as 31
	// for level 3.1. The dimensions, frame rate and rate controls must fit this level.
	// Omitted rate limits resolve to level-compatible defaults.
	//
	// Any of 30, 31, 41.
	Level int64 `json:"level,omitzero"`
	// Movflags specifies MP4 packaging. Defaults to faststart, which places playback
	// metadata before the media.
	//
	// Any of "faststart".
	Movflags TranscodingMP4H265Movflags `json:"movflags,omitzero"`
	// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
	// profile must support it.
	//
	// Any of "yuv420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le",
	// "yuv444p10le", "yuv420p12le", "yuv422p12le", "yuv444p12le".
	Pixfmt TranscodingMP4H265Pixfmt `json:"pixfmt,omitzero"`
	// Preset specifies the encoding speed preset. Valid values (from fastest to
	// slowest):
	//
	// - ultrafast: Fastest encoding, lowest quality
	// - superfast: Very fast encoding, lower quality
	// - veryfast: Fast encoding, moderate quality
	// - faster: Faster encoding, good quality
	// - fast: Fast encoding, better quality
	// - medium: Balanced preset, best quality
	//
	// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
	Preset TranscodingMP4H265Preset `json:"preset,omitzero"`
	// Profilev selects the HEVC profile. It must support the requested pixel format.
	//
	// Any of "main", "main10", "main12", "main422-10", "main422-12", "main444-8",
	// "main444-10", "main444-12".
	Profilev TranscodingMP4H265Profilev `json:"profilev,omitzero"`
	// Id specifies the output format.
	//
	// This field can be elided, and will marshal its zero value as "mp4_h265".
	ID constant.MP4H265 `json:"id" default:"mp4_h265"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TranscodingMP4H265Param) MarshalJSON added in v0.17.0

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

func (*TranscodingMP4H265Param) UnmarshalJSON added in v0.17.0

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

type TranscodingMP4H265Pixfmt added in v0.17.0

type TranscodingMP4H265Pixfmt string

Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.

const (
	TranscodingMP4H265PixfmtYuv420p     TranscodingMP4H265Pixfmt = "yuv420p"
	TranscodingMP4H265PixfmtYuv422p     TranscodingMP4H265Pixfmt = "yuv422p"
	TranscodingMP4H265PixfmtYuv444p     TranscodingMP4H265Pixfmt = "yuv444p"
	TranscodingMP4H265PixfmtYuv420p10le TranscodingMP4H265Pixfmt = "yuv420p10le"
	TranscodingMP4H265PixfmtYuv422p10le TranscodingMP4H265Pixfmt = "yuv422p10le"
	TranscodingMP4H265PixfmtYuv444p10le TranscodingMP4H265Pixfmt = "yuv444p10le"
	TranscodingMP4H265PixfmtYuv420p12le TranscodingMP4H265Pixfmt = "yuv420p12le"
	TranscodingMP4H265PixfmtYuv422p12le TranscodingMP4H265Pixfmt = "yuv422p12le"
	TranscodingMP4H265PixfmtYuv444p12le TranscodingMP4H265Pixfmt = "yuv444p12le"
)

type TranscodingMP4H265Preset added in v0.17.0

type TranscodingMP4H265Preset string

Preset specifies the encoding speed preset. Valid values (from fastest to slowest):

- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality

const (
	TranscodingMP4H265PresetUltrafast TranscodingMP4H265Preset = "ultrafast"
	TranscodingMP4H265PresetSuperfast TranscodingMP4H265Preset = "superfast"
	TranscodingMP4H265PresetVeryfast  TranscodingMP4H265Preset = "veryfast"
	TranscodingMP4H265PresetFaster    TranscodingMP4H265Preset = "faster"
	TranscodingMP4H265PresetFast      TranscodingMP4H265Preset = "fast"
	TranscodingMP4H265PresetMedium    TranscodingMP4H265Preset = "medium"
)

type TranscodingMP4H265Profilev added in v0.17.0

type TranscodingMP4H265Profilev string

Profilev selects the HEVC profile. It must support the requested pixel format.

const (
	TranscodingMP4H265ProfilevMain       TranscodingMP4H265Profilev = "main"
	TranscodingMP4H265ProfilevMain10     TranscodingMP4H265Profilev = "main10"
	TranscodingMP4H265ProfilevMain12     TranscodingMP4H265Profilev = "main12"
	TranscodingMP4H265ProfilevMain422_10 TranscodingMP4H265Profilev = "main422-10"
	TranscodingMP4H265ProfilevMain422_12 TranscodingMP4H265Profilev = "main422-12"
	TranscodingMP4H265ProfilevMain444_8  TranscodingMP4H265Profilev = "main444-8"
	TranscodingMP4H265ProfilevMain444_10 TranscodingMP4H265Profilev = "main444-10"
	TranscodingMP4H265ProfilevMain444_12 TranscodingMP4H265Profilev = "main444-12"
)

type TranscodingNewParams added in v0.17.0

type TranscodingNewParams struct {
	// Format specifies the requested encoding settings.
	Format TranscodingNewParamsFormatUnion `json:"format,omitzero" api:"required"`
	// SourceId identifies a Source in this Project.
	SourceID string `json:"source_id" api:"required"`
	// Metadata attaches string values to the Transcoding. The serialized object may
	// contain at most 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Storage overrides the Project output destination. Source storage remains
	// independent.
	Storage TranscodingNewParamsStorage `json:"storage,omitzero"`
	// contains filtered or unexported fields
}

func (TranscodingNewParams) MarshalJSON added in v0.17.0

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

func (*TranscodingNewParams) UnmarshalJSON added in v0.17.0

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

type TranscodingNewParamsFormatUnion added in v0.17.0

type TranscodingNewParamsFormatUnion struct {
	OfMP4H264 *TranscodingMP4H264Param `json:",omitzero,inline"`
	OfMP4H265 *TranscodingMP4H265Param `json:",omitzero,inline"`
	OfMP4Av1  *TranscodingMP4Av1Param  `json:",omitzero,inline"`
	OfWebmVp9 *TranscodingWebmVp9Param `json:",omitzero,inline"`
	OfM4aAac  *TranscodingM4aAacParam  `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 (TranscodingNewParamsFormatUnion) GetAudioBitrate added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetAudioBitrate() *int64

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

func (TranscodingNewParamsFormatUnion) GetAudioSamplerate added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetAudioSamplerate() *int64

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

func (TranscodingNewParamsFormatUnion) GetBufsize added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetBufsize() *int64

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

func (TranscodingNewParamsFormatUnion) GetCPUUsed added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetCPUUsed() *string

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

func (TranscodingNewParamsFormatUnion) GetChannels added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetChannels() *int64

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

func (TranscodingNewParamsFormatUnion) GetCrf added in v0.17.0

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

func (TranscodingNewParamsFormatUnion) GetDisableAudio added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetDisableAudio() *bool

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

func (TranscodingNewParamsFormatUnion) GetDisableVideo added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetDisableVideo() *bool

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

func (TranscodingNewParamsFormatUnion) GetDuration added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetDuration() *float64

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

func (TranscodingNewParamsFormatUnion) GetFramerate added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetFramerate() *float64

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

func (TranscodingNewParamsFormatUnion) GetGop added in v0.17.0

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

func (TranscodingNewParamsFormatUnion) GetHeight added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetHeight() *int64

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

func (TranscodingNewParamsFormatUnion) GetID added in v0.17.0

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

func (TranscodingNewParamsFormatUnion) GetLevel added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetLevel() *int64

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

func (TranscodingNewParamsFormatUnion) GetMaxrate added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetMaxrate() *int64

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

func (TranscodingNewParamsFormatUnion) GetMinrate added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetMinrate() *int64

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

func (TranscodingNewParamsFormatUnion) GetMovflags added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetMovflags() *string

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

func (TranscodingNewParamsFormatUnion) GetPerTitle added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetPerTitle() *bool

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

func (TranscodingNewParamsFormatUnion) GetPixfmt added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetPixfmt() *string

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

func (TranscodingNewParamsFormatUnion) GetPreset added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetPreset() *string

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

func (TranscodingNewParamsFormatUnion) GetProfilev added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetProfilev() *string

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

func (TranscodingNewParamsFormatUnion) GetQuality added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetQuality() *string

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

func (TranscodingNewParamsFormatUnion) GetSeek added in v0.17.0

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

func (TranscodingNewParamsFormatUnion) GetVideoBitrate added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetVideoBitrate() *int64

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

func (TranscodingNewParamsFormatUnion) GetWidth added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetWidth() *int64

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

func (TranscodingNewParamsFormatUnion) GetX264Keyint added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetX264Keyint() *int64

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

func (TranscodingNewParamsFormatUnion) GetX265Keyint added in v0.17.0

func (u TranscodingNewParamsFormatUnion) GetX265Keyint() *int64

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

func (TranscodingNewParamsFormatUnion) MarshalJSON added in v0.17.0

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

func (*TranscodingNewParamsFormatUnion) UnmarshalJSON added in v0.17.0

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

type TranscodingNewParamsStorage added in v0.17.0

type TranscodingNewParamsStorage struct {
	// Id specifies a Storage in this Project. Defaults to the Project output storage.
	ID param.Opt[string] `json:"id,omitzero"`
	// Path specifies the output object path relative to the selected Storage
	// base_prefix. Required for customer storage; generated for Chunkify temporary
	// storage. The extension must match the resolved output format. The combined path
	// may contain at most 1024 bytes.
	Path param.Opt[string] `json:"path,omitzero"`
	// contains filtered or unexported fields
}

Storage overrides the Project output destination. Source storage remains independent.

func (TranscodingNewParamsStorage) MarshalJSON added in v0.17.0

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

func (*TranscodingNewParamsStorage) UnmarshalJSON added in v0.17.0

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

type TranscodingNewResponseEnvelope added in v0.17.0

type TranscodingNewResponseEnvelope struct {
	// Data contains the Transcoding.
	Data Transcoding `json:"data" api:"required"`
	// Status is success for a successful request.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Project-scoped Transcoding response.

func (TranscodingNewResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*TranscodingNewResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type TranscodingProcessingStage added in v0.17.0

type TranscodingProcessingStage string

ProcessingStage specifies the current activity while the status is preparing. Omitted otherwise.

const (
	TranscodingProcessingStageQueued     TranscodingProcessingStage = "queued"
	TranscodingProcessingStageStarting   TranscodingProcessingStage = "starting"
	TranscodingProcessingStageEncoding   TranscodingProcessingStage = "encoding"
	TranscodingProcessingStageFinalizing TranscodingProcessingStage = "finalizing"
	TranscodingProcessingStageUploading  TranscodingProcessingStage = "uploading"
)

type TranscodingService added in v0.17.0

type TranscodingService struct {
	Options []option.RequestOption
}

TranscodingService contains methods and other services that help with interacting with the chunkify 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 NewTranscodingService method instead.

func NewTranscodingService added in v0.17.0

func NewTranscodingService(opts ...option.RequestOption) (r TranscodingService)

NewTranscodingService 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 (*TranscodingService) Cancel added in v0.17.0

func (r *TranscodingService) Cancel(ctx context.Context, transcodingID string, opts ...option.RequestOption) (err error)

Cancel a preparing Transcoding and release its unpaid reservation. Repeating an accepted cancellation succeeds.

func (*TranscodingService) Delete added in v0.17.0

func (r *TranscodingService) Delete(ctx context.Context, transcodingID string, body TranscodingDeleteParams, opts ...option.RequestOption) (err error)

Delete a ready, failed, cancelled or expired Transcoding and its file records. The Source and settled usage are preserved. Customer output files remain unless delete_files is true; temporary files retain their original 24-hour expiry. Deletion remains available for inactive teams.

func (*TranscodingService) Get added in v0.17.0

func (r *TranscodingService) Get(ctx context.Context, transcodingID string, opts ...option.RequestOption) (res *Transcoding, err error)

Retrieve the accepted settings, published files and current state of one Transcoding.

func (*TranscodingService) List added in v0.17.0

List Transcodings in the authenticated Project, newest first by default.

func (*TranscodingService) ListAutoPaging added in v0.17.0

List Transcodings in the authenticated Project, newest first by default.

func (*TranscodingService) New added in v0.17.0

Create a standalone file export with resolved encoding settings.

type TranscodingStatus added in v0.17.0

type TranscodingStatus string

Status reports processing or output expiry.

const (
	TranscodingStatusPreparing TranscodingStatus = "preparing"
	TranscodingStatusReady     TranscodingStatus = "ready"
	TranscodingStatusFailed    TranscodingStatus = "failed"
	TranscodingStatusCancelled TranscodingStatus = "cancelled"
	TranscodingStatusExpired   TranscodingStatus = "expired"
)

type TranscodingStorage added in v0.17.0

type TranscodingStorage struct {
	// Id identifies the output Storage.
	ID string `json:"id" api:"required"`
	// Path specifies the output file path relative to the Storage base_prefix saved at
	// creation.
	Path string `json:"path" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Path        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Storage contains the resolved output destination.

func (TranscodingStorage) RawJSON added in v0.17.0

func (r TranscodingStorage) RawJSON() string

Returns the unmodified JSON received from the API

func (*TranscodingStorage) UnmarshalJSON added in v0.17.0

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

type TranscodingWebmVp9CPUUsed added in v0.17.0

type TranscodingWebmVp9CPUUsed string

CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower values mean better quality but slower encoding, higher values mean faster encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for good quality, 4-6 for balanced, 6-8 for speed

const (
	TranscodingWebmVp9CPUUsed0 TranscodingWebmVp9CPUUsed = "0"
	TranscodingWebmVp9CPUUsed1 TranscodingWebmVp9CPUUsed = "1"
	TranscodingWebmVp9CPUUsed2 TranscodingWebmVp9CPUUsed = "2"
	TranscodingWebmVp9CPUUsed3 TranscodingWebmVp9CPUUsed = "3"
	TranscodingWebmVp9CPUUsed4 TranscodingWebmVp9CPUUsed = "4"
	TranscodingWebmVp9CPUUsed5 TranscodingWebmVp9CPUUsed = "5"
	TranscodingWebmVp9CPUUsed6 TranscodingWebmVp9CPUUsed = "6"
	TranscodingWebmVp9CPUUsed7 TranscodingWebmVp9CPUUsed = "7"
	TranscodingWebmVp9CPUUsed8 TranscodingWebmVp9CPUUsed = "8"
)

type TranscodingWebmVp9Param added in v0.17.0

type TranscodingWebmVp9Param struct {
	// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
	// to 128000.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
	// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 15 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio omits the audio stream. Defaults to false. A source without audio
	// produces video only.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
	// must contain audio.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the requested output length in seconds. Defaults to the
	// remaining source duration and is capped at the source end. Audio-only output
	// must resolve to at least 0.001 seconds after trimming and sample rounding. The
	// accepted interval determines the fixed price.
	Duration param.Opt[float64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Defaults to the source rate and
	// must be between 0.001 and 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
	// at the accepted frame rate, capped at 960 frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
	// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
	// AV1 requires CRF mode.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate selects VP9 constant bitrate when equal to video_bitrate and maxrate.
	// Other minimum-rate combinations are unsupported.
	Minrate param.Opt[int64] `json:"minrate,omitzero"`
	// PerTitle enables independent content-based bitrate prediction for each part of
	// the video. Analysis uses only the selected trim interval. Defaults to false.
	// Explicit rate-control settings cannot be combined with it.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the start in source seconds. Defaults to zero and must precede
	// the source end. The accepted interval uses the output frame or sample timeline.
	// Audio-only output must retain at least 0.001 seconds after sample rounding.
	Seek param.Opt[float64] `json:"seek,omitzero"`
	// VideoBitrate specifies the target video bitrate in bits per second, from 1000
	// through 100000000. Omit it for CRF or per-title encoding.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
	// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
	// even. Omitting both preserves the source dimensions rounded down to even pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
	// Opus audio uses 48000.
	//
	// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
	// 88200, 96000.
	AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
	// Channels specifies the output channel count. Defaults to stereo. Six channels
	// means 5.1; eight means 7.1.
	//
	// Any of 1, 2, 6, 8.
	Channels int64 `json:"channels,omitzero"`
	// CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower
	// values mean better quality but slower encoding, higher values mean faster
	// encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for
	// good quality, 4-6 for balanced, 6-8 for speed
	//
	// Any of "0", "1", "2", "3", "4", "5", "6", "7", "8".
	CPUUsed TranscodingWebmVp9CPUUsed `json:"cpu_used,omitzero"`
	// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
	// profile must support it.
	//
	// Any of "yuv420p", "yuv422p", "yuv440p", "yuv444p", "yuv420p10le", "yuv422p10le",
	// "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le", "yuv440p12le",
	// "yuv444p12le".
	Pixfmt TranscodingWebmVp9Pixfmt `json:"pixfmt,omitzero"`
	// Quality specifies the VP9 encoding quality preset. Valid values:
	//
	// - good: Balanced quality preset, good for most applications
	// - best: Best quality preset, slower encoding
	// - realtime: Fast encoding preset, suitable for live streaming
	//
	// Any of "good", "best", "realtime".
	Quality TranscodingWebmVp9Quality `json:"quality,omitzero"`
	// Id specifies the output format.
	//
	// This field can be elided, and will marshal its zero value as "webm_vp9".
	ID constant.WebmVp9 `json:"id" default:"webm_vp9"`
	// contains filtered or unexported fields
}

The property ID is required.

func (TranscodingWebmVp9Param) MarshalJSON added in v0.17.0

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

func (*TranscodingWebmVp9Param) UnmarshalJSON added in v0.17.0

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

type TranscodingWebmVp9Pixfmt added in v0.17.0

type TranscodingWebmVp9Pixfmt string

Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.

const (
	TranscodingWebmVp9PixfmtYuv420p     TranscodingWebmVp9Pixfmt = "yuv420p"
	TranscodingWebmVp9PixfmtYuv422p     TranscodingWebmVp9Pixfmt = "yuv422p"
	TranscodingWebmVp9PixfmtYuv440p     TranscodingWebmVp9Pixfmt = "yuv440p"
	TranscodingWebmVp9PixfmtYuv444p     TranscodingWebmVp9Pixfmt = "yuv444p"
	TranscodingWebmVp9PixfmtYuv420p10le TranscodingWebmVp9Pixfmt = "yuv420p10le"
	TranscodingWebmVp9PixfmtYuv422p10le TranscodingWebmVp9Pixfmt = "yuv422p10le"
	TranscodingWebmVp9PixfmtYuv440p10le TranscodingWebmVp9Pixfmt = "yuv440p10le"
	TranscodingWebmVp9PixfmtYuv444p10le TranscodingWebmVp9Pixfmt = "yuv444p10le"
	TranscodingWebmVp9PixfmtYuv420p12le TranscodingWebmVp9Pixfmt = "yuv420p12le"
	TranscodingWebmVp9PixfmtYuv422p12le TranscodingWebmVp9Pixfmt = "yuv422p12le"
	TranscodingWebmVp9PixfmtYuv440p12le TranscodingWebmVp9Pixfmt = "yuv440p12le"
	TranscodingWebmVp9PixfmtYuv444p12le TranscodingWebmVp9Pixfmt = "yuv444p12le"
)

type TranscodingWebmVp9Quality added in v0.17.0

type TranscodingWebmVp9Quality string

Quality specifies the VP9 encoding quality preset. Valid values:

- good: Balanced quality preset, good for most applications - best: Best quality preset, slower encoding - realtime: Fast encoding preset, suitable for live streaming

const (
	TranscodingWebmVp9QualityGood     TranscodingWebmVp9Quality = "good"
	TranscodingWebmVp9QualityBest     TranscodingWebmVp9Quality = "best"
	TranscodingWebmVp9QualityRealtime TranscodingWebmVp9Quality = "realtime"
)

type UnwrapWebhookEvent added in v0.6.0

type UnwrapWebhookEvent struct {
	// Unique identifier of the notification
	ID string `json:"id" api:"required"`
	// Payload for the event named in event. Replays preserve the original data;
	// retrieve the resource for current state and fresh signed URLs.
	Data UnwrapWebhookEventDataUnion `json:"data" api:"required"`
	// Timestamp of the event payload.
	Date time.Time `json:"date" api:"required" format:"date-time"`
	// Type of event that triggered the notification.
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Event UnwrapWebhookEventEvent `json:"event" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Data        respjson.Field
		Date        respjson.Field
		Event       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UnwrapWebhookEvent) RawJSON added in v0.6.0

func (r UnwrapWebhookEvent) RawJSON() string

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEvent) UnmarshalJSON added in v0.6.0

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

type UnwrapWebhookEventDataNotificationPayloadAsset added in v0.17.0

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

func (UnwrapWebhookEventDataNotificationPayloadAsset) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadAsset) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadAssetDeleted added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadAssetDeleted struct {
	Asset Asset `json:"asset" api:"required"`
	// FilesDeleted indicates whether the requested cleanup of the Asset's generated
	// files completed without error. Missing files count as successful cleanup. False
	// means these files were not removed at event time. Private transcript text and
	// saved subtitle copies are always scheduled for asynchronous cleanup.
	FilesDeleted bool `json:"files_deleted" api:"required"`
	// DeletedSize specifies the recorded generated-file bytes removed with the Asset,
	// including attached outputs. Omitted when cleanup was not requested or the total
	// is unavailable. Missing storage objects still contribute their recorded sizes.
	DeletedSize int64 `json:"deleted_size"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Asset        respjson.Field
		FilesDeleted respjson.Field
		DeletedSize  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for asset.deleted. The Asset snapshot is preserved after record deletion.

func (UnwrapWebhookEventDataNotificationPayloadAssetDeleted) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadAssetDeleted) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadAssetOutput added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadAssetOutput struct {
	// Output contains the canonical typed output snapshot at the event time, matching
	// the output API.
	Output AssetOutputUnion `json:"output" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Output      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for Asset output creation, readiness, and failure events.

func (UnwrapWebhookEventDataNotificationPayloadAssetOutput) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadAssetOutput) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted struct {
	// FilesDeleted indicates whether the requested cleanup of the output files
	// completed without error. Missing files count as successful cleanup. False means
	// these files were not removed at event time. Private transcript text and saved
	// subtitle copies are always scheduled for asynchronous cleanup.
	FilesDeleted bool `json:"files_deleted" api:"required"`
	// Output contains the canonical typed output snapshot before removal.
	Output AssetOutputUnion `json:"output" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FilesDeleted respjson.Field
		Output       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for asset.output.deleted. The output snapshot is preserved after removal.

func (UnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadJobCompleted struct {
	// List of files generated by the job
	Files []JobFile `json:"files" api:"required"`
	Job   Job       `json:"job" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files       respjson.Field
		Job         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload data structure for job.completed events

func (UnwrapWebhookEventDataNotificationPayloadJobCompleted) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadJobCompleted) UnmarshalJSON added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadJobCreated added in v0.17.0

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

Payload for job.created. A standalone Job has been accepted for processing; execution may not have started.

func (UnwrapWebhookEventDataNotificationPayloadJobCreated) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadJobCreated) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

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

Payload data structure for job.failed and job.cancelled events

func (UnwrapWebhookEventDataNotificationPayloadJobFailed) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadJobFailed) UnmarshalJSON added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadSourceCreated added in v0.17.0

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

Payload for source.created. The Source has been validated and saved. Thumbnails may still be pending.

func (UnwrapWebhookEventDataNotificationPayloadSourceCreated) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadSourceCreated) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadTranscoding added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadTranscoding struct {
	// Transcoding contains the canonical resource snapshot at the event time.
	Transcoding Transcoding `json:"transcoding" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Transcoding respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for transcoding.created, transcoding.ready, transcoding.failed, transcoding.cancelled, transcoding.expired and transcoding.deleted events.

func (UnwrapWebhookEventDataNotificationPayloadTranscoding) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadTranscoding) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadUploadCompleted struct {
	Source Source `json:"source" api:"required"`
	Upload Upload `json:"upload" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Source      respjson.Field
		Upload      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload data structure for upload.completed events

func (UnwrapWebhookEventDataNotificationPayloadUploadCompleted) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadUploadCompleted) UnmarshalJSON added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadUploadCreated added in v0.17.0

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

Payload for upload.created. A waiting upload session has been created; its Source is created only after successful completion. Transfer credentials are not included.

func (UnwrapWebhookEventDataNotificationPayloadUploadCreated) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadUploadCreated) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

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

Payload data structure for upload.failed and upload.expired events

func (UnwrapWebhookEventDataNotificationPayloadUploadFailed) RawJSON added in v0.6.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadUploadFailed) UnmarshalJSON added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadWorkflowRun added in v0.17.0

type UnwrapWebhookEventDataNotificationPayloadWorkflowRun struct {
	// ActionRuns specifies every action admitted by this run, including its rule and
	// action IDs, type, input, status, output reference, and any skip or failure
	// reason. Actions from other runs are excluded.
	ActionRuns []AssetActionRun `json:"action_runs" api:"required"`
	// Snapshot of the Workflow run when the event was recorded.
	WorkflowRun WorkflowRun `json:"workflow_run" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActionRuns  respjson.Field
		WorkflowRun respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Payload for workflow_run.created, workflow_run.completed, workflow_run.failed, and workflow_run.cancelled. The run and its actions are snapshots taken when the event was recorded.

func (UnwrapWebhookEventDataNotificationPayloadWorkflowRun) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataNotificationPayloadWorkflowRun) UnmarshalJSON added in v0.17.0

type UnwrapWebhookEventDataThumbnailEventData added in v0.17.0

type UnwrapWebhookEventDataThumbnailEventData struct {
	// Thumbnail contains the resource at the event time.
	Thumbnail Thumbnail `json:"thumbnail" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Thumbnail   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A canonical thumbnail snapshot for standalone thumbnail.\* events. Asset-owned thumbnails use the Asset output event payload.

func (UnwrapWebhookEventDataThumbnailEventData) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataThumbnailEventData) UnmarshalJSON added in v0.17.0

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

type UnwrapWebhookEventDataUnion added in v0.6.0

type UnwrapWebhookEventDataUnion struct {
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadJobCompleted].
	Files []JobFile `json:"files"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadJobCompleted].
	Job Job `json:"job"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadSourceCreated].
	Source Source `json:"source"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadUploadCreated].
	Upload Upload `json:"upload"`
	// This field is from variant [UnwrapWebhookEventDataNotificationPayloadAsset].
	Asset Asset `json:"asset"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadAssetOutput].
	Output       AssetOutputUnion `json:"output"`
	FilesDeleted bool             `json:"files_deleted"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadAssetDeleted].
	DeletedSize int64 `json:"deleted_size"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadWorkflowRun].
	ActionRuns []AssetActionRun `json:"action_runs"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadWorkflowRun].
	WorkflowRun WorkflowRun `json:"workflow_run"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadTranscoding].
	Transcoding Transcoding `json:"transcoding"`
	// This field is from variant [UnwrapWebhookEventDataThumbnailEventData].
	Thumbnail Thumbnail `json:"thumbnail"`
	JSON      struct {
		Files        respjson.Field
		Job          respjson.Field
		Source       respjson.Field
		Upload       respjson.Field
		Asset        respjson.Field
		Output       respjson.Field
		FilesDeleted respjson.Field
		DeletedSize  respjson.Field
		ActionRuns   respjson.Field
		WorkflowRun  respjson.Field
		Transcoding  respjson.Field
		Thumbnail    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

UnwrapWebhookEventDataUnion contains all possible properties and values from UnwrapWebhookEventDataNotificationPayloadJobCompleted, UnwrapWebhookEventDataNotificationPayloadJobFailed, UnwrapWebhookEventDataNotificationPayloadJobCreated, UnwrapWebhookEventDataNotificationPayloadSourceCreated, UnwrapWebhookEventDataNotificationPayloadUploadCreated, UnwrapWebhookEventDataNotificationPayloadUploadCompleted, UnwrapWebhookEventDataNotificationPayloadUploadFailed, UnwrapWebhookEventDataNotificationPayloadAsset, UnwrapWebhookEventDataNotificationPayloadAssetOutput, UnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted, UnwrapWebhookEventDataNotificationPayloadAssetDeleted, UnwrapWebhookEventDataNotificationPayloadWorkflowRun, UnwrapWebhookEventDataNotificationPayloadTranscoding, UnwrapWebhookEventDataThumbnailEventData.

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

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAsset added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAsset() (v UnwrapWebhookEventDataNotificationPayloadAsset)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAssetDeleted added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAssetDeleted() (v UnwrapWebhookEventDataNotificationPayloadAssetDeleted)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAssetOutput added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAssetOutput() (v UnwrapWebhookEventDataNotificationPayloadAssetOutput)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted() (v UnwrapWebhookEventDataNotificationPayloadAssetOutputDeleted)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobCompleted() (v UnwrapWebhookEventDataNotificationPayloadJobCompleted)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobCreated added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobCreated() (v UnwrapWebhookEventDataNotificationPayloadJobCreated)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobFailed() (v UnwrapWebhookEventDataNotificationPayloadJobFailed)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadSourceCreated added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadSourceCreated() (v UnwrapWebhookEventDataNotificationPayloadSourceCreated)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadTranscoding added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadTranscoding() (v UnwrapWebhookEventDataNotificationPayloadTranscoding)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadCompleted() (v UnwrapWebhookEventDataNotificationPayloadUploadCompleted)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadCreated added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadCreated() (v UnwrapWebhookEventDataNotificationPayloadUploadCreated)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadFailed() (v UnwrapWebhookEventDataNotificationPayloadUploadFailed)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadWorkflowRun added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadWorkflowRun() (v UnwrapWebhookEventDataNotificationPayloadWorkflowRun)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataThumbnailEventData added in v0.17.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataThumbnailEventData() (v UnwrapWebhookEventDataThumbnailEventData)

func (UnwrapWebhookEventDataUnion) RawJSON added in v0.6.0

func (u UnwrapWebhookEventDataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*UnwrapWebhookEventDataUnion) UnmarshalJSON added in v0.6.0

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

type UnwrapWebhookEventEvent added in v0.6.0

type UnwrapWebhookEventEvent string

Type of event that triggered the notification.

const (
	UnwrapWebhookEventEventJobCreated           UnwrapWebhookEventEvent = "job.created"
	UnwrapWebhookEventEventJobCompleted         UnwrapWebhookEventEvent = "job.completed"
	UnwrapWebhookEventEventJobFailed            UnwrapWebhookEventEvent = "job.failed"
	UnwrapWebhookEventEventJobCancelled         UnwrapWebhookEventEvent = "job.cancelled"
	UnwrapWebhookEventEventSourceCreated        UnwrapWebhookEventEvent = "source.created"
	UnwrapWebhookEventEventSourceDeleted        UnwrapWebhookEventEvent = "source.deleted"
	UnwrapWebhookEventEventUploadCreated        UnwrapWebhookEventEvent = "upload.created"
	UnwrapWebhookEventEventUploadCompleted      UnwrapWebhookEventEvent = "upload.completed"
	UnwrapWebhookEventEventUploadFailed         UnwrapWebhookEventEvent = "upload.failed"
	UnwrapWebhookEventEventUploadExpired        UnwrapWebhookEventEvent = "upload.expired"
	UnwrapWebhookEventEventAssetCreated         UnwrapWebhookEventEvent = "asset.created"
	UnwrapWebhookEventEventAssetReady           UnwrapWebhookEventEvent = "asset.ready"
	UnwrapWebhookEventEventAssetPlaybackReady   UnwrapWebhookEventEvent = "asset.playback_ready"
	UnwrapWebhookEventEventAssetFailed          UnwrapWebhookEventEvent = "asset.failed"
	UnwrapWebhookEventEventAssetExpired         UnwrapWebhookEventEvent = "asset.expired"
	UnwrapWebhookEventEventAssetDeleted         UnwrapWebhookEventEvent = "asset.deleted"
	UnwrapWebhookEventEventAssetOutputCreated   UnwrapWebhookEventEvent = "asset.output.created"
	UnwrapWebhookEventEventAssetOutputReady     UnwrapWebhookEventEvent = "asset.output.ready"
	UnwrapWebhookEventEventAssetOutputFailed    UnwrapWebhookEventEvent = "asset.output.failed"
	UnwrapWebhookEventEventAssetOutputDeleted   UnwrapWebhookEventEvent = "asset.output.deleted"
	UnwrapWebhookEventEventWorkflowRunCreated   UnwrapWebhookEventEvent = "workflow_run.created"
	UnwrapWebhookEventEventWorkflowRunCompleted UnwrapWebhookEventEvent = "workflow_run.completed"
	UnwrapWebhookEventEventWorkflowRunFailed    UnwrapWebhookEventEvent = "workflow_run.failed"
	UnwrapWebhookEventEventWorkflowRunCancelled UnwrapWebhookEventEvent = "workflow_run.cancelled"
	UnwrapWebhookEventEventTranscodingCreated   UnwrapWebhookEventEvent = "transcoding.created"
	UnwrapWebhookEventEventTranscodingReady     UnwrapWebhookEventEvent = "transcoding.ready"
	UnwrapWebhookEventEventTranscodingFailed    UnwrapWebhookEventEvent = "transcoding.failed"
	UnwrapWebhookEventEventTranscodingCancelled UnwrapWebhookEventEvent = "transcoding.cancelled"
	UnwrapWebhookEventEventTranscodingExpired   UnwrapWebhookEventEvent = "transcoding.expired"
	UnwrapWebhookEventEventTranscodingDeleted   UnwrapWebhookEventEvent = "transcoding.deleted"
	UnwrapWebhookEventEventThumbnailCreated     UnwrapWebhookEventEvent = "thumbnail.created"
	UnwrapWebhookEventEventThumbnailReady       UnwrapWebhookEventEvent = "thumbnail.ready"
	UnwrapWebhookEventEventThumbnailFailed      UnwrapWebhookEventEvent = "thumbnail.failed"
	UnwrapWebhookEventEventThumbnailExpired     UnwrapWebhookEventEvent = "thumbnail.expired"
	UnwrapWebhookEventEventThumbnailDeleted     UnwrapWebhookEventEvent = "thumbnail.deleted"
)

type Upload added in v0.6.0

type Upload struct {
	// Unique identifier of the upload
	ID string `json:"id" api:"required"`
	// Whether this Upload creates an Asset on completion.
	CreateAsset bool `json:"create_asset" api:"required"`
	// Timestamp when the upload was created
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Timestamp when the upload will expire
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// Current status of the upload
	//
	// Any of "waiting", "completed", "failed", "expired".
	Status UploadStatus `json:"status" api:"required"`
	// Timestamp when the upload was updated
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// Resolved transfer mode for this Upload.
	//
	// Any of "single", "multipart".
	UploadMode UploadUploadMode `json:"upload_mode" api:"required"`
	// Selected Workflow ID, or null.
	WorkflowID string `json:"workflow_id" api:"required"`
	// Pinned Workflow revision, or null.
	WorkflowRevision int64 `json:"workflow_revision" api:"required"`
	// Automatically created Asset. May be absent before completion or after record
	// deletion.
	AssetID string `json:"asset_id"`
	// Completion capability, returned only on creation. POST after a successful single
	// PUT or with all multipart ETags before expires_at. Requires no API key. Repeated
	// valid calls are idempotent.
	CompletionURL string `json:"completion_url"`
	// CreatedByTokenId specifies the Project token used to create the resource. It
	// remains set after the token is revoked. Omitted for dashboard requests, MCP
	// OAuth connections, Workflow actions, and unknown creators.
	CreatedByTokenID string `json:"created_by_token_id"`
	// CreatedByUserId specifies the team member who created the resource. Omitted for
	// Workflow actions, unknown creators, and deleted accounts.
	CreatedByUserID string `json:"created_by_user_id"`
	// CreatedVia specifies how the resource was created: api for API requests,
	// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
	// Workflow actions. Omitted when the creator is unknown.
	//
	// Any of "api", "dashboard", "mcp", "workflow".
	CreatedVia UploadCreatedVia `json:"created_via"`
	// Error message of the upload
	Error shared.ChunkifyError `json:"error"`
	// Declared file size in bytes, when supplied at creation.
	FileSizeBytes int64 `json:"file_size_bytes"`
	// Additional metadata for the upload
	Metadata map[string]string `json:"metadata"`
	// Multipart transfer details, returned only on creation for multipart Uploads.
	Multipart UploadMultipart `json:"multipart"`
	// SourceId is the id of the source that was created from the upload
	SourceID string `json:"source_id"`
	// Resolved Storage selected when the Upload was created. Absent for historical
	// uploads.
	StorageID string `json:"storage_id"`
	// Presigned PUT URL, returned only when creating a single-PUT Upload session. Call
	// completion_url after the PUT succeeds.
	UploadURL string `json:"upload_url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreateAsset      respjson.Field
		CreatedAt        respjson.Field
		ExpiresAt        respjson.Field
		Status           respjson.Field
		UpdatedAt        respjson.Field
		UploadMode       respjson.Field
		WorkflowID       respjson.Field
		WorkflowRevision respjson.Field
		AssetID          respjson.Field
		CompletionURL    respjson.Field
		CreatedByTokenID respjson.Field
		CreatedByUserID  respjson.Field
		CreatedVia       respjson.Field
		Error            respjson.Field
		FileSizeBytes    respjson.Field
		Metadata         respjson.Field
		Multipart        respjson.Field
		SourceID         respjson.Field
		StorageID        respjson.Field
		UploadURL        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Upload) RawJSON added in v0.6.0

func (r Upload) RawJSON() string

Returns the unmodified JSON received from the API

func (*Upload) UnmarshalJSON added in v0.6.0

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

type UploadCompleteParams added in v0.17.0

type UploadCompleteParams struct {
	// All uploaded parts in ascending part_number order, with the ETags returned by
	// storage.
	Parts []UploadCompleteParamsPart `json:"parts,omitzero"`
	// contains filtered or unexported fields
}

func (UploadCompleteParams) MarshalJSON added in v0.17.0

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

func (*UploadCompleteParams) UnmarshalJSON added in v0.17.0

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

type UploadCompleteParamsPart added in v0.17.0

type UploadCompleteParamsPart struct {
	// ETag returned by storage for this part, including its quotation marks when
	// present.
	Etag string `json:"etag" api:"required"`
	// One-based part number.
	PartNumber int64 `json:"part_number" api:"required"`
	// contains filtered or unexported fields
}

The properties Etag, PartNumber are required.

func (UploadCompleteParamsPart) MarshalJSON added in v0.17.0

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

func (*UploadCompleteParamsPart) UnmarshalJSON added in v0.17.0

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

type UploadCreatedVia added in v0.17.0

type UploadCreatedVia string

CreatedVia specifies how the resource was created: api for API requests, dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for Workflow actions. Omitted when the creator is unknown.

const (
	UploadCreatedViaAPI       UploadCreatedVia = "api"
	UploadCreatedViaDashboard UploadCreatedVia = "dashboard"
	UploadCreatedViaMcp       UploadCreatedVia = "mcp"
	UploadCreatedViaWorkflow  UploadCreatedVia = "workflow"
)

type UploadGetResponseEnvelope added in v0.6.0

type UploadGetResponseEnvelope struct {
	// Data contains the response object
	Data Upload `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UploadGetResponseEnvelope) RawJSON added in v0.6.0

func (r UploadGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*UploadGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type UploadListParams added in v0.6.0

type UploadListParams struct {
	// Filter by upload ID
	ID param.Opt[string] `query:"id,omitzero" json:"-"`
	// Pagination limit (max 100)
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Pagination offset
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter by source ID
	SourceID param.Opt[string]       `query:"source_id,omitzero" json:"-"`
	Created  UploadListParamsCreated `query:"created,omitzero" json:"-"`
	// Filter by metadata
	Metadata [][]string `query:"metadata,omitzero" json:"-"`
	// Filter by status (pending, completed, error)
	//
	// Any of "waiting", "completed", "failed", "expired".
	Status UploadListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (UploadListParams) URLQuery added in v0.6.0

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

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

type UploadListParamsCreated added in v0.6.0

type UploadListParamsCreated struct {
	// Filter by creation date greater than or equal (UNIX epoch time)
	Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
	// Sort by creation date (asc/desc)
	//
	// Any of "asc", "desc".
	Sort string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (UploadListParamsCreated) URLQuery added in v0.6.0

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

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

type UploadListParamsStatus added in v0.6.0

type UploadListParamsStatus string

Filter by status (pending, completed, error)

const (
	UploadListParamsStatusWaiting   UploadListParamsStatus = "waiting"
	UploadListParamsStatusCompleted UploadListParamsStatus = "completed"
	UploadListParamsStatusFailed    UploadListParamsStatus = "failed"
	UploadListParamsStatusExpired   UploadListParamsStatus = "expired"
)

type UploadMultipart added in v0.17.0

type UploadMultipart struct {
	// ExpiresAt specifies when the signed part URLs expire. URLs cannot be refreshed;
	// create a new Upload after expiry.
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// PartSizeBytes specifies the size of each part except the final part, in bytes.
	PartSizeBytes int64 `json:"part_size_bytes" api:"required"`
	// Parts contains every signed upload URL in ascending part_number order. Upload
	// file slices directly to these URLs.
	Parts []UploadMultipartPart `json:"parts" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt     respjson.Field
		PartSizeBytes respjson.Field
		Parts         respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Multipart transfer details, returned only on creation for multipart Uploads.

func (UploadMultipart) RawJSON added in v0.17.0

func (r UploadMultipart) RawJSON() string

Returns the unmodified JSON received from the API

func (*UploadMultipart) UnmarshalJSON added in v0.17.0

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

type UploadMultipartPart added in v0.17.0

type UploadMultipartPart struct {
	// PartNumber specifies the one-based part number for this URL.
	PartNumber int64 `json:"part_number" api:"required"`
	// UploadUrl specifies the signed PUT URL for this part. Retry the same file slice
	// with this URL before multipart.expires_at.
	UploadURL string `json:"upload_url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		PartNumber  respjson.Field
		UploadURL   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UploadMultipartPart) RawJSON added in v0.17.0

func (r UploadMultipartPart) RawJSON() string

Returns the unmodified JSON received from the API

func (*UploadMultipartPart) UnmarshalJSON added in v0.17.0

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

type UploadNewParams added in v0.6.0

type UploadNewParams struct {
	// WorkflowId specifies the Workflow to select. Omit to use the Project default.
	// Set null to disable automatic actions. The current revision is pinned when
	// creation is accepted.
	WorkflowID param.Opt[string] `json:"workflow_id,omitzero"`
	// CreateAsset specifies whether to create an Asset after Upload completion.
	// Defaults to false. Snapshots the Project output settings, including the path
	// template. Referenced metadata must be non-empty in this request. Asset
	// processing is billed separately.
	CreateAsset param.Opt[bool] `json:"create_asset,omitzero"`
	// FileSizeBytes specifies the exact file size in bytes. Required when UploadMode
	// is omitted, auto, or multipart. Optional for explicit single mode. Must fit the
	// team's Source size limit. Single PUT supports up to 5 GiB, subject to the
	// provider's limit; multipart supports up to 5 TiB.
	FileSizeBytes param.Opt[int64] `json:"file_size_bytes,omitzero"`
	// ValidityTimeout specifies the session and signed URL lifetime in seconds. Single
	// PUT defaults to 7200 and allows 300–36000. Multipart defaults to twice the
	// transfer time at 5 Mbps plus 1800 seconds, bounded to 7200–172800; an explicit
	// value allows 300–172800. Complete before expiry. Storage credentials and
	// policies can shorten URL validity. Expired URLs cannot be refreshed.
	ValidityTimeout param.Opt[int64] `json:"validity_timeout,omitzero"`
	// Metadata allows for additional information to be attached to the upload, with a
	// maximum size of 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Optional Storage override. Omit id to use the Project default.
	// Customer-connected Storage requires path; Chunkify Storage generates its own
	// path.
	Storage UploadNewParamsStorage `json:"storage,omitzero"`
	// UploadMode specifies the transfer method. Defaults to auto. Auto chooses
	// multipart above 100 MiB and single PUT at or below 100 MiB for every Storage
	// provider. Multipart requires a provider that supports the required multipart
	// operations and signed part URLs. Provider failures return an error without
	// falling back to single PUT.
	//
	// Any of "single", "multipart", "auto".
	UploadMode UploadNewParamsUploadMode `json:"upload_mode,omitzero"`
	// contains filtered or unexported fields
}

func (UploadNewParams) MarshalJSON added in v0.6.0

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

func (*UploadNewParams) UnmarshalJSON added in v0.6.0

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

type UploadNewParamsStorage added in v0.16.3

type UploadNewParamsStorage struct {
	// Storage belonging to this Project. Omit to use the Project default.
	ID param.Opt[string] `json:"id,omitzero"`
	// Exact object key including filename, required for customer Storage and forbidden
	// for Chunkify Storage. The output base_prefix is not added. Existing keys may be
	// overwritten.
	Path param.Opt[string] `json:"path,omitzero"`
	// contains filtered or unexported fields
}

Optional Storage override. Omit id to use the Project default. Customer-connected Storage requires path; Chunkify Storage generates its own path.

func (UploadNewParamsStorage) MarshalJSON added in v0.16.3

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

func (*UploadNewParamsStorage) UnmarshalJSON added in v0.16.3

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

type UploadNewParamsUploadMode added in v0.17.0

type UploadNewParamsUploadMode string

UploadMode specifies the transfer method. Defaults to auto. Auto chooses multipart above 100 MiB and single PUT at or below 100 MiB for every Storage provider. Multipart requires a provider that supports the required multipart operations and signed part URLs. Provider failures return an error without falling back to single PUT.

const (
	UploadNewParamsUploadModeSingle    UploadNewParamsUploadMode = "single"
	UploadNewParamsUploadModeMultipart UploadNewParamsUploadMode = "multipart"
	UploadNewParamsUploadModeAuto      UploadNewParamsUploadMode = "auto"
)

type UploadNewResponseEnvelope added in v0.6.0

type UploadNewResponseEnvelope struct {
	// Data contains the response object
	Data Upload `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UploadNewResponseEnvelope) RawJSON added in v0.6.0

func (r UploadNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*UploadNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type UploadService added in v0.6.0

type UploadService struct {
	Options []option.RequestOption
}

UploadService contains methods and other services that help with interacting with the chunkify 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 NewUploadService method instead.

func NewUploadService added in v0.6.0

func NewUploadService(opts ...option.RequestOption) (r UploadService)

NewUploadService 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 (*UploadService) Complete added in v0.16.3

func (r *UploadService) Complete(ctx context.Context, token string, body UploadCompleteParams, opts ...option.RequestOption) (err error)

POST the returned completion_url before expires_at. Single-PUT Uploads send no body; multipart Uploads send every part number and storage ETag. Chunkify verifies the assembled object and atomically creates the Source and optional Asset. An Asset destination conflict returns 409 and fails the Upload without committing Source, Asset, or usage changes. Valid retries return 204 without duplicate side effects. Retry network errors, 429, and 5xx responses with bounded backoff.

func (*UploadService) Delete added in v0.6.0

func (r *UploadService) Delete(ctx context.Context, uploadID string, opts ...option.RequestOption) (err error)

Delete an upload.

func (*UploadService) Get added in v0.6.0

func (r *UploadService) Get(ctx context.Context, uploadID string, opts ...option.RequestOption) (res *Upload, err error)

Retrieve details of a specific upload by its ID, including metadata, status, and associated source.

func (*UploadService) List added in v0.6.0

Retrieve a list of all uploads with optional filtering and pagination.

func (*UploadService) ListAutoPaging added in v0.6.0

Retrieve a list of all uploads with optional filtering and pagination.

func (*UploadService) New added in v0.6.0

func (r *UploadService) New(ctx context.Context, body UploadNewParams, opts ...option.RequestOption) (res *Upload, err error)

Create an Upload session for a direct transfer to storage. Multipart creation returns every signed part URL. Retry parts with their original URLs and complete before expiry. Customer storage requires long-lived credentials and an incomplete-multipart lifecycle rule. Start a new Upload after abandoning a session.

type UploadStatus added in v0.6.0

type UploadStatus string

Current status of the upload

const (
	UploadStatusWaiting   UploadStatus = "waiting"
	UploadStatusCompleted UploadStatus = "completed"
	UploadStatusFailed    UploadStatus = "failed"
	UploadStatusExpired   UploadStatus = "expired"
)

type UploadUploadMode added in v0.17.0

type UploadUploadMode string

Resolved transfer mode for this Upload.

const (
	UploadUploadModeSingle    UploadUploadMode = "single"
	UploadUploadModeMultipart UploadUploadMode = "multipart"
)

type Webhook

type Webhook struct {
	// Unique identifier of the webhook
	ID string `json:"id" api:"required"`
	// Whether the webhook is currently enabled
	Enabled bool `json:"enabled" api:"required"`
	// Array of event types this webhook subscribes to
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Events []string `json:"events" api:"required"`
	// ID of the project this webhook belongs to
	ProjectID string `json:"project_id" api:"required"`
	// URL where webhook events will be sent
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Enabled     respjson.Field
		Events      respjson.Field
		ProjectID   respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Webhook) RawJSON added in v0.6.0

func (r Webhook) RawJSON() string

Returns the unmodified JSON received from the API

func (*Webhook) UnmarshalJSON added in v0.6.0

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

type WebhookGetResponseEnvelope added in v0.6.0

type WebhookGetResponseEnvelope struct {
	// Data contains the response object
	Data Webhook `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookGetResponseEnvelope) RawJSON added in v0.6.0

func (r WebhookGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookGetResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type WebhookListResponse added in v0.6.0

type WebhookListResponse struct {
	// Data contains the webhook items
	Data []Webhook `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing the list of all webhooks for a project

func (WebhookListResponse) RawJSON added in v0.6.0

func (r WebhookListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookListResponse) UnmarshalJSON added in v0.6.0

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

type WebhookNewParams added in v0.6.0

type WebhookNewParams struct {
	// Url is the endpoint that will receive webhook notifications, which must be a
	// valid HTTP URL.
	URL string `json:"url" api:"required"`
	// Enabled indicates whether the webhook is active.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Events specifies the types of events that will trigger the webhook.
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Events []string `json:"events,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookNewParams) MarshalJSON added in v0.6.0

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

func (*WebhookNewParams) UnmarshalJSON added in v0.6.0

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

type WebhookNewResponseEnvelope added in v0.6.0

type WebhookNewResponseEnvelope struct {
	// Data contains the response object
	Data Webhook `json:"data" api:"required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookNewResponseEnvelope) RawJSON added in v0.6.0

func (r WebhookNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookNewResponseEnvelope) UnmarshalJSON added in v0.6.0

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

type WebhookService added in v0.6.0

type WebhookService struct {
	Options []option.RequestOption
}

WebhookService contains methods and other services that help with interacting with the chunkify 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 v0.6.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.

func (*WebhookService) Delete added in v0.6.0

func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)

Permanently delete a webhook configuration. The webhook must belong to the current project. This action cannot be undone.

func (*WebhookService) Get added in v0.6.0

func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *Webhook, err error)

Retrieve details of a specific webhook configuration by its ID. The webhook must belong to the current project.

func (*WebhookService) List added in v0.6.0

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

Retrieve a list of all webhooks configured for the current project. Each webhook includes its URL, enabled status, and subscribed events.

func (*WebhookService) New added in v0.6.0

func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)

Create a new webhook for a project. The webhook will receive notifications for specified events.

func (*WebhookService) Unwrap added in v0.6.0

func (r *WebhookService) Unwrap(payload []byte, headers http.Header, opts ...option.RequestOption) (*UnwrapWebhookEvent, error)

func (*WebhookService) Update added in v0.6.0

func (r *WebhookService) Update(ctx context.Context, webhookID string, body WebhookUpdateParams, opts ...option.RequestOption) (err error)

Update the enabled status of a webhook. The webhook must belong to the current project.

type WebhookUpdateParams

type WebhookUpdateParams struct {
	// Enabled indicates whether the webhook should be enabled or disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Events specifies the types of events that will trigger the webhook.
	//
	// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
	// "source.created", "source.deleted", "upload.created", "upload.completed",
	// "upload.failed", "upload.expired", "asset.created", "asset.ready",
	// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
	// "asset.output.created", "asset.output.ready", "asset.output.failed",
	// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
	// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
	// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
	// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
	// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
	Events []string `json:"events,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookUpdateParams) MarshalJSON added in v0.6.0

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

func (*WebhookUpdateParams) UnmarshalJSON added in v0.6.0

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

type WebmVp9 added in v0.6.0

type WebmVp9 struct {
	ID constant.WebmVp9 `json:"id" default:"webm_vp9"`
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate int64 `json:"audio_bitrate"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize int64 `json:"bufsize"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels"`
	// CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower
	// values mean better quality but slower encoding, higher values mean faster
	// encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for
	// good quality, 4-6 for balanced, 6-8 for speed
	//
	// Any of "0", "1", "2", "3", "4", "5", "6", "7", "8".
	CPUUsed WebmVp9CPUUsed `json:"cpu_used"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 15 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf int64 `json:"crf"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio bool `json:"disable_audio"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo bool `json:"disable_video"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration int64 `json:"duration"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop int64 `json:"gop"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height int64 `json:"height"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate int64 `json:"maxrate"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate int64 `json:"minrate"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle bool `json:"per_title"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt WebmVp9Pixfmt `json:"pixfmt"`
	// Quality specifies the VP9 encoding quality preset. Valid values:
	//
	// - good: Balanced quality preset, good for most applications
	// - best: Best quality preset, slower encoding
	// - realtime: Fast encoding preset, suitable for live streaming
	//
	// Any of "good", "best", "realtime".
	Quality WebmVp9Quality `json:"quality"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek int64 `json:"seek"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate int64 `json:"video_bitrate"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		AudioBitrate respjson.Field
		Bufsize      respjson.Field
		Channels     respjson.Field
		CPUUsed      respjson.Field
		Crf          respjson.Field
		DisableAudio respjson.Field
		DisableVideo respjson.Field
		Duration     respjson.Field
		Framerate    respjson.Field
		Gop          respjson.Field
		Height       respjson.Field
		Maxrate      respjson.Field
		Minrate      respjson.Field
		PerTitle     respjson.Field
		Pixfmt       respjson.Field
		Quality      respjson.Field
		Seek         respjson.Field
		VideoBitrate respjson.Field
		Width        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebmVp9) RawJSON added in v0.6.0

func (r WebmVp9) RawJSON() string

Returns the unmodified JSON received from the API

func (WebmVp9) ToParam added in v0.6.0

func (r WebmVp9) ToParam() WebmVp9Param

ToParam converts this WebmVp9 to a WebmVp9Param.

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 WebmVp9Param.Overrides()

func (*WebmVp9) UnmarshalJSON added in v0.6.0

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

type WebmVp9CPUUsed added in v0.6.0

type WebmVp9CPUUsed string

CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower values mean better quality but slower encoding, higher values mean faster encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for good quality, 4-6 for balanced, 6-8 for speed

const (
	WebmVp9CPUUsed0 WebmVp9CPUUsed = "0"
	WebmVp9CPUUsed1 WebmVp9CPUUsed = "1"
	WebmVp9CPUUsed2 WebmVp9CPUUsed = "2"
	WebmVp9CPUUsed3 WebmVp9CPUUsed = "3"
	WebmVp9CPUUsed4 WebmVp9CPUUsed = "4"
	WebmVp9CPUUsed5 WebmVp9CPUUsed = "5"
	WebmVp9CPUUsed6 WebmVp9CPUUsed = "6"
	WebmVp9CPUUsed7 WebmVp9CPUUsed = "7"
	WebmVp9CPUUsed8 WebmVp9CPUUsed = "8"
)

type WebmVp9Param added in v0.6.0

type WebmVp9Param struct {
	// AudioBitrate specifies the audio bitrate in bits per second. Must be between
	// 32Kbps and 512Kbps.
	AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
	// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
	// 50Mbps.
	Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
	// Crf (Constant Rate Factor) controls the quality of the output video. Lower
	// values mean better quality but larger file size. Range: 15 to 35. Recommended
	// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
	// quality.
	Crf param.Opt[int64] `json:"crf,omitzero"`
	// DisableAudio indicates whether to disable audio processing.
	DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
	// DisableVideo indicates whether to disable video processing.
	DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
	// Duration specifies the duration to process in seconds. Must be a positive value.
	Duration param.Opt[int64] `json:"duration,omitzero"`
	// Framerate specifies the output video frame rate. Must be greater than zero and
	// at most 240 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
	// frames.
	Gop param.Opt[int64] `json:"gop,omitzero"`
	// Height specifies the output video height in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Maxrate specifies the maximum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
	// Minrate specifies the minimum video bitrate in bits per second. Must be between
	// 100Kbps and 50Mbps.
	Minrate param.Opt[int64] `json:"minrate,omitzero"`
	// Enables per-title optimization. Disabled by default. Set it to true to let
	// Chunkify select rate control automatically. When enabled, explicit rate-control
	// fields cannot be provided. For HLS outputs, either audio_bitrate or
	// video_bitrate is required when per-title optimization is disabled or omitted.
	PerTitle param.Opt[bool] `json:"per_title,omitzero"`
	// Seek specifies the timestamp to start processing from (in seconds). Must be a
	// positive value.
	Seek param.Opt[int64] `json:"seek,omitzero"`
	// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
	// bps and 100 Mbps.
	VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
	// Width specifies the output video width in pixels. Must be between -2 and 7680.
	// Use -2 for automatic calculation while maintaining aspect ratio.
	Width param.Opt[int64] `json:"width,omitzero"`
	// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
	// (stereo), 5 (5.1), 7 (7.1)
	//
	// Any of 1, 2, 5, 7.
	Channels int64 `json:"channels,omitzero"`
	// CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower
	// values mean better quality but slower encoding, higher values mean faster
	// encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for
	// good quality, 4-6 for balanced, 6-8 for speed
	//
	// Any of "0", "1", "2", "3", "4", "5", "6", "7", "8".
	CPUUsed WebmVp9CPUUsed `json:"cpu_used,omitzero"`
	// PixFmt specifies the pixel format. Valid value: yuv420p
	//
	// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
	// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
	// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
	// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
	// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
	Pixfmt WebmVp9Pixfmt `json:"pixfmt,omitzero"`
	// Quality specifies the VP9 encoding quality preset. Valid values:
	//
	// - good: Balanced quality preset, good for most applications
	// - best: Best quality preset, slower encoding
	// - realtime: Fast encoding preset, suitable for live streaming
	//
	// Any of "good", "best", "realtime".
	Quality WebmVp9Quality `json:"quality,omitzero"`
	// This field can be elided, and will marshal its zero value as "webm_vp9".
	ID constant.WebmVp9 `json:"id" default:"webm_vp9"`
	// contains filtered or unexported fields
}

The property ID is required.

func (WebmVp9Param) MarshalJSON added in v0.6.0

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

func (*WebmVp9Param) UnmarshalJSON added in v0.6.0

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

type WebmVp9Pixfmt added in v0.6.0

type WebmVp9Pixfmt string

PixFmt specifies the pixel format. Valid value: yuv420p

const (
	WebmVp9PixfmtYuv410p     WebmVp9Pixfmt = "yuv410p"
	WebmVp9PixfmtYuv411p     WebmVp9Pixfmt = "yuv411p"
	WebmVp9PixfmtYuv420p     WebmVp9Pixfmt = "yuv420p"
	WebmVp9PixfmtYuv422p     WebmVp9Pixfmt = "yuv422p"
	WebmVp9PixfmtYuv440p     WebmVp9Pixfmt = "yuv440p"
	WebmVp9PixfmtYuv444p     WebmVp9Pixfmt = "yuv444p"
	WebmVp9PixfmtYuvJ411p    WebmVp9Pixfmt = "yuvJ411p"
	WebmVp9PixfmtYuvJ420p    WebmVp9Pixfmt = "yuvJ420p"
	WebmVp9PixfmtYuvJ422p    WebmVp9Pixfmt = "yuvJ422p"
	WebmVp9PixfmtYuvJ440p    WebmVp9Pixfmt = "yuvJ440p"
	WebmVp9PixfmtYuvJ444p    WebmVp9Pixfmt = "yuvJ444p"
	WebmVp9PixfmtYuv420p10le WebmVp9Pixfmt = "yuv420p10le"
	WebmVp9PixfmtYuv422p10le WebmVp9Pixfmt = "yuv422p10le"
	WebmVp9PixfmtYuv440p10le WebmVp9Pixfmt = "yuv440p10le"
	WebmVp9PixfmtYuv444p10le WebmVp9Pixfmt = "yuv444p10le"
	WebmVp9PixfmtYuv420p12le WebmVp9Pixfmt = "yuv420p12le"
	WebmVp9PixfmtYuv422p12le WebmVp9Pixfmt = "yuv422p12le"
	WebmVp9PixfmtYuv440p12le WebmVp9Pixfmt = "yuv440p12le"
	WebmVp9PixfmtYuv444p12le WebmVp9Pixfmt = "yuv444p12le"
	WebmVp9PixfmtYuv420p10be WebmVp9Pixfmt = "yuv420p10be"
	WebmVp9PixfmtYuv422p10be WebmVp9Pixfmt = "yuv422p10be"
	WebmVp9PixfmtYuv440p10be WebmVp9Pixfmt = "yuv440p10be"
	WebmVp9PixfmtYuv444p10be WebmVp9Pixfmt = "yuv444p10be"
	WebmVp9PixfmtYuv420p12be WebmVp9Pixfmt = "yuv420p12be"
	WebmVp9PixfmtYuv422p12be WebmVp9Pixfmt = "yuv422p12be"
	WebmVp9PixfmtYuv440p12be WebmVp9Pixfmt = "yuv440p12be"
	WebmVp9PixfmtYuv444p12be WebmVp9Pixfmt = "yuv444p12be"
)

type WebmVp9Quality added in v0.6.0

type WebmVp9Quality string

Quality specifies the VP9 encoding quality preset. Valid values:

- good: Balanced quality preset, good for most applications - best: Best quality preset, slower encoding - realtime: Fast encoding preset, suitable for live streaming

const (
	WebmVp9QualityGood     WebmVp9Quality = "good"
	WebmVp9QualityBest     WebmVp9Quality = "best"
	WebmVp9QualityRealtime WebmVp9Quality = "realtime"
)

type Workflow added in v0.17.0

type Workflow struct {
	// Unique Workflow ID.
	ID string `json:"id" api:"required"`
	// When the Workflow was archived, or null if it is available for selection.
	// Archiving stops new runs; accepted actions finish.
	ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
	// When the Workflow was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Name specifies the Workflow name. Use 1 to 128 characters.
	Name string `json:"name" api:"required"`
	// Current definition revision. Starts at 1 and increases when rules are replaced.
	Revision int64 `json:"revision" api:"required"`
	// Rules specifies the event subscriptions and actions in this definition. Provide
	// exactly one asset.ready rule and up to 15 connected rules, with at most 32
	// actions and 65536 encoded bytes across all rules. Array order affects display
	// only.
	Rules []WorkflowRule `json:"rules" api:"required"`
	// SchemaVersion specifies the Workflow definition format. The supported version
	// is 1.
	SchemaVersion int64 `json:"schema_version" api:"required"`
	// When the Workflow was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		ArchivedAt    respjson.Field
		CreatedAt     respjson.Field
		Name          respjson.Field
		Revision      respjson.Field
		Rules         respjson.Field
		SchemaVersion respjson.Field
		UpdatedAt     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A reusable definition of actions triggered by Asset events.

func (Workflow) RawJSON added in v0.17.0

func (r Workflow) RawJSON() string

Returns the unmodified JSON received from the API

func (*Workflow) UnmarshalJSON added in v0.17.0

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

type WorkflowActionUnion added in v0.17.0

type WorkflowActionUnion struct {
	ID string `json:"id"`
	// This field is a union of [WorkflowStaticParamsResp], [WorkflowCaptionParams],
	// [WorkflowTranslationParamsResp], [WorkflowThumbnailParamsResp], [any]
	Params WorkflowActionUnionParams `json:"params"`
	// Any of "create_static_rendition", "create_caption", "translate_caption",
	// "create_thumbnails", "create_transcript".
	Type string `json:"type"`
	// This field is from variant [WorkflowCaptionAction].
	TranscriptID WorkflowCaptionActionTranscriptID `json:"transcript_id"`
	// This field is from variant [WorkflowTranslationAction].
	CaptionID WorkflowTranslationActionCaptionID `json:"caption_id"`
	JSON      struct {
		ID           respjson.Field
		Params       respjson.Field
		Type         respjson.Field
		TranscriptID respjson.Field
		CaptionID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WorkflowActionUnion contains all possible properties and values from WorkflowStaticAction, WorkflowCaptionAction, WorkflowTranslationAction, WorkflowThumbnailAction, WorkflowTranscriptAction.

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

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

func (WorkflowActionUnion) AsAny added in v0.17.0

func (u WorkflowActionUnion) AsAny() anyWorkflowAction

Use the following switch statement to find the correct variant

switch variant := WorkflowActionUnion.AsAny().(type) {
case chunkify.WorkflowStaticAction:
case chunkify.WorkflowCaptionAction:
case chunkify.WorkflowTranslationAction:
case chunkify.WorkflowThumbnailAction:
case chunkify.WorkflowTranscriptAction:
default:
  fmt.Errorf("no variant present")
}

func (WorkflowActionUnion) AsCreateCaption added in v0.17.0

func (u WorkflowActionUnion) AsCreateCaption() (v WorkflowCaptionAction)

func (WorkflowActionUnion) AsCreateStaticRendition added in v0.17.0

func (u WorkflowActionUnion) AsCreateStaticRendition() (v WorkflowStaticAction)

func (WorkflowActionUnion) AsCreateThumbnails added in v0.17.0

func (u WorkflowActionUnion) AsCreateThumbnails() (v WorkflowThumbnailAction)

func (WorkflowActionUnion) AsCreateTranscript added in v0.17.0

func (u WorkflowActionUnion) AsCreateTranscript() (v WorkflowTranscriptAction)

func (WorkflowActionUnion) AsTranslateCaption added in v0.17.0

func (u WorkflowActionUnion) AsTranslateCaption() (v WorkflowTranslationAction)

func (WorkflowActionUnion) RawJSON added in v0.17.0

func (u WorkflowActionUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowActionUnion) ToParam added in v0.17.0

ToParam converts this WorkflowActionUnion to a WorkflowActionUnionParam.

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 WorkflowActionUnionParam.Overrides()

func (*WorkflowActionUnion) UnmarshalJSON added in v0.17.0

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

type WorkflowActionUnionParam added in v0.17.0

type WorkflowActionUnionParam struct {
	OfCreateStaticRendition *WorkflowStaticActionParam      `json:",omitzero,inline"`
	OfCreateCaption         *WorkflowCaptionActionParam     `json:",omitzero,inline"`
	OfTranslateCaption      *WorkflowTranslationActionParam `json:",omitzero,inline"`
	OfCreateThumbnails      *WorkflowThumbnailActionParam   `json:",omitzero,inline"`
	OfCreateTranscript      *WorkflowTranscriptActionParam  `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 WorkflowActionParamOfCreateCaption added in v0.17.0

func WorkflowActionParamOfCreateCaption(id string, params WorkflowCaptionParams) WorkflowActionUnionParam

func WorkflowActionParamOfCreateStaticRendition added in v0.17.0

func WorkflowActionParamOfCreateStaticRendition(id string, params WorkflowStaticParams) WorkflowActionUnionParam

func WorkflowActionParamOfCreateThumbnails added in v0.17.0

func WorkflowActionParamOfCreateThumbnails(id string, params WorkflowThumbnailParams) WorkflowActionUnionParam

func WorkflowActionParamOfCreateTranscript added in v0.17.0

func WorkflowActionParamOfCreateTranscript(id string, params any) WorkflowActionUnionParam

func WorkflowActionParamOfTranslateCaption added in v0.17.0

func WorkflowActionParamOfTranslateCaption(captionID WorkflowTranslationActionCaptionIDParam, id string, params WorkflowTranslationParams) WorkflowActionUnionParam

func (WorkflowActionUnionParam) GetCaptionID added in v0.17.0

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

func (WorkflowActionUnionParam) GetID added in v0.17.0

func (u WorkflowActionUnionParam) GetID() *string

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

func (WorkflowActionUnionParam) GetParams added in v0.17.0

func (u WorkflowActionUnionParam) GetParams() (res workflowActionUnionParamParams)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (WorkflowActionUnionParam) GetTranscriptID added in v0.17.0

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

func (WorkflowActionUnionParam) GetType added in v0.17.0

func (u WorkflowActionUnionParam) GetType() *string

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

func (WorkflowActionUnionParam) MarshalJSON added in v0.17.0

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

func (*WorkflowActionUnionParam) UnmarshalJSON added in v0.17.0

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

type WorkflowActionUnionParams added in v0.17.0

type WorkflowActionUnionParams struct {
	// This field will be present if the value is a [WorkflowCaptionParams] instead of
	// an object.
	OfWorkflowCaptions WorkflowCaptionParams `json:",inline"`
	// This field will be present if the value is a [any] instead of an object.
	OfWorkflowTranscriptActions any `json:",inline"`
	// This field is from variant [WorkflowStaticParamsResp].
	Resolution WorkflowStaticParamsResolution `json:"resolution"`
	// This field is from variant [WorkflowTranslationParamsResp].
	LanguageCode WorkflowTranslationParamsLanguageCode `json:"language_code"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Count int64 `json:"count"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Format WorkflowThumbnailParamsFormat `json:"format"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Metadata map[string]string `json:"metadata"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Output WorkflowThumbnailParamsOutput `json:"output"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Range WorkflowThumbnailParamsRangeResp `json:"range"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Size int64 `json:"size"`
	// This field is from variant [WorkflowThumbnailParamsResp].
	Timestamps []float64 `json:"timestamps"`
	JSON       struct {
		OfWorkflowCaptions          respjson.Field
		OfWorkflowTranscriptActions respjson.Field
		Resolution                  respjson.Field
		LanguageCode                respjson.Field
		Count                       respjson.Field
		Format                      respjson.Field
		Metadata                    respjson.Field
		Output                      respjson.Field
		Range                       respjson.Field
		Size                        respjson.Field
		Timestamps                  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

WorkflowActionUnionParams is an implicit subunion of WorkflowActionUnion. WorkflowActionUnionParams provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the WorkflowActionUnion.

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

func (*WorkflowActionUnionParams) UnmarshalJSON added in v0.17.0

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

type WorkflowCaptionAction added in v0.17.0

type WorkflowCaptionAction struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Params specifies caption generation settings. Pass an empty object.
	Params WorkflowCaptionParams `json:"params" api:"required"`
	// Type specifies the action to perform. Must be create_caption.
	Type constant.CreateCaption `json:"type" default:"create_caption"`
	// TranscriptId binds caption publication to the transcript in the triggering
	// event. Use it only when connected to create_transcript. When omitted, creates or
	// reuses the Asset’s original transcript.
	TranscriptID WorkflowCaptionActionTranscriptID `json:"transcript_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Params       respjson.Field
		Type         respjson.Field
		TranscriptID respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Generates or reuses original captions and their transcript from the Asset's speech.

func (WorkflowCaptionAction) RawJSON added in v0.17.0

func (r WorkflowCaptionAction) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowCaptionAction) ToParam added in v0.17.0

ToParam converts this WorkflowCaptionAction to a WorkflowCaptionActionParam.

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 WorkflowCaptionActionParam.Overrides()

func (*WorkflowCaptionAction) UnmarshalJSON added in v0.17.0

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

type WorkflowCaptionActionParam added in v0.17.0

type WorkflowCaptionActionParam struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Params specifies caption generation settings. Pass an empty object.
	Params WorkflowCaptionParams `json:"params,omitzero" api:"required"`
	// TranscriptId binds caption publication to the transcript in the triggering
	// event. Use it only when connected to create_transcript. When omitted, creates or
	// reuses the Asset’s original transcript.
	TranscriptID WorkflowCaptionActionTranscriptIDParam `json:"transcript_id,omitzero"`
	// Type specifies the action to perform. Must be create_caption.
	//
	// This field can be elided, and will marshal its zero value as "create_caption".
	Type constant.CreateCaption `json:"type" default:"create_caption"`
	// contains filtered or unexported fields
}

Generates or reuses original captions and their transcript from the Asset's speech.

The properties ID, Params, Type are required.

func (WorkflowCaptionActionParam) MarshalJSON added in v0.17.0

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

func (*WorkflowCaptionActionParam) UnmarshalJSON added in v0.17.0

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

type WorkflowCaptionActionTranscriptID added in v0.17.0

type WorkflowCaptionActionTranscriptID struct {
	// From specifies where to read the input output ID. Use event.output.id to consume
	// the output in the triggering asset.output.ready event.
	//
	// Any of "event.output.id".
	From string `json:"from" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

TranscriptId binds caption publication to the transcript in the triggering event. Use it only when connected to create_transcript. When omitted, creates or reuses the Asset’s original transcript.

func (WorkflowCaptionActionTranscriptID) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*WorkflowCaptionActionTranscriptID) UnmarshalJSON added in v0.17.0

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

type WorkflowCaptionActionTranscriptIDParam added in v0.17.0

type WorkflowCaptionActionTranscriptIDParam struct {
	// From specifies where to read the input output ID. Use event.output.id to consume
	// the output in the triggering asset.output.ready event.
	//
	// Any of "event.output.id".
	From string `json:"from,omitzero" api:"required"`
	// contains filtered or unexported fields
}

TranscriptId binds caption publication to the transcript in the triggering event. Use it only when connected to create_transcript. When omitted, creates or reuses the Asset’s original transcript.

The property From is required.

func (WorkflowCaptionActionTranscriptIDParam) MarshalJSON added in v0.17.0

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

func (*WorkflowCaptionActionTranscriptIDParam) UnmarshalJSON added in v0.17.0

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

type WorkflowCaptionParams added in v0.17.0

type WorkflowCaptionParams = any

type WorkflowGetResponseEnvelope added in v0.17.0

type WorkflowGetResponseEnvelope struct {
	// The requested Workflow.
	Data Workflow `json:"data" api:"required"`
	// Status of the API request. Always success for this response.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing one Workflow.

func (WorkflowGetResponseEnvelope) RawJSON added in v0.17.0

func (r WorkflowGetResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*WorkflowGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type WorkflowListParams added in v0.17.0

type WorkflowListParams struct {
	// Archived specifies whether to include archived Workflows. Defaults to false.
	Archived param.Opt[bool] `query:"archived,omitzero" json:"-"`
	// Limit specifies the maximum number of results to return. Accepts 1 to 100.
	// Defaults to 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Offset specifies the number of matching results to skip. Must be at least 0.
	// Defaults to 0.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WorkflowListParams) URLQuery added in v0.17.0

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

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

type WorkflowNewParams added in v0.17.0

type WorkflowNewParams struct {
	// Name specifies the Workflow name. Use 1 to 128 characters.
	Name string `json:"name" api:"required"`
	// Rules specifies the event subscriptions and actions in this definition. Provide
	// exactly one asset.ready rule and up to 15 connected rules, with at most 32
	// actions and 65536 encoded bytes across all rules. Array order affects display
	// only.
	Rules []WorkflowRuleParam `json:"rules,omitzero" api:"required"`
	// SchemaVersion specifies the Workflow definition format. The supported version
	// is 1.
	//
	// Any of 1.
	SchemaVersion int64 `json:"schema_version,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (WorkflowNewParams) MarshalJSON added in v0.17.0

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

func (*WorkflowNewParams) UnmarshalJSON added in v0.17.0

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

type WorkflowNewResponseEnvelope added in v0.17.0

type WorkflowNewResponseEnvelope struct {
	// The requested Workflow.
	Data Workflow `json:"data" api:"required"`
	// Status of the API request. Always success for this response.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing one Workflow.

func (WorkflowNewResponseEnvelope) RawJSON added in v0.17.0

func (r WorkflowNewResponseEnvelope) RawJSON() string

Returns the unmodified JSON received from the API

func (*WorkflowNewResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type WorkflowRevision added in v0.17.0

type WorkflowRevision struct {
	// When this Workflow revision was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Definition revision number, starting at 1.
	Revision int64 `json:"revision" api:"required"`
	// Rules specifies the event subscriptions and actions in this definition. Provide
	// exactly one asset.ready rule and up to 15 connected rules, with at most 32
	// actions and 65536 encoded bytes across all rules. Array order affects display
	// only.
	Rules []WorkflowRule `json:"rules" api:"required"`
	// SchemaVersion specifies the Workflow definition format. The supported version
	// is 1.
	SchemaVersion int64 `json:"schema_version" api:"required"`
	// ID of the Workflow that owns this revision.
	WorkflowID string `json:"workflow_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt     respjson.Field
		Revision      respjson.Field
		Rules         respjson.Field
		SchemaVersion respjson.Field
		WorkflowID    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An immutable Workflow definition pinned to Assets and Uploads at creation.

func (WorkflowRevision) RawJSON added in v0.17.0

func (r WorkflowRevision) RawJSON() string

Returns the unmodified JSON received from the API

func (*WorkflowRevision) UnmarshalJSON added in v0.17.0

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

type WorkflowRevisionGetParams added in v0.17.0

type WorkflowRevisionGetParams struct {
	WorkflowID string `path:"workflowId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type WorkflowRevisionGetResponseEnvelope added in v0.17.0

type WorkflowRevisionGetResponseEnvelope struct {
	// The requested Workflow revision.
	Data WorkflowRevision `json:"data" api:"required"`
	// Status of the API request. Always success for this response.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing one Workflow revision.

func (WorkflowRevisionGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*WorkflowRevisionGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type WorkflowRevisionService added in v0.17.0

type WorkflowRevisionService struct {
	Options []option.RequestOption
}

WorkflowRevisionService contains methods and other services that help with interacting with the chunkify 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 NewWorkflowRevisionService method instead.

func NewWorkflowRevisionService added in v0.17.0

func NewWorkflowRevisionService(opts ...option.RequestOption) (r WorkflowRevisionService)

NewWorkflowRevisionService 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 (*WorkflowRevisionService) Get added in v0.17.0

Retrieve an immutable definition revision, including revisions of archived Workflows.

type WorkflowRule added in v0.17.0

type WorkflowRule struct {
	// Id specifies a stable rule key, unique within this Workflow definition. Use 1 to
	// 64 characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Actions specifies the work to start when the rule matches. Actions can run
	// concurrently; array order does not define execution order. Provide 1 to 32
	// actions per rule, with at most 32 across the definition.
	Actions []WorkflowActionUnion `json:"actions" api:"required"`
	// Event specifies when this rule starts. Use asset.ready for the single starting
	// rule. Output ready events require an origin caption or static rendition action
	// in this Workflow.
	//
	// Any of "asset.ready", "asset.output.ready".
	Event WorkflowRuleEvent `json:"event" api:"required"`
	// Origin specifies the action whose ready output starts this rule. Required for
	// asset.output.ready; omit it for asset.ready. Translation steps must connect to a
	// create_caption action. References must point to a compatible action in this
	// definition and must not form a cycle.
	Origin WorkflowRuleOrigin `json:"origin"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Actions     respjson.Field
		Event       respjson.Field
		Origin      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A starting or connected step with one or more independent actions.

func (WorkflowRule) RawJSON added in v0.17.0

func (r WorkflowRule) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowRule) ToParam added in v0.17.0

func (r WorkflowRule) ToParam() WorkflowRuleParam

ToParam converts this WorkflowRule to a WorkflowRuleParam.

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 WorkflowRuleParam.Overrides()

func (*WorkflowRule) UnmarshalJSON added in v0.17.0

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

type WorkflowRuleEvent added in v0.17.0

type WorkflowRuleEvent string

Event specifies when this rule starts. Use asset.ready for the single starting rule. Output ready events require an origin caption or static rendition action in this Workflow.

const (
	WorkflowRuleEventAssetReady       WorkflowRuleEvent = "asset.ready"
	WorkflowRuleEventAssetOutputReady WorkflowRuleEvent = "asset.output.ready"
)

type WorkflowRuleOrigin added in v0.17.0

type WorkflowRuleOrigin struct {
	// ActionId specifies the ID of the producing action within that rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ActionID string `json:"action_id" api:"required"`
	// RuleId specifies the ID of the rule containing the producing action. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	RuleID string `json:"rule_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActionID    respjson.Field
		RuleID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Origin specifies the action whose ready output starts this rule. Required for asset.output.ready; omit it for asset.ready. Translation steps must connect to a create_caption action. References must point to a compatible action in this definition and must not form a cycle.

func (WorkflowRuleOrigin) RawJSON added in v0.17.0

func (r WorkflowRuleOrigin) RawJSON() string

Returns the unmodified JSON received from the API

func (*WorkflowRuleOrigin) UnmarshalJSON added in v0.17.0

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

type WorkflowRuleOriginParam added in v0.17.0

type WorkflowRuleOriginParam struct {
	// ActionId specifies the ID of the producing action within that rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ActionID string `json:"action_id" api:"required"`
	// RuleId specifies the ID of the rule containing the producing action. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	RuleID string `json:"rule_id" api:"required"`
	// contains filtered or unexported fields
}

Origin specifies the action whose ready output starts this rule. Required for asset.output.ready; omit it for asset.ready. Translation steps must connect to a create_caption action. References must point to a compatible action in this definition and must not form a cycle.

The properties ActionID, RuleID are required.

func (WorkflowRuleOriginParam) MarshalJSON added in v0.17.0

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

func (*WorkflowRuleOriginParam) UnmarshalJSON added in v0.17.0

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

type WorkflowRuleParam added in v0.17.0

type WorkflowRuleParam struct {
	// Id specifies a stable rule key, unique within this Workflow definition. Use 1 to
	// 64 characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Actions specifies the work to start when the rule matches. Actions can run
	// concurrently; array order does not define execution order. Provide 1 to 32
	// actions per rule, with at most 32 across the definition.
	Actions []WorkflowActionUnionParam `json:"actions,omitzero" api:"required"`
	// Event specifies when this rule starts. Use asset.ready for the single starting
	// rule. Output ready events require an origin caption or static rendition action
	// in this Workflow.
	//
	// Any of "asset.ready", "asset.output.ready".
	Event WorkflowRuleEvent `json:"event,omitzero" api:"required"`
	// Origin specifies the action whose ready output starts this rule. Required for
	// asset.output.ready; omit it for asset.ready. Translation steps must connect to a
	// create_caption action. References must point to a compatible action in this
	// definition and must not form a cycle.
	Origin WorkflowRuleOriginParam `json:"origin,omitzero"`
	// contains filtered or unexported fields
}

A starting or connected step with one or more independent actions.

The properties ID, Actions, Event are required.

func (WorkflowRuleParam) MarshalJSON added in v0.17.0

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

func (*WorkflowRuleParam) UnmarshalJSON added in v0.17.0

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

type WorkflowRun added in v0.17.0

type WorkflowRun struct {
	// Unique Workflow run ID.
	ID string `json:"id" api:"required"`
	// Counts of action outcomes in this run. Reused actions are included in completed.
	Actions WorkflowRunActions `json:"actions" api:"required"`
	// AssetExecutionStatus specifies the combined status of this revision for the
	// Asset across retained runs. Any failed action or run makes it failed. Pending or
	// active work, or an Asset still preparing for an unarchived Workflow, makes it
	// running. Otherwise it is completed.
	//
	// Any of "pending", "running", "completed", "failed", "cancelled".
	AssetExecutionStatus WorkflowRunAssetExecutionStatus `json:"asset_execution_status" api:"required"`
	// ID of the Asset processed by this run.
	AssetID string `json:"asset_id" api:"required"`
	// When the run completed, failed, or was cancelled. Null while the run is pending
	// or running.
	CompletedAt time.Time `json:"completed_at" api:"required" format:"date-time"`
	// When the run was created.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Event specifies the Asset lifecycle event that triggered this run, or manual
	// when the Asset was updated to a newer revision. Action details are available
	// from the run's actions endpoint.
	Event string `json:"event" api:"required"`
	// EventId specifies the event that triggered this run. Null when the Asset was
	// updated to a newer revision.
	EventID string `json:"event_id" api:"required"`
	// Pinned Workflow revision used by this run.
	Revision int64 `json:"revision" api:"required"`
	// ID of the first run in this event chain. Equals id when this run starts the
	// chain.
	RootRunID string `json:"root_run_id" api:"required"`
	// Current status of this event run, based on its own actions.
	//
	// Any of "pending", "running", "completed", "failed", "cancelled".
	Status WorkflowRunStatus `json:"status" api:"required"`
	// When the run was last updated.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// ID of the Workflow executed by this run.
	WorkflowID string `json:"workflow_id" api:"required"`
	// Reason the run failed. Omitted when no failure message is available.
	Error string `json:"error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                   respjson.Field
		Actions              respjson.Field
		AssetExecutionStatus respjson.Field
		AssetID              respjson.Field
		CompletedAt          respjson.Field
		CreatedAt            respjson.Field
		Event                respjson.Field
		EventID              respjson.Field
		Revision             respjson.Field
		RootRunID            respjson.Field
		Status               respjson.Field
		UpdatedAt            respjson.Field
		WorkflowID           respjson.Field
		Error                respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

One execution of Workflow rules for an Asset, started by an event or by updating to a newer revision.

func (WorkflowRun) RawJSON added in v0.17.0

func (r WorkflowRun) RawJSON() string

Returns the unmodified JSON received from the API

func (*WorkflowRun) UnmarshalJSON added in v0.17.0

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

type WorkflowRunActionGetParams added in v0.17.0

type WorkflowRunActionGetParams struct {
	WorkflowID string `path:"workflowId" api:"required" json:"-"`
	RunID      string `path:"runId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type WorkflowRunActionGetResponseEnvelope added in v0.17.0

type WorkflowRunActionGetResponseEnvelope struct {
	// The requested Asset action run.
	Data AssetActionRun `json:"data" api:"required"`
	// Status of the API request. Always success for this response.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing one Asset action run.

func (WorkflowRunActionGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*WorkflowRunActionGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type WorkflowRunActionListParams added in v0.17.0

type WorkflowRunActionListParams struct {
	WorkflowID string `path:"workflowId" api:"required" json:"-"`
	// AssetId specifies the Asset whose results to return. Omit it to include all
	// Assets.
	AssetID param.Opt[string] `query:"asset_id,omitzero" json:"-"`
	// Limit specifies the maximum number of results to return. Accepts 1 to 100.
	// Defaults to 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Offset specifies the number of matching results to skip. Must be at least 0.
	// Defaults to 0.
	Offset  param.Opt[int64]                   `query:"offset,omitzero" json:"-"`
	Created WorkflowRunActionListParamsCreated `query:"created,omitzero" json:"-"`
	// Status specifies the action status to filter by. Omit it to include all
	// statuses.
	//
	// Any of "pending", "running", "waiting", "completed", "failed", "skipped",
	// "cancelled".
	Status WorkflowRunActionListParamsStatus `query:"status,omitzero" json:"-"`
	// Type specifies the action type to filter by. Omit it to include all action
	// types.
	//
	// Any of "create_static_rendition", "create_caption", "create_transcript",
	// "translate_caption".
	Type WorkflowRunActionListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WorkflowRunActionListParams) URLQuery added in v0.17.0

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

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

type WorkflowRunActionListParamsCreated added in v0.17.0

type WorkflowRunActionListParamsCreated struct {
	// Created at or after this Unix timestamp in seconds.
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Created at or before this Unix timestamp in seconds.
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WorkflowRunActionListParamsCreated) URLQuery added in v0.17.0

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

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

type WorkflowRunActionListParamsStatus added in v0.17.0

type WorkflowRunActionListParamsStatus string

Status specifies the action status to filter by. Omit it to include all statuses.

const (
	WorkflowRunActionListParamsStatusPending   WorkflowRunActionListParamsStatus = "pending"
	WorkflowRunActionListParamsStatusRunning   WorkflowRunActionListParamsStatus = "running"
	WorkflowRunActionListParamsStatusWaiting   WorkflowRunActionListParamsStatus = "waiting"
	WorkflowRunActionListParamsStatusCompleted WorkflowRunActionListParamsStatus = "completed"
	WorkflowRunActionListParamsStatusFailed    WorkflowRunActionListParamsStatus = "failed"
	WorkflowRunActionListParamsStatusSkipped   WorkflowRunActionListParamsStatus = "skipped"
	WorkflowRunActionListParamsStatusCancelled WorkflowRunActionListParamsStatus = "cancelled"
)

type WorkflowRunActionListParamsType added in v0.17.0

type WorkflowRunActionListParamsType string

Type specifies the action type to filter by. Omit it to include all action types.

const (
	WorkflowRunActionListParamsTypeCreateStaticRendition WorkflowRunActionListParamsType = "create_static_rendition"
	WorkflowRunActionListParamsTypeCreateCaption         WorkflowRunActionListParamsType = "create_caption"
	WorkflowRunActionListParamsTypeCreateTranscript      WorkflowRunActionListParamsType = "create_transcript"
	WorkflowRunActionListParamsTypeTranslateCaption      WorkflowRunActionListParamsType = "translate_caption"
)

type WorkflowRunActionService added in v0.17.0

type WorkflowRunActionService struct {
	Options []option.RequestOption
}

WorkflowRunActionService contains methods and other services that help with interacting with the chunkify 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 NewWorkflowRunActionService method instead.

func NewWorkflowRunActionService added in v0.17.0

func NewWorkflowRunActionService(opts ...option.RequestOption) (r WorkflowRunActionService)

NewWorkflowRunActionService 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 (*WorkflowRunActionService) Get added in v0.17.0

Retrieve one action execution in a retained Workflow run, including its resolved inputs, status, and result.

func (*WorkflowRunActionService) List added in v0.17.0

List actions in a retained Workflow run, newest first. Includes resolved inputs, statuses, output references, and skip or failure reasons.

func (*WorkflowRunActionService) ListAutoPaging added in v0.17.0

List actions in a retained Workflow run, newest first. Includes resolved inputs, statuses, output references, and skip or failure reasons.

type WorkflowRunActions added in v0.17.0

type WorkflowRunActions struct {
	// Number of actions cancelled before completion.
	Cancelled int64 `json:"cancelled" api:"required"`
	// Number of actions that completed successfully, including reused outputs.
	Completed int64 `json:"completed" api:"required"`
	// Number of actions that failed.
	Failed int64 `json:"failed" api:"required"`
	// Number of completed actions that reused an existing output. Included in
	// completed.
	Reused int64 `json:"reused" api:"required"`
	// Number of actions skipped without producing an output.
	Skipped int64 `json:"skipped" api:"required"`
	// Total number of actions in the run, including unfinished actions.
	Total int64 `json:"total" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cancelled   respjson.Field
		Completed   respjson.Field
		Failed      respjson.Field
		Reused      respjson.Field
		Skipped     respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Counts of action outcomes in this run. Reused actions are included in completed.

func (WorkflowRunActions) RawJSON added in v0.17.0

func (r WorkflowRunActions) RawJSON() string

Returns the unmodified JSON received from the API

func (*WorkflowRunActions) UnmarshalJSON added in v0.17.0

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

type WorkflowRunAssetExecutionStatus added in v0.17.0

type WorkflowRunAssetExecutionStatus string

AssetExecutionStatus specifies the combined status of this revision for the Asset across retained runs. Any failed action or run makes it failed. Pending or active work, or an Asset still preparing for an unarchived Workflow, makes it running. Otherwise it is completed.

const (
	WorkflowRunAssetExecutionStatusPending   WorkflowRunAssetExecutionStatus = "pending"
	WorkflowRunAssetExecutionStatusRunning   WorkflowRunAssetExecutionStatus = "running"
	WorkflowRunAssetExecutionStatusCompleted WorkflowRunAssetExecutionStatus = "completed"
	WorkflowRunAssetExecutionStatusFailed    WorkflowRunAssetExecutionStatus = "failed"
	WorkflowRunAssetExecutionStatusCancelled WorkflowRunAssetExecutionStatus = "cancelled"
)

type WorkflowRunGetParams added in v0.17.0

type WorkflowRunGetParams struct {
	WorkflowID string `path:"workflowId" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type WorkflowRunGetResponseEnvelope added in v0.17.0

type WorkflowRunGetResponseEnvelope struct {
	// The requested Workflow run.
	Data WorkflowRun `json:"data" api:"required"`
	// Status of the API request. Always success for this response.
	Status constant.Success `json:"status" default:"success"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing one Workflow run.

func (WorkflowRunGetResponseEnvelope) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*WorkflowRunGetResponseEnvelope) UnmarshalJSON added in v0.17.0

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

type WorkflowRunListParams added in v0.17.0

type WorkflowRunListParams struct {
	// AssetId specifies the Asset whose results to return. Omit it to include all
	// Assets.
	AssetID param.Opt[string] `query:"asset_id,omitzero" json:"-"`
	// EventId specifies the triggering event ID to filter by. Omit it to include all
	// events.
	EventID param.Opt[string] `query:"event_id,omitzero" json:"-"`
	// LatestPerAsset specifies whether to return only the latest matching run for each
	// Asset. Defaults to false. Pagination and total count apply to Assets when true.
	LatestPerAsset param.Opt[bool] `query:"latest_per_asset,omitzero" json:"-"`
	// Limit specifies the maximum number of results to return. Accepts 1 to 100.
	// Defaults to 100.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Offset specifies the number of matching results to skip. Must be at least 0.
	// Defaults to 0.
	Offset  param.Opt[int64]             `query:"offset,omitzero" json:"-"`
	Created WorkflowRunListParamsCreated `query:"created,omitzero" json:"-"`
	// Status specifies the run status to filter by. Omit it to include all statuses.
	//
	// Any of "pending", "running", "completed", "failed", "cancelled".
	Status WorkflowRunListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WorkflowRunListParams) URLQuery added in v0.17.0

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

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

type WorkflowRunListParamsCreated added in v0.17.0

type WorkflowRunListParamsCreated struct {
	// Created at or after this Unix timestamp in seconds.
	Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
	// Created at or before this Unix timestamp in seconds.
	Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WorkflowRunListParamsCreated) URLQuery added in v0.17.0

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

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

type WorkflowRunListParamsStatus added in v0.17.0

type WorkflowRunListParamsStatus string

Status specifies the run status to filter by. Omit it to include all statuses.

const (
	WorkflowRunListParamsStatusPending   WorkflowRunListParamsStatus = "pending"
	WorkflowRunListParamsStatusRunning   WorkflowRunListParamsStatus = "running"
	WorkflowRunListParamsStatusCompleted WorkflowRunListParamsStatus = "completed"
	WorkflowRunListParamsStatusFailed    WorkflowRunListParamsStatus = "failed"
	WorkflowRunListParamsStatusCancelled WorkflowRunListParamsStatus = "cancelled"
)

type WorkflowRunService added in v0.17.0

type WorkflowRunService struct {
	Options []option.RequestOption
	Actions WorkflowRunActionService
}

WorkflowRunService contains methods and other services that help with interacting with the chunkify 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 NewWorkflowRunService method instead.

func NewWorkflowRunService added in v0.17.0

func NewWorkflowRunService(opts ...option.RequestOption) (r WorkflowRunService)

NewWorkflowRunService 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 (*WorkflowRunService) Get added in v0.17.0

func (r *WorkflowRunService) Get(ctx context.Context, runID string, query WorkflowRunGetParams, opts ...option.RequestOption) (res *WorkflowRun, err error)

Retrieve a retained run with its triggering event, status, and action counts.

func (*WorkflowRunService) List added in v0.17.0

List retained runs for this Workflow, newest first. Each run corresponds to one matching Asset event.

func (*WorkflowRunService) ListAutoPaging added in v0.17.0

List retained runs for this Workflow, newest first. Each run corresponds to one matching Asset event.

type WorkflowRunStatus added in v0.17.0

type WorkflowRunStatus string

Current status of this event run, based on its own actions.

const (
	WorkflowRunStatusPending   WorkflowRunStatus = "pending"
	WorkflowRunStatusRunning   WorkflowRunStatus = "running"
	WorkflowRunStatusCompleted WorkflowRunStatus = "completed"
	WorkflowRunStatusFailed    WorkflowRunStatus = "failed"
	WorkflowRunStatusCancelled WorkflowRunStatus = "cancelled"
)

type WorkflowService added in v0.17.0

type WorkflowService struct {
	Options   []option.RequestOption
	Revisions WorkflowRevisionService
	Runs      WorkflowRunService
}

WorkflowService contains methods and other services that help with interacting with the chunkify 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 NewWorkflowService method instead.

func NewWorkflowService added in v0.17.0

func NewWorkflowService(opts ...option.RequestOption) (r WorkflowService)

NewWorkflowService 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 (*WorkflowService) Delete added in v0.17.0

func (r *WorkflowService) Delete(ctx context.Context, workflowID string, opts ...option.RequestOption) (err error)

Archive the Workflow and clear it from the Project default. New Assets cannot select it and new events do not start runs. Accepted actions finish, and outputs and retained history remain available.

func (*WorkflowService) Get added in v0.17.0

func (r *WorkflowService) Get(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *Workflow, err error)

Retrieve a Workflow and its current definition, including archived Workflows.

func (*WorkflowService) List added in v0.17.0

List Workflows in the Project, newest first. Archived Workflows are excluded unless archived is true.

func (*WorkflowService) ListAutoPaging added in v0.17.0

List Workflows in the Project, newest first. Archived Workflows are excluded unless archived is true.

func (*WorkflowService) New added in v0.17.0

func (r *WorkflowService) New(ctx context.Context, body WorkflowNewParams, opts ...option.RequestOption) (res *Workflow, err error)

Create a Workflow with its first definition revision. Select it when creating an Asset or Upload, or set it as the Project default.

func (*WorkflowService) Update added in v0.17.0

func (r *WorkflowService) Update(ctx context.Context, workflowID string, body WorkflowUpdateParams, opts ...option.RequestOption) (err error)

Update the Workflow name or replace its rules. Replacing rules requires the current revision. A changed definition creates a new revision; unchanged rules and name-only edits preserve it. Existing Assets and Uploads keep their selected revision until a ready Asset explicitly updates to the latest revision. Archived Workflows cannot be updated.

type WorkflowStaticAction added in v0.17.0

type WorkflowStaticAction struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Params specifies the static rendition resolution.
	Params WorkflowStaticParamsResp `json:"params" api:"required"`
	// Type specifies the action to perform. Must be create_static_rendition.
	Type constant.CreateStaticRendition `json:"type" default:"create_static_rendition"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Params      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Creates or reuses one static rendition for the Asset.

func (WorkflowStaticAction) RawJSON added in v0.17.0

func (r WorkflowStaticAction) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowStaticAction) ToParam added in v0.17.0

ToParam converts this WorkflowStaticAction to a WorkflowStaticActionParam.

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 WorkflowStaticActionParam.Overrides()

func (*WorkflowStaticAction) UnmarshalJSON added in v0.17.0

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

type WorkflowStaticActionParam added in v0.17.0

type WorkflowStaticActionParam struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Params specifies the static rendition resolution.
	Params WorkflowStaticParams `json:"params,omitzero" api:"required"`
	// Type specifies the action to perform. Must be create_static_rendition.
	//
	// This field can be elided, and will marshal its zero value as
	// "create_static_rendition".
	Type constant.CreateStaticRendition `json:"type" default:"create_static_rendition"`
	// contains filtered or unexported fields
}

Creates or reuses one static rendition for the Asset.

The properties ID, Params, Type are required.

func (WorkflowStaticActionParam) MarshalJSON added in v0.17.0

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

func (*WorkflowStaticActionParam) UnmarshalJSON added in v0.17.0

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

type WorkflowStaticParams added in v0.17.0

type WorkflowStaticParams struct {
	// Resolution specifies the H.264 MP4 output resolution. highest selects the
	// largest supported output without upscaling. Hobby supports up to 1080p; other
	// plans support up to 2160p. Streaming resolution limits do not apply.
	//
	// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
	// "2160p".
	Resolution WorkflowStaticParamsResolution `json:"resolution,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating one static rendition.

The property Resolution is required.

func (WorkflowStaticParams) MarshalJSON added in v0.17.0

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

func (*WorkflowStaticParams) UnmarshalJSON added in v0.17.0

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

type WorkflowStaticParamsResolution added in v0.17.0

type WorkflowStaticParamsResolution string

Resolution specifies the H.264 MP4 output resolution. highest selects the largest supported output without upscaling. Hobby supports up to 1080p; other plans support up to 2160p. Streaming resolution limits do not apply.

const (
	WorkflowStaticParamsResolutionHighest WorkflowStaticParamsResolution = "highest"
	WorkflowStaticParamsResolution240p    WorkflowStaticParamsResolution = "240p"
	WorkflowStaticParamsResolution360p    WorkflowStaticParamsResolution = "360p"
	WorkflowStaticParamsResolution480p    WorkflowStaticParamsResolution = "480p"
	WorkflowStaticParamsResolution540p    WorkflowStaticParamsResolution = "540p"
	WorkflowStaticParamsResolution720p    WorkflowStaticParamsResolution = "720p"
	WorkflowStaticParamsResolution1080p   WorkflowStaticParamsResolution = "1080p"
	WorkflowStaticParamsResolution1440p   WorkflowStaticParamsResolution = "1440p"
	WorkflowStaticParamsResolution2160p   WorkflowStaticParamsResolution = "2160p"
)

type WorkflowStaticParamsResp added in v0.17.0

type WorkflowStaticParamsResp struct {
	// Resolution specifies the H.264 MP4 output resolution. highest selects the
	// largest supported output without upscaling. Hobby supports up to 1080p; other
	// plans support up to 2160p. Streaming resolution limits do not apply.
	//
	// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
	// "2160p".
	Resolution WorkflowStaticParamsResolution `json:"resolution" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Resolution  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Parameters for creating one static rendition.

func (WorkflowStaticParamsResp) RawJSON added in v0.17.0

func (r WorkflowStaticParamsResp) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowStaticParamsResp) ToParam added in v0.17.0

ToParam converts this WorkflowStaticParamsResp to a WorkflowStaticParams.

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 WorkflowStaticParams.Overrides()

func (*WorkflowStaticParamsResp) UnmarshalJSON added in v0.17.0

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

type WorkflowThumbnailAction added in v0.17.0

type WorkflowThumbnailAction struct {
	// Id specifies a stable action key, unique within its rule.
	ID string `json:"id" api:"required"`
	// Params specifies sampling and image settings. Outputs use the Asset folder and
	// Storage.
	Params WorkflowThumbnailParamsResp `json:"params" api:"required"`
	// Type specifies the action to perform. Must be create_thumbnails.
	Type constant.CreateThumbnails `json:"type" default:"create_thumbnails"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Params      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Creates an independent thumbnail request after asset.ready. Replaying this action uses its accepted request; separate actions create separate requests.

func (WorkflowThumbnailAction) RawJSON added in v0.17.0

func (r WorkflowThumbnailAction) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowThumbnailAction) ToParam added in v0.17.0

ToParam converts this WorkflowThumbnailAction to a WorkflowThumbnailActionParam.

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 WorkflowThumbnailActionParam.Overrides()

func (*WorkflowThumbnailAction) UnmarshalJSON added in v0.17.0

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

type WorkflowThumbnailActionParam added in v0.17.0

type WorkflowThumbnailActionParam struct {
	// Id specifies a stable action key, unique within its rule.
	ID string `json:"id" api:"required"`
	// Params specifies sampling and image settings. Outputs use the Asset folder and
	// Storage.
	Params WorkflowThumbnailParams `json:"params,omitzero" api:"required"`
	// Type specifies the action to perform. Must be create_thumbnails.
	//
	// This field can be elided, and will marshal its zero value as
	// "create_thumbnails".
	Type constant.CreateThumbnails `json:"type" default:"create_thumbnails"`
	// contains filtered or unexported fields
}

Creates an independent thumbnail request after asset.ready. Replaying this action uses its accepted request; separate actions create separate requests.

The properties ID, Params, Type are required.

func (WorkflowThumbnailActionParam) MarshalJSON added in v0.17.0

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

func (*WorkflowThumbnailActionParam) UnmarshalJSON added in v0.17.0

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

type WorkflowThumbnailParams added in v0.17.0

type WorkflowThumbnailParams struct {
	// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
	// selected range.
	Count param.Opt[int64] `json:"count,omitzero"`
	// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
	// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
	// cropping or upscaling.
	Size param.Opt[int64] `json:"size,omitzero"`
	// Format selects JPEG or WebP. Defaults to JPEG.
	//
	// Any of "jpeg", "webp".
	Format WorkflowThumbnailParamsFormat `json:"format,omitzero"`
	// Metadata attaches string values to this request. The serialized object may
	// contain at most 2048 bytes.
	Metadata map[string]string `json:"metadata,omitzero"`
	// Output selects images or sprites. Defaults to images.
	//
	// Any of "images", "sprites".
	Output WorkflowThumbnailParamsOutput `json:"output,omitzero"`
	// Range limits sampling to part of the Source. Defaults to the whole Source
	// duration.
	Range WorkflowThumbnailParamsRange `json:"range,omitzero"`
	// Timestamps specifies 1 to 100 Source-relative target times in seconds. Times
	// outside the selected range are skipped when the action runs. If none remain, the
	// action is skipped without a charge. Repeated targets produce separate outputs.
	Timestamps []float64 `json:"timestamps,omitzero"`
	// contains filtered or unexported fields
}

Generate additional thumbnails in the Asset folder and Storage. Each layout, format and size combination can be requested once. Specify exactly one of timestamps or count.

func (WorkflowThumbnailParams) MarshalJSON added in v0.17.0

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

func (*WorkflowThumbnailParams) UnmarshalJSON added in v0.17.0

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

type WorkflowThumbnailParamsFormat added in v0.17.0

type WorkflowThumbnailParamsFormat string

Format selects JPEG or WebP. Defaults to JPEG.

const (
	WorkflowThumbnailParamsFormatJpeg WorkflowThumbnailParamsFormat = "jpeg"
	WorkflowThumbnailParamsFormatWebp WorkflowThumbnailParamsFormat = "webp"
)

type WorkflowThumbnailParamsOutput added in v0.17.0

type WorkflowThumbnailParamsOutput string

Output selects images or sprites. Defaults to images.

const (
	WorkflowThumbnailParamsOutputImages  WorkflowThumbnailParamsOutput = "images"
	WorkflowThumbnailParamsOutputSprites WorkflowThumbnailParamsOutput = "sprites"
)

type WorkflowThumbnailParamsRange added in v0.17.0

type WorkflowThumbnailParamsRange struct {
	// End specifies the exclusive upper bound in seconds. Defaults to the Source
	// duration.
	End param.Opt[float64] `json:"end,omitzero"`
	// Start specifies the inclusive lower bound in seconds. Defaults to zero.
	Start param.Opt[float64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

Range limits sampling to part of the Source. Defaults to the whole Source duration.

func (WorkflowThumbnailParamsRange) MarshalJSON added in v0.17.0

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

func (*WorkflowThumbnailParamsRange) UnmarshalJSON added in v0.17.0

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

type WorkflowThumbnailParamsRangeResp added in v0.17.0

type WorkflowThumbnailParamsRangeResp struct {
	// End specifies the exclusive upper bound in seconds. Defaults to the Source
	// duration.
	End float64 `json:"end"`
	// Start specifies the inclusive lower bound in seconds. Defaults to zero.
	Start float64 `json:"start"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		End         respjson.Field
		Start       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Range limits sampling to part of the Source. Defaults to the whole Source duration.

func (WorkflowThumbnailParamsRangeResp) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*WorkflowThumbnailParamsRangeResp) UnmarshalJSON added in v0.17.0

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

type WorkflowThumbnailParamsResp added in v0.17.0

type WorkflowThumbnailParamsResp struct {
	// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
	// selected range.
	Count int64 `json:"count"`
	// Format selects JPEG or WebP. Defaults to JPEG.
	//
	// Any of "jpeg", "webp".
	Format WorkflowThumbnailParamsFormat `json:"format"`
	// Metadata attaches string values to this request. The serialized object may
	// contain at most 2048 bytes.
	Metadata map[string]string `json:"metadata"`
	// Output selects images or sprites. Defaults to images.
	//
	// Any of "images", "sprites".
	Output WorkflowThumbnailParamsOutput `json:"output"`
	// Range limits sampling to part of the Source. Defaults to the whole Source
	// duration.
	Range WorkflowThumbnailParamsRangeResp `json:"range"`
	// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
	// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
	// cropping or upscaling.
	Size int64 `json:"size"`
	// Timestamps specifies 1 to 100 Source-relative target times in seconds. Times
	// outside the selected range are skipped when the action runs. If none remain, the
	// action is skipped without a charge. Repeated targets produce separate outputs.
	Timestamps []float64 `json:"timestamps"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Format      respjson.Field
		Metadata    respjson.Field
		Output      respjson.Field
		Range       respjson.Field
		Size        respjson.Field
		Timestamps  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Generate additional thumbnails in the Asset folder and Storage. Each layout, format and size combination can be requested once. Specify exactly one of timestamps or count.

func (WorkflowThumbnailParamsResp) RawJSON added in v0.17.0

func (r WorkflowThumbnailParamsResp) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowThumbnailParamsResp) ToParam added in v0.17.0

ToParam converts this WorkflowThumbnailParamsResp to a WorkflowThumbnailParams.

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 WorkflowThumbnailParams.Overrides()

func (*WorkflowThumbnailParamsResp) UnmarshalJSON added in v0.17.0

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

type WorkflowTranscriptAction added in v0.17.0

type WorkflowTranscriptAction struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Params specifies transcript settings. Pass an empty object.
	Params any `json:"params" api:"required"`
	// Type specifies the action to perform. Must be create_transcript.
	Type constant.CreateTranscript `json:"type" default:"create_transcript"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Params      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Creates or reuses the original-language transcript. Can run alongside caption generation in the same asset.ready rule.

func (WorkflowTranscriptAction) RawJSON added in v0.17.0

func (r WorkflowTranscriptAction) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowTranscriptAction) ToParam added in v0.17.0

ToParam converts this WorkflowTranscriptAction to a WorkflowTranscriptActionParam.

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 WorkflowTranscriptActionParam.Overrides()

func (*WorkflowTranscriptAction) UnmarshalJSON added in v0.17.0

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

type WorkflowTranscriptActionParam added in v0.17.0

type WorkflowTranscriptActionParam struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// Params specifies transcript settings. Pass an empty object.
	Params any `json:"params,omitzero" api:"required"`
	// Type specifies the action to perform. Must be create_transcript.
	//
	// This field can be elided, and will marshal its zero value as
	// "create_transcript".
	Type constant.CreateTranscript `json:"type" default:"create_transcript"`
	// contains filtered or unexported fields
}

Creates or reuses the original-language transcript. Can run alongside caption generation in the same asset.ready rule.

The properties ID, Params, Type are required.

func (WorkflowTranscriptActionParam) MarshalJSON added in v0.17.0

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

func (*WorkflowTranscriptActionParam) UnmarshalJSON added in v0.17.0

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

type WorkflowTranslationAction added in v0.17.0

type WorkflowTranslationAction struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// CaptionId specifies the binding to the original caption in the triggering event.
	CaptionID WorkflowTranslationActionCaptionID `json:"caption_id" api:"required"`
	// Params specifies the target language.
	Params WorkflowTranslationParamsResp `json:"params" api:"required"`
	// Type specifies the action to perform. Must be translate_caption.
	Type constant.TranslateCaption `json:"type" default:"translate_caption"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CaptionID   respjson.Field
		Params      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Translates or reuses an original caption in one target language. Requires an asset.output.ready rule connected to an original caption creation action.

func (WorkflowTranslationAction) RawJSON added in v0.17.0

func (r WorkflowTranslationAction) RawJSON() string

Returns the unmodified JSON received from the API

func (WorkflowTranslationAction) ToParam added in v0.17.0

ToParam converts this WorkflowTranslationAction to a WorkflowTranslationActionParam.

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 WorkflowTranslationActionParam.Overrides()

func (*WorkflowTranslationAction) UnmarshalJSON added in v0.17.0

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

type WorkflowTranslationActionCaptionID added in v0.17.0

type WorkflowTranslationActionCaptionID struct {
	// From specifies where to read the input output ID. Use event.output.id to consume
	// the output in the triggering asset.output.ready event.
	//
	// Any of "event.output.id".
	From string `json:"from" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CaptionId specifies the binding to the original caption in the triggering event.

func (WorkflowTranslationActionCaptionID) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (*WorkflowTranslationActionCaptionID) UnmarshalJSON added in v0.17.0

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

type WorkflowTranslationActionCaptionIDParam added in v0.17.0

type WorkflowTranslationActionCaptionIDParam struct {
	// From specifies where to read the input output ID. Use event.output.id to consume
	// the output in the triggering asset.output.ready event.
	//
	// Any of "event.output.id".
	From string `json:"from,omitzero" api:"required"`
	// contains filtered or unexported fields
}

CaptionId specifies the binding to the original caption in the triggering event.

The property From is required.

func (WorkflowTranslationActionCaptionIDParam) MarshalJSON added in v0.17.0

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

func (*WorkflowTranslationActionCaptionIDParam) UnmarshalJSON added in v0.17.0

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

type WorkflowTranslationActionParam added in v0.17.0

type WorkflowTranslationActionParam struct {
	// Id specifies a stable action key, unique within its rule. Use 1 to 64
	// characters, starting with a letter and containing only letters, digits, or
	// underscores.
	ID string `json:"id" api:"required"`
	// CaptionId specifies the binding to the original caption in the triggering event.
	CaptionID WorkflowTranslationActionCaptionIDParam `json:"caption_id,omitzero" api:"required"`
	// Params specifies the target language.
	Params WorkflowTranslationParams `json:"params,omitzero" api:"required"`
	// Type specifies the action to perform. Must be translate_caption.
	//
	// This field can be elided, and will marshal its zero value as
	// "translate_caption".
	Type constant.TranslateCaption `json:"type" default:"translate_caption"`
	// contains filtered or unexported fields
}

Translates or reuses an original caption in one target language. Requires an asset.output.ready rule connected to an original caption creation action.

The properties ID, CaptionID, Params, Type are required.

func (WorkflowTranslationActionParam) MarshalJSON added in v0.17.0

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

func (*WorkflowTranslationActionParam) UnmarshalJSON added in v0.17.0

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

type WorkflowTranslationParams added in v0.17.0

type WorkflowTranslationParams struct {
	// LanguageCode specifies the target language for the translated subtitle track,
	// such as en or fr. The same code appears in the caption and HLS manifest.
	//
	// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
	// "ru", "tr", "pl", "sv".
	LanguageCode WorkflowTranslationParamsLanguageCode `json:"language_code,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for translating one original caption into another language.

The property LanguageCode is required.

func (WorkflowTranslationParams) MarshalJSON added in v0.17.0

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

func (*WorkflowTranslationParams) UnmarshalJSON added in v0.17.0

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

type WorkflowTranslationParamsLanguageCode added in v0.17.0

type WorkflowTranslationParamsLanguageCode string

LanguageCode specifies the target language for the translated subtitle track, such as en or fr. The same code appears in the caption and HLS manifest.

const (
	WorkflowTranslationParamsLanguageCodeEn WorkflowTranslationParamsLanguageCode = "en"
	WorkflowTranslationParamsLanguageCodeFr WorkflowTranslationParamsLanguageCode = "fr"
	WorkflowTranslationParamsLanguageCodeEs WorkflowTranslationParamsLanguageCode = "es"
	WorkflowTranslationParamsLanguageCodeDe WorkflowTranslationParamsLanguageCode = "de"
	WorkflowTranslationParamsLanguageCodeIt WorkflowTranslationParamsLanguageCode = "it"
	WorkflowTranslationParamsLanguageCodePt WorkflowTranslationParamsLanguageCode = "pt"
	WorkflowTranslationParamsLanguageCodeNl WorkflowTranslationParamsLanguageCode = "nl"
	WorkflowTranslationParamsLanguageCodeJa WorkflowTranslationParamsLanguageCode = "ja"
	WorkflowTranslationParamsLanguageCodeKo WorkflowTranslationParamsLanguageCode = "ko"
	WorkflowTranslationParamsLanguageCodeZh WorkflowTranslationParamsLanguageCode = "zh"
	WorkflowTranslationParamsLanguageCodeAr WorkflowTranslationParamsLanguageCode = "ar"
	WorkflowTranslationParamsLanguageCodeHi WorkflowTranslationParamsLanguageCode = "hi"
	WorkflowTranslationParamsLanguageCodeRu WorkflowTranslationParamsLanguageCode = "ru"
	WorkflowTranslationParamsLanguageCodeTr WorkflowTranslationParamsLanguageCode = "tr"
	WorkflowTranslationParamsLanguageCodePl WorkflowTranslationParamsLanguageCode = "pl"
	WorkflowTranslationParamsLanguageCodeSv WorkflowTranslationParamsLanguageCode = "sv"
)

type WorkflowTranslationParamsResp added in v0.17.0

type WorkflowTranslationParamsResp struct {
	// LanguageCode specifies the target language for the translated subtitle track,
	// such as en or fr. The same code appears in the caption and HLS manifest.
	//
	// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
	// "ru", "tr", "pl", "sv".
	LanguageCode WorkflowTranslationParamsLanguageCode `json:"language_code" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LanguageCode respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Parameters for translating one original caption into another language.

func (WorkflowTranslationParamsResp) RawJSON added in v0.17.0

Returns the unmodified JSON received from the API

func (WorkflowTranslationParamsResp) ToParam added in v0.17.0

ToParam converts this WorkflowTranslationParamsResp to a WorkflowTranslationParams.

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 WorkflowTranslationParams.Overrides()

func (*WorkflowTranslationParamsResp) UnmarshalJSON added in v0.17.0

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

type WorkflowUpdateParams added in v0.17.0

type WorkflowUpdateParams struct {
	// ExpectedRevision specifies the current Workflow revision when replacing rules.
	// The update returns a conflict if it no longer matches. Required when rules is
	// provided. Must be at least 1.
	ExpectedRevision param.Opt[int64] `json:"expected_revision,omitzero"`
	// Name specifies the Workflow name. Use 1 to 128 characters.
	Name param.Opt[string] `json:"name,omitzero"`
	// Rules specifies the event subscriptions and actions in this definition. Provide
	// exactly one asset.ready rule and up to 15 connected rules, with at most 32
	// actions and 65536 encoded bytes across all rules. Array order affects display
	// only. Replaces the complete definition and requires schema_version and
	// expected_revision. Existing Assets and Uploads keep their pinned revision.
	Rules []WorkflowRuleParam `json:"rules,omitzero"`
	// SchemaVersion specifies the Workflow definition format. The supported version
	// is 1. Required when rules is provided.
	//
	// Any of 1.
	SchemaVersion int64 `json:"schema_version,omitzero"`
	// contains filtered or unexported fields
}

func (WorkflowUpdateParams) MarshalJSON added in v0.17.0

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

func (*WorkflowUpdateParams) UnmarshalJSON added in v0.17.0

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

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

Jump to

Keyboard shortcuts

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