chunkify

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

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.6.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")
	)
	job, err := client.Jobs.New(context.TODO(), chunkify.JobNewParams{
		Format: chunkify.JobNewParamsFormatUnion{
			OfMP4H264: &chunkify.MP4H264Param{
				Width:  chunkify.Int(1920),
				Height: chunkify.Int(1080),
				Crf:    chunkify.Int(21),
			},
		},
		SourceID: "src_2G6MJiNz71bHQGNzGwKx5cJwPFS",
		Transcoder: chunkify.JobNewParamsTranscoder{
			Quantity: chunkify.Int(4),
			Type:     "8vCPU",
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", job.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 `json:"...,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.Files.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.Files.List(context.TODO(), chunkify.FileListParams{})
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 "/api/files": 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.Files.List(
	ctx,
	chunkify.FileListParams{},
	// 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.Files.List(
	context.TODO(),
	chunkify.FileListParams{},
	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.Files.List(
	context.TODO(),
	chunkify.FileListParams{},
	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 APIFile added in v0.6.0

type APIFile struct {
	// Unique identifier of the file
	ID string `json:"id,required"`
	// Audio bitrate in bits per second
	AudioBitrate int64 `json:"audio_bitrate,required"`
	// Audio codec used
	AudioCodec string `json:"audio_codec,required"`
	// Timestamp when the file was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Duration of the video in seconds
	Duration int64 `json:"duration,required"`
	// Height of the video in pixels
	Height int64 `json:"height,required"`
	// ID of the job that created this file
	JobID string `json:"job_id,required"`
	// MIME type of the file
	MimeType string `json:"mime_type,required"`
	// Path to the file in storage
	Path string `json:"path,required"`
	// Size of the file in bytes
	Size int64 `json:"size,required"`
	// StorageId identifier where the file is stored
	StorageID string `json:"storage_id,required"`
	// Pre-signed URL to directly access the file (only included when available)
	URL string `json:"url,required"`
	// Video bitrate in bits per second
	VideoBitrate int64 `json:"video_bitrate,required"`
	// Video codec used
	VideoCodec string `json:"video_codec,required"`
	// Video framerate in frames per second
	VideoFramerate float64 `json:"video_framerate,required"`
	// Width of the video in pixels
	Width int64 `json:"width,required"`
	// 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
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (APIFile) RawJSON added in v0.6.0

func (r APIFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*APIFile) UnmarshalJSON added in v0.6.0

func (r *APIFile) 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
	Files         FileService
	Jobs          JobService
	Notifications NotificationService
	Projects      ProjectService
	Sources       SourceService
	Storages      StorageService
	Tokens        TokenService
	Uploads       UploadService
	Webhooks      WebhookService
}

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

type FileGetResponseEnvelope struct {
	// Data contains the response object
	Data APIFile `json:"data,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" 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 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.

func (*FileService) Get added in v0.6.0

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

Retrieve details of a specific file by its ID, including metadata, media properties, and associated jobs.

func (*FileService) List added in v0.6.0

Retrieve a list of files with optional filtering and pagination

func (*FileService) ListAutoPaging added in v0.6.0

Retrieve a list of files with optional filtering and pagination

type HlsAv1 added in v0.6.0

type HlsAv1 struct {
	ID constant.HlsAv1 `json:"id,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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"`
	// 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
	// 100Kbps and 50Mbps.
	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
		HlsTime        respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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"`
	// 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
	// 100Kbps and 50Mbps.
	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,required"`
	// 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,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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"`
	// 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
	// 100Kbps and 50Mbps.
	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 300. 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
		HlsTime        respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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"`
	// 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
	// 100Kbps and 50Mbps.
	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 300. 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,required"`
	// 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,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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"`
	// 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
	// 100Kbps and 50Mbps.
	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
		HlsTime        respjson.Field
		Level          respjson.Field
		Maxrate        respjson.Field
		Minrate        respjson.Field
		Movflags       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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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"`
	// 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
	// 100Kbps and 50Mbps.
	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,required"`
	// 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,required"`
	// Billable time in seconds
	BillableTime int64 `json:"billable_time,required"`
	// Creation timestamp
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// A template defines the transcoding parameters and settings for a job
	Format JobFormatUnion `json:"format,required"`
	// Progress percentage of the job (0-100)
	Progress float64 `json:"progress,required"`
	// ID of the source video being transcoded
	SourceID string `json:"source_id,required"`
	// Current status of the job
	//
	// Any of "queued", "ingesting", "transcoding", "downloading", "merging",
	// "uploading", "failed", "completed", "cancelled", "merged", "downloaded",
	// "transcoded", "waiting".
	Status JobStatus `json:"status,required"`
	// Storage settings for where the job output will be saved
	Storage JobStorage `json:"storage,required"`
	// The transcoder configuration for a job
	Transcoder JobTranscoder `json:"transcoder,required"`
	// Last update timestamp
	UpdatedAt time.Time `json:"updated_at,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"`
	// 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
		Transcoder    respjson.Field
		UpdatedAt     respjson.Field
		Error         respjson.Field
		HlsManifestID respjson.Field
		Metadata      respjson.Field
		StartedAt     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 JobFileListResponse added in v0.6.0

type JobFileListResponse struct {
	Data []APIFile `json:"data,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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 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

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

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

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

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,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,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,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,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"`
	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"`
	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
		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
		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,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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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".
	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" json:"-"`
	// Filter by creation date less than or equal
	Lte param.Opt[int64] `query:"lte,omitzero" 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"
)

type JobLogListParams added in v0.6.0

type JobLogListParams struct {
	// Service type (transcoder or manager)
	//
	// Any of "transcoder", "manager".
	Service JobLogListParamsService `query:"service,omitzero,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,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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,required"`
	// Log level
	//
	// Any of "info", "error", "debug".
	Level string `json:"level,required"`
	// The log message content
	Msg string `json:"msg,required"`
	// Name of the service that generated the log
	//
	// Any of "transcoder", "manager".
	Service string `json:"service,required"`
	// Timestamp when the log was created
	Time time.Time `json:"time,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 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

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,required"`
	// The ID of the source file to transcode
	SourceID string `json:"source_id,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 (max 1024 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) 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) 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 a custom storage path where processed files will be
	// stored. Must be a valid file path with max length of 1024 characters. 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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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 added in v0.6.0

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

Cancel a job.

func (*JobService) Delete added in v0.6.0

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

Delete a job.

func (*JobService) Get 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

func (*JobService) List 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

func (*JobService) ListAutoPaging added in v0.6.0

Retrieve a list of jobs with optional filtering and pagination

func (*JobService) New 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

type JobStatus added in v0.6.0

type JobStatus string

Current status of the job

const (
	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,required"`
	// Path where the output will be stored
	Path string `json:"path,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,required"`
	// Number of instances allocated
	Quantity int64 `json:"quantity,required"`
	// Type of transcoder instance
	//
	// Any of "4vCPU", "8vCPU", "16vCPU".
	Type string `json:"type,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,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 (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,required"`
	// Billable time in seconds
	BillableTime int64 `json:"billable_time,required"`
	// End time of the current chunk in seconds
	ChunkEndTime float64 `json:"chunk_end_time,required"`
	// Number of the chunk being processed
	ChunkNumber int64 `json:"chunk_number,required"`
	// Start time of the current chunk in seconds
	ChunkStartTime float64 `json:"chunk_start_time,required"`
	// CPU time used for transcoding in seconds
	CPUTime float64 `json:"cpu_time,required"`
	// Timestamp when the status was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Current frames per second being processed
	Fps float64 `json:"fps,required"`
	// Current frame number being processed
	Frame int64 `json:"frame,required"`
	// Unique identifier of the job
	JobID string `json:"job_id,required"`
	// Current output time in seconds
	OutTime int64 `json:"out_time,required"`
	// Progress percentage of the transcoding operation (0-100)
	Progress float64 `json:"progress,required"`
	// Current processing speed multiplier
	Speed float64 `json:"speed,required"`
	// Current status of the transcoder (starting, transcoding, finished, failed)
	//
	// Any of "starting", "pending", "transcoding", "completed", "failed", "cancelled".
	Status string `json:"status,required"`
	// Unique identifier of the transcoder instance (generated by the transcoder)
	TranscoderInstanceID string `json:"transcoder_instance_id,required"`
	// Timestamp when the status was last updated
	UpdatedAt time.Time `json:"updated_at,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 added in v0.6.0

Retrieve all the transcoders statuses for a specific job

type Jpg added in v0.6.0

type Jpg struct {
	ID constant.Jpg `json:"id,required"`
	// 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 60
	// seconds.
	Interval      int64 `json:"interval,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 60
	// seconds.
	Interval      int64            `json:"interval,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,required"`
	// 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,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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
		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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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,required"`
	// 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,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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 300. 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
		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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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 300. 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,required"`
	// 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,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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
		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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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,required"`
	// 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 NewEventWebhookEvent added in v0.6.0

type NewEventWebhookEvent struct {
	// Unique identifier of the notification
	ID string `json:"id,required"`
	// Event-specific payload data
	Data NewEventWebhookEventDataUnion `json:"data,required"`
	// Timestamp when the notification was sent
	Date time.Time `json:"date,required" format:"date-time"`
	// Type of event that triggered the notification.
	//
	// Any of "job.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	Event NewEventWebhookEventEvent `json:"event,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 NewEventWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadJobCompleted struct {
	// List of files generated by the job
	Files []APIFile `json:"files,required"`
	Job   Job       `json:"job,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 NewEventWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadJobFailed struct {
	Job Job `json:"job,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 NewEventWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadUploadCompleted struct {
	Source Source `json:"source,required"`
	Upload Upload `json:"upload,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 NewEventWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

type NewEventWebhookEventDataNotificationPayloadUploadFailed struct {
	Upload Upload `json:"upload,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 NewEventWebhookEventDataUnion added in v0.6.0

type NewEventWebhookEventDataUnion struct {
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadJobCompleted].
	Files []APIFile `json:"files"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadJobCompleted].
	Job Job `json:"job"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadUploadCompleted].
	Source Source `json:"source"`
	// This field is from variant
	// [NewEventWebhookEventDataNotificationPayloadUploadCompleted].
	Upload Upload `json:"upload"`
	JSON   struct {
		Files  respjson.Field
		Job    respjson.Field
		Source respjson.Field
		Upload respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

NewEventWebhookEventDataUnion contains all possible properties and values from NewEventWebhookEventDataNotificationPayloadJobCompleted, NewEventWebhookEventDataNotificationPayloadJobFailed, NewEventWebhookEventDataNotificationPayloadUploadCompleted, NewEventWebhookEventDataNotificationPayloadUploadFailed.

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

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

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

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

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

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

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

func (NewEventWebhookEventDataUnion) AsNewEventWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

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

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 (
	NewEventWebhookEventEventJobCompleted    NewEventWebhookEventEvent = "job.completed"
	NewEventWebhookEventEventJobFailed       NewEventWebhookEventEvent = "job.failed"
	NewEventWebhookEventEventJobCancelled    NewEventWebhookEventEvent = "job.cancelled"
	NewEventWebhookEventEventUploadCompleted NewEventWebhookEventEvent = "upload.completed"
	NewEventWebhookEventEventUploadFailed    NewEventWebhookEventEvent = "upload.failed"
	NewEventWebhookEventEventUploadExpired   NewEventWebhookEventEvent = "upload.expired"
)

type Notification

type Notification struct {
	// Unique identifier of the notification
	ID string `json:"id,required"`
	// Timestamp when the notification was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Type of event that triggered this notification
	//
	// Any of "job.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	Event NotificationEvent `json:"event,required"`
	// ID of the object that triggered this notification
	ObjectID string `json:"object_id,required"`
	// JSON payload that was sent to the webhook endpoint
	Payload string `json:"payload,required"`
	// Webhook endpoint configuration that received this notification
	Webhook Webhook `json:"webhook,required"`
	// 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
		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 (
	NotificationEventJobCompleted    NotificationEvent = "job.completed"
	NotificationEventJobFailed       NotificationEvent = "job.failed"
	NotificationEventJobCancelled    NotificationEvent = "job.cancelled"
	NotificationEventUploadCompleted NotificationEvent = "upload.completed"
	NotificationEventUploadFailed    NotificationEvent = "upload.failed"
	NotificationEventUploadExpired   NotificationEvent = "upload.expired"
)

type NotificationGetResponseEnvelope added in v0.6.0

type NotificationGetResponseEnvelope struct {
	// Data contains the response object
	Data Notification `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 {
	// 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.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	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" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" 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.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	Event NotificationNewParamsEvent `json:"event,omitzero,required"`
	// ObjectId specifies the object that triggered this notification.
	ObjectID string `json:"object_id,required"`
	// WebhookId specifies the webhook endpoint that will receive the notification.
	WebhookID string `json:"webhook_id,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 (
	NotificationNewParamsEventJobCompleted    NotificationNewParamsEvent = "job.completed"
	NotificationNewParamsEventJobFailed       NotificationNewParamsEvent = "job.failed"
	NotificationNewParamsEventJobCancelled    NotificationNewParamsEvent = "job.cancelled"
	NotificationNewParamsEventUploadCompleted NotificationNewParamsEvent = "upload.completed"
	NotificationNewParamsEventUploadFailed    NotificationNewParamsEvent = "upload.failed"
	NotificationNewParamsEventUploadExpired   NotificationNewParamsEvent = "upload.expired"
)

type NotificationNewResponseEnvelope added in v0.6.0

type NotificationNewResponseEnvelope struct {
	// Data contains the response object
	Data Notification `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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

Create a new notification for a job event

type Project

type Project struct {
	// Id is the unique identifier for the project.
	ID string `json:"id,required"`
	// Timestamp when the project was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Name of the project
	Name string `json:"name,required"`
	// Slug is the slug for the project.
	Slug string `json:"slug,required"`
	// StorageId identifier where project files are stored
	StorageID string `json:"storage_id,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		Slug        respjson.Field
		StorageID   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 ProjectGetResponseEnvelope added in v0.6.0

type ProjectGetResponseEnvelope struct {
	// Data contains the response object
	Data Project `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 ProjectListParams added in v0.6.0

type ProjectListParams struct {
	// Pagination limit (max 100)
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Pagination offset
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectListParams) URLQuery added in v0.6.0

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

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

type ProjectListResponse added in v0.6.0

type ProjectListResponse struct {
	Data []Project `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 (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,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,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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
}

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.

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

Retrieve a list of all projects with optional filtering and pagination

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 {
	// Name is the name of the project. Required when storage_id is not provided.
	Name param.Opt[string] `json:"name,omitzero"`
	// StorageId is the storage id of the project. Required when name is not provided.
	StorageID param.Opt[string] `json:"storage_id,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 Source

type Source struct {
	// Unique identifier of the source
	ID string `json:"id,required"`
	// Audio bitrate in bits per second
	AudioBitrate int64 `json:"audio_bitrate,required"`
	// Audio codec used
	AudioCodec string `json:"audio_codec,required"`
	// Timestamp when the source was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Device used to record the video
	Device string `json:"device,required"`
	// Duration of the video in seconds
	Duration int64 `json:"duration,required"`
	// Height of the video in pixels
	Height int64 `json:"height,required"`
	// Additional metadata for the source
	Metadata map[string]string `json:"metadata,required"`
	// Size of the source file in bytes
	Size int64 `json:"size,required"`
	// URL where the source video can be accessed
	URL string `json:"url,required"`
	// Video bitrate in bits per second
	VideoBitrate int64 `json:"video_bitrate,required"`
	// Video codec used
	VideoCodec string `json:"video_codec,required"`
	// Video framerate in frames per second
	VideoFramerate float64 `json:"video_framerate,required"`
	// Width of the video in pixels
	Width int64 `json:"width,required"`
	// 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
		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:"-"`
}

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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" 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 string `json:"url,required"`
	// Metadata allows for additional information to be attached to the source, with a
	// maximum size of 1024 bytes.
	Metadata map[string]string `json:"metadata,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 SourceNewResponseEnvelope added in v0.6.0

type SourceNewResponseEnvelope struct {
	// Data contains the response object
	Data Source `json:"data,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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,required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket,required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Provider specifies the storage provider.
	Provider constant.Aws `json:"provider,required"`
	// Public indicates whether the storage is publicly accessible.
	Public bool `json:"public,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,required"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Bucket      respjson.Field
		CreatedAt   respjson.Field
		Provider    respjson.Field
		Public      respjson.Field
		Region      respjson.Field
		Slug        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,required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Provider specifies the storage provider.
	Provider constant.Chunkify `json:"provider,required"`
	// 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,required"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug,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,required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket,required"`
	// Created at timestamp
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Endpoint is the endpoint of the storage provider.
	Endpoint string `json:"endpoint,required" format:"uri"`
	// Location specifies the location of the storage provider.
	//
	// Any of "US", "EU", "ASIA".
	Location string `json:"location,required"`
	// Provider specifies the storage provider.
	Provider constant.Cloudflare `json:"provider,required"`
	// Public indicates whether the storage is publicly accessible.
	Public bool `json:"public,required"`
	// Region specifies the region of the storage provider.
	Region constant.Auto `json:"region,required"`
	// Unique identifier of the storage configuration
	Slug string `json:"slug,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          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
		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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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 []StorageUnion `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 (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"`
	// 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,required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket,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,required"`
	// SecretAccessKey is the secret key for the storage provider. Required if not
	// using Chunkify storage.
	SecretAccessKey string `json:"secret_access_key,required"`
	// 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,required"`
	// 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,required"`
	// Provider specifies the storage provider.
	//
	// This field can be elided, and will marshal its zero value as "chunkify".
	Provider constant.Chunkify `json:"provider,required"`
	// 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,required"`
	// Bucket is the name of the storage bucket.
	Bucket string `json:"bucket,required"`
	// Endpoint is the endpoint of the storage provider.
	Endpoint string `json:"endpoint,required" format:"uri"`
	// Location specifies the location of the storage provider.
	//
	// Any of "US", "EU", "ASIA".
	Location string `json:"location,omitzero,required"`
	// SecretAccessKey is the secret key for the storage provider.
	SecretAccessKey string `json:"secret_access_key,required"`
	// 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,required"`
	// Region must be set to 'auto'.
	//
	// This field can be elided, and will marshal its zero value as "auto".
	Region constant.Auto `json:"region,required"`
	// 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 StorageNewResponseEnvelope added in v0.6.0

type StorageNewResponseEnvelope struct {
	// Data contains the response object
	Data StorageUnion `json:"data,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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 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.

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".
	Provider string `json:"provider"`
	Region   string `json:"region"`
	Slug     string `json:"slug"`
	Bucket   string `json:"bucket"`
	// This field is from variant [StorageCloudflare].
	Endpoint string `json:"endpoint"`
	// This field is from variant [StorageCloudflare].
	Location string `json:"location"`
	Public   bool   `json:"public"`
	JSON     struct {
		ID        respjson.Field
		CreatedAt respjson.Field
		Provider  respjson.Field
		Region    respjson.Field
		Slug      respjson.Field
		Bucket    respjson.Field
		Endpoint  respjson.Field
		Location  respjson.Field
		Public    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

StorageUnion contains all possible properties and values from StorageChunkify, StorageCloudflare, StorageAws.

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:
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) 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 Token

type Token struct {
	// Unique identifier of the token
	ID string `json:"id,required"`
	// The actual token value (only returned on creation)
	Token string `json:"token,required"`
	// Timestamp when the token was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Name given to the token
	Name string `json:"name,required"`
	// ID of the project this token belongs to
	ProjectID string `json:"project_id,required"`
	// Access scope of the token
	//
	// Any of "project", "team".
	Scope TokenScope `json:"scope,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 []Token `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 (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,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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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 account-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 UnwrapWebhookEvent added in v0.6.0

type UnwrapWebhookEvent struct {
	// Unique identifier of the notification
	ID string `json:"id,required"`
	// Event-specific payload data
	Data UnwrapWebhookEventDataUnion `json:"data,required"`
	// Timestamp when the notification was sent
	Date time.Time `json:"date,required" format:"date-time"`
	// Type of event that triggered the notification.
	//
	// Any of "job.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	Event UnwrapWebhookEventEvent `json:"event,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 UnwrapWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadJobCompleted struct {
	// List of files generated by the job
	Files []APIFile `json:"files,required"`
	Job   Job       `json:"job,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 UnwrapWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadJobFailed struct {
	Job Job `json:"job,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 UnwrapWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadUploadCompleted struct {
	Source Source `json:"source,required"`
	Upload Upload `json:"upload,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 UnwrapWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

type UnwrapWebhookEventDataNotificationPayloadUploadFailed struct {
	Upload Upload `json:"upload,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 UnwrapWebhookEventDataUnion added in v0.6.0

type UnwrapWebhookEventDataUnion struct {
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadJobCompleted].
	Files []APIFile `json:"files"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadJobCompleted].
	Job Job `json:"job"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadUploadCompleted].
	Source Source `json:"source"`
	// This field is from variant
	// [UnwrapWebhookEventDataNotificationPayloadUploadCompleted].
	Upload Upload `json:"upload"`
	JSON   struct {
		Files  respjson.Field
		Job    respjson.Field
		Source respjson.Field
		Upload respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

UnwrapWebhookEventDataUnion contains all possible properties and values from UnwrapWebhookEventDataNotificationPayloadJobCompleted, UnwrapWebhookEventDataNotificationPayloadJobFailed, UnwrapWebhookEventDataNotificationPayloadUploadCompleted, UnwrapWebhookEventDataNotificationPayloadUploadFailed.

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

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobCompleted added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobCompleted() (v UnwrapWebhookEventDataNotificationPayloadJobCompleted)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobFailed added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadJobFailed() (v UnwrapWebhookEventDataNotificationPayloadJobFailed)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadCompleted added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadCompleted() (v UnwrapWebhookEventDataNotificationPayloadUploadCompleted)

func (UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadFailed added in v0.6.0

func (u UnwrapWebhookEventDataUnion) AsUnwrapWebhookEventDataNotificationPayloadUploadFailed() (v UnwrapWebhookEventDataNotificationPayloadUploadFailed)

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 (
	UnwrapWebhookEventEventJobCompleted    UnwrapWebhookEventEvent = "job.completed"
	UnwrapWebhookEventEventJobFailed       UnwrapWebhookEventEvent = "job.failed"
	UnwrapWebhookEventEventJobCancelled    UnwrapWebhookEventEvent = "job.cancelled"
	UnwrapWebhookEventEventUploadCompleted UnwrapWebhookEventEvent = "upload.completed"
	UnwrapWebhookEventEventUploadFailed    UnwrapWebhookEventEvent = "upload.failed"
	UnwrapWebhookEventEventUploadExpired   UnwrapWebhookEventEvent = "upload.expired"
)

type Upload added in v0.6.0

type Upload struct {
	// Unique identifier of the upload
	ID string `json:"id,required"`
	// Timestamp when the upload was created
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// Timestamp when the upload will expire
	ExpiresAt time.Time `json:"expires_at,required" format:"date-time"`
	// Current status of the upload
	//
	// Any of "waiting", "completed", "failed", "expired".
	Status UploadStatus `json:"status,required"`
	// Timestamp when the upload was updated
	UpdatedAt time.Time `json:"updated_at,required" format:"date-time"`
	// Pre-signed URL where the file should be uploaded to
	UploadURL string `json:"upload_url,required"`
	// Error message of the upload
	Error shared.ChunkifyError `json:"error"`
	// Additional metadata for the upload
	Metadata map[string]string `json:"metadata"`
	// SourceId is the id of the source that was created from the upload
	SourceID string `json:"source_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		ExpiresAt   respjson.Field
		Status      respjson.Field
		UpdatedAt   respjson.Field
		UploadURL   respjson.Field
		Error       respjson.Field
		Metadata    respjson.Field
		SourceID    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 UploadGetResponseEnvelope added in v0.6.0

type UploadGetResponseEnvelope struct {
	// Data contains the response object
	Data Upload `json:"data,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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" json:"-"`
	// Filter by creation date less than or equal (UNIX epoch time)
	Lte param.Opt[int64] `query:"lte,omitzero" 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 UploadNewParams added in v0.6.0

type UploadNewParams struct {
	// The upload URL will be valid for the given timeout in seconds
	ValidityTimeout param.Opt[int64] `json:"validity_timeout,omitzero"`
	// Metadata allows for additional information to be attached to the upload, with a
	// maximum size of 1024 bytes.
	Metadata map[string]string `json:"metadata,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 UploadNewResponseEnvelope added in v0.6.0

type UploadNewResponseEnvelope struct {
	// Data contains the response object
	Data Upload `json:"data,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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) 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 a new upload with the specified name.

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 Webhook

type Webhook struct {
	// Unique identifier of the webhook
	ID string `json:"id,required"`
	// Whether the webhook is currently enabled
	Enabled bool `json:"enabled,required"`
	// Array of event types this webhook subscribes to
	//
	// Any of "job.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	Events []string `json:"events,required"`
	// ID of the project this webhook belongs to
	ProjectID string `json:"project_id,required"`
	// URL where webhook events will be sent
	URL string `json:"url,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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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 []Webhook `json:"data,required"`
	// Status indicates the response status "success"
	Status string `json:"status,required"`
	// 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 (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,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.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	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,required"`
	// Status indicates the response status "success"
	Status constant.Success `json:"status,required"`
	// 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.completed", "job.failed", "job.cancelled", "upload.completed",
	// "upload.failed", "upload.expired".
	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,required"`
	// 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 between 15 and 120 fps.
	Framerate float64 `json:"framerate"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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
		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 between 15 and 120 fps.
	Framerate param.Opt[float64] `json:"framerate,omitzero"`
	// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 300.
	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"`
	// 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
	// 100Kbps and 50Mbps.
	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,required"`
	// 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"
)

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