Documentation
¶
Index ¶
- Constants
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type AnalyticsConnection
- type AnalyticsConnectionStatus
- type AnalyticsConnectionType
- type AnalyticsKey
- type AnalyticsKeyPurpose
- type Asset
- type AssetActionInput
- type AssetActionInputLanguageCode
- type AssetActionInputResolution
- type AssetActionResult
- type AssetActionResultOutputType
- type AssetActionRun
- type AssetActionStatus
- type AssetActionType
- type AssetCaption
- type AssetCaptionOutput
- type AssetCaptionOutputCreateParams
- type AssetCaptionOutputParams
- type AssetCaptionOutputParamsLanguageCode
- type AssetCaptionStatus
- type AssetCreateStorageParams
- type AssetDefaults
- type AssetDefaultsMaxResolution
- type AssetDefaultsMinResolution
- type AssetDefaultsParams
- type AssetDeleteParams
- type AssetError
- type AssetErrorStage
- type AssetGetResponseEnvelope
- type AssetListParams
- type AssetListParamsCreated
- type AssetMaxResolution
- type AssetMinResolution
- type AssetNewParams
- type AssetNewParamsMaxResolution
- type AssetNewParamsMinResolution
- type AssetNewResponseEnvelope
- type AssetOutputDeleteParams
- type AssetOutputError
- type AssetOutputGetParams
- type AssetOutputGetResponseEnvelope
- type AssetOutputListParams
- type AssetOutputListParamsStatus
- type AssetOutputListParamsType
- type AssetOutputNewParams
- type AssetOutputNewResponseEnvelope
- type AssetOutputService
- func (r *AssetOutputService) Delete(ctx context.Context, outputID string, params AssetOutputDeleteParams, ...) (err error)
- func (r *AssetOutputService) Get(ctx context.Context, outputID string, query AssetOutputGetParams, ...) (res *AssetOutputUnion, err error)
- func (r *AssetOutputService) List(ctx context.Context, assetID string, query AssetOutputListParams, ...) (res *pagination.PaginatedResults[AssetOutputUnion], err error)
- func (r *AssetOutputService) ListAutoPaging(ctx context.Context, assetID string, query AssetOutputListParams, ...) *pagination.PaginatedResultsAutoPager[AssetOutputUnion]
- func (r *AssetOutputService) New(ctx context.Context, assetID string, body AssetOutputNewParams, ...) (res *AssetOutputUnion, err error)
- type AssetOutputStatus
- type AssetOutputUnion
- func (u AssetOutputUnion) AsAny() anyAssetOutput
- func (u AssetOutputUnion) AsCaption() (v AssetCaptionOutput)
- func (u AssetOutputUnion) AsStaticRendition() (v AssetStaticRenditionOutput)
- func (u AssetOutputUnion) AsThumbnail() (v AssetThumbnailOutput)
- func (u AssetOutputUnion) AsTranscript() (v AssetTranscriptOutput)
- func (u AssetOutputUnion) RawJSON() string
- func (r *AssetOutputUnion) UnmarshalJSON(data []byte) error
- type AssetOutputUnionDetails
- type AssetOutputUnionDetailsError
- type AssetPoster
- type AssetRenditionProgress
- type AssetRenditionProgressStage
- type AssetService
- func (r *AssetService) Delete(ctx context.Context, assetID string, body AssetDeleteParams, ...) (err error)
- func (r *AssetService) Get(ctx context.Context, assetID string, opts ...option.RequestOption) (res *Asset, err error)
- func (r *AssetService) List(ctx context.Context, query AssetListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Asset], err error)
- func (r *AssetService) ListAutoPaging(ctx context.Context, query AssetListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Asset]
- func (r *AssetService) New(ctx context.Context, body AssetNewParams, opts ...option.RequestOption) (res *Asset, err error)
- func (r *AssetService) Update(ctx context.Context, assetID string, body AssetUpdateParams, ...) (err error)
- type AssetSourceMetadata
- type AssetStaticRendition
- type AssetStaticRenditionCreateParams
- type AssetStaticRenditionCreateParamsResolution
- type AssetStaticRenditionOutput
- type AssetStaticRenditionOutputCreateParams
- type AssetStaticRenditionRequestedResolution
- type AssetStaticRenditionStatus
- type AssetStatus
- type AssetThumbnailCreateParams
- type AssetThumbnailOutput
- type AssetThumbnailOutputCreateParams
- type AssetTimelinePreviews
- type AssetTranscript
- type AssetTranscriptContent
- type AssetTranscriptOutput
- type AssetTranscriptOutputCreateParams
- type AssetTranscriptOutputParams
- type AssetTranscriptSegment
- type AssetUpdateParams
- type AssetWorkflowActionListParams
- type AssetWorkflowActionListParamsCreated
- type AssetWorkflowActionListParamsStatus
- type AssetWorkflowActionListParamsType
- type AssetWorkflowActionService
- func (r *AssetWorkflowActionService) List(ctx context.Context, assetID string, query AssetWorkflowActionListParams, ...) (res *pagination.PaginatedResults[AssetActionRun], err error)
- func (r *AssetWorkflowActionService) ListAutoPaging(ctx context.Context, assetID string, query AssetWorkflowActionListParams, ...) *pagination.PaginatedResultsAutoPager[AssetActionRun]
- type AssetWorkflowService
- type AssetWorkflowUpdateResponseEnvelope
- type AwsRegion
- type ChunkifyError
- type ChunkifyErrorType
- type ChunkifyRegion
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CreatedVia
- type Error
- type Event
- type EventDeliveryStatus
- type EventGetResponseEnvelope
- type EventListParams
- type EventListParamsCreated
- type EventService
- func (r *EventService) Get(ctx context.Context, eventID string, opts ...option.RequestOption) (res *Event, err error)
- func (r *EventService) List(ctx context.Context, query EventListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Event], err error)
- func (r *EventService) ListAutoPaging(ctx context.Context, query EventListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Event]
- type FileGetResponseEnvelope
- type FileListParams
- type FileListParamsCreated
- type FileListParamsDuration
- type FileListParamsHeight
- type FileListParamsPath
- type FileListParamsSize
- type FileListParamsWidth
- type FileService
- func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (err error)deprecated
- func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *JobFile, err error)deprecated
- func (r *FileService) List(ctx context.Context, query FileListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[JobFile], err error)deprecated
- func (r *FileService) ListAutoPaging(ctx context.Context, query FileListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[JobFile]deprecated
- type HlsAv1
- type HlsAv1HlsSegmentType
- type HlsAv1Param
- type HlsAv1Pixfmt
- type HlsAv1Preset
- type HlsAv1Profilev
- type HlsH264
- type HlsH264HlsSegmentType
- type HlsH264Param
- type HlsH264Pixfmt
- type HlsH264Preset
- type HlsH264Profilev
- type HlsH265
- type HlsH265HlsSegmentType
- type HlsH265Param
- type HlsH265Pixfmt
- type HlsH265Preset
- type HlsH265Profilev
- type InstanceType
- type Job
- type JobCreateFormatParamsUnion
- func (u JobCreateFormatParamsUnion) GetAudioBitrate() *int64
- func (u JobCreateFormatParamsUnion) GetBufsize() *int64
- func (u JobCreateFormatParamsUnion) GetCPUUsed() *string
- func (u JobCreateFormatParamsUnion) GetChannels() *int64
- func (u JobCreateFormatParamsUnion) GetChunkDuration() *int64
- func (u JobCreateFormatParamsUnion) GetCrf() *int64
- func (u JobCreateFormatParamsUnion) GetDisableAudio() *bool
- func (u JobCreateFormatParamsUnion) GetDisableVideo() *bool
- func (u JobCreateFormatParamsUnion) GetDuration() *int64
- func (u JobCreateFormatParamsUnion) GetFramerate() *float64
- func (u JobCreateFormatParamsUnion) GetFrames() *int64
- func (u JobCreateFormatParamsUnion) GetGop() *int64
- func (u JobCreateFormatParamsUnion) GetHeight() *int64
- func (u JobCreateFormatParamsUnion) GetHlsEnc() *bool
- func (u JobCreateFormatParamsUnion) GetHlsEncIv() *string
- func (u JobCreateFormatParamsUnion) GetHlsEncKey() *string
- func (u JobCreateFormatParamsUnion) GetHlsEncKeyURL() *string
- func (u JobCreateFormatParamsUnion) GetHlsSegmentType() *string
- func (u JobCreateFormatParamsUnion) GetHlsSingleFile() *bool
- func (u JobCreateFormatParamsUnion) GetHlsTime() *int64
- func (u JobCreateFormatParamsUnion) GetID() *string
- func (u JobCreateFormatParamsUnion) GetInterval() *int64
- func (u JobCreateFormatParamsUnion) GetLevel() *int64
- func (u JobCreateFormatParamsUnion) GetMaxrate() *int64
- func (u JobCreateFormatParamsUnion) GetMinrate() *int64
- func (u JobCreateFormatParamsUnion) GetMovflags() *string
- func (u JobCreateFormatParamsUnion) GetPerTitle() *bool
- func (u JobCreateFormatParamsUnion) GetPixfmt() *string
- func (u JobCreateFormatParamsUnion) GetPreset() *string
- func (u JobCreateFormatParamsUnion) GetProfilev() *string
- func (u JobCreateFormatParamsUnion) GetQuality() *string
- func (u JobCreateFormatParamsUnion) GetSeek() *int64
- func (u JobCreateFormatParamsUnion) GetSprite() *bool
- func (u JobCreateFormatParamsUnion) GetVideoBitrate() *int64
- func (u JobCreateFormatParamsUnion) GetWidth() *int64
- func (u JobCreateFormatParamsUnion) GetX264Keyint() *int64
- func (u JobCreateFormatParamsUnion) GetX265Keyint() *int64
- func (u JobCreateFormatParamsUnion) MarshalJSON() ([]byte, error)
- func (u *JobCreateFormatParamsUnion) UnmarshalJSON(data []byte) error
- type JobCreateStorageParams
- type JobCreateTranscoderParams
- type JobFile
- type JobFileListResponse
- type JobFileService
- type JobFormatHlsAv1
- type JobFormatHlsH264
- type JobFormatHlsH265
- type JobFormatID
- type JobFormatJpg
- type JobFormatMP4Av1
- type JobFormatMP4H264
- type JobFormatMP4H265
- type JobFormatUnion
- func (u JobFormatUnion) AsAny() anyJobFormat
- func (u JobFormatUnion) AsHlsAv1() (v JobFormatHlsAv1)
- func (u JobFormatUnion) AsHlsH264() (v JobFormatHlsH264)
- func (u JobFormatUnion) AsHlsH265() (v JobFormatHlsH265)
- func (u JobFormatUnion) AsJpg() (v JobFormatJpg)
- func (u JobFormatUnion) AsMP4Av1() (v JobFormatMP4Av1)
- func (u JobFormatUnion) AsMP4H264() (v JobFormatMP4H264)
- func (u JobFormatUnion) AsMP4H265() (v JobFormatMP4H265)
- func (u JobFormatUnion) AsWebmVp9() (v JobFormatWebmVp9)
- func (u JobFormatUnion) RawJSON() string
- func (r *JobFormatUnion) UnmarshalJSON(data []byte) error
- type JobFormatWebmVp9
- type JobGetResponseEnvelope
- type JobListParams
- type JobListParamsCreated
- type JobListParamsStatus
- type JobLogListParams
- type JobLogListParamsService
- type JobLogListResponse
- type JobLogService
- type JobNewParams
- type JobNewResponseEnvelope
- type JobService
- func (r *JobService) Cancel(ctx context.Context, jobID string, opts ...option.RequestOption) (err error)deprecated
- func (r *JobService) Delete(ctx context.Context, jobID string, opts ...option.RequestOption) (err error)deprecated
- func (r *JobService) Get(ctx context.Context, jobID string, opts ...option.RequestOption) (res *Job, err error)deprecated
- func (r *JobService) List(ctx context.Context, query JobListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Job], err error)deprecated
- func (r *JobService) ListAutoPaging(ctx context.Context, query JobListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Job]deprecated
- func (r *JobService) New(ctx context.Context, body JobNewParams, opts ...option.RequestOption) (res *Job, err error)deprecated
- type JobStatus
- type JobStorage
- type JobTranscoder
- type JobTranscoderListResponse
- type JobTranscoderService
- type Jpg
- type JpgParam
- type Log
- type LogLevel
- type LogService
- type MP4Av1
- type MP4Av1Param
- type MP4Av1Pixfmt
- type MP4Av1Preset
- type MP4Av1Profilev
- type MP4H264
- type MP4H264Param
- type MP4H264Pixfmt
- type MP4H264Preset
- type MP4H264Profilev
- type MP4H265
- type MP4H265Param
- type MP4H265Pixfmt
- type MP4H265Preset
- type MP4H265Profilev
- type MetricAssetsParams
- type MetricAssetsParamsFormat
- type MetricAssetsResponseEnvelope
- type MetricService
- func (r *MetricService) Assets(ctx context.Context, query MetricAssetsParams, opts ...option.RequestOption) (res *MetricsAssets, err error)
- func (r *MetricService) Storage(ctx context.Context, query MetricStorageParams, opts ...option.RequestOption) (res *MetricsStorage, err error)
- func (r *MetricService) Usage(ctx context.Context, query MetricUsageParams, opts ...option.RequestOption) (res *MetricsUsage, err error)
- type MetricStorageParams
- type MetricStorageParamsFormat
- type MetricStorageResponseEnvelope
- type MetricUsageParams
- type MetricUsageParamsFormat
- type MetricUsageResponseEnvelope
- type MetricsAssetCounts
- type MetricsAssetDay
- type MetricsAssetOutputs
- type MetricsAssetSources
- type MetricsAssetStreaming
- type MetricsAssetTimings
- type MetricsAssetValues
- type MetricsAssets
- type MetricsCreditsSpent
- type MetricsStorage
- type MetricsStorageDay
- type MetricsStorageEntry
- type MetricsStorageValues
- type MetricsUsage
- type MetricsUsageAssets
- type MetricsUsageCaptions
- type MetricsUsageDay
- type MetricsUsageEgress
- type MetricsUsageNotifications
- type MetricsUsageSources
- type MetricsUsageStaticRenditions
- type MetricsUsageThumbnails
- type MetricsUsageTranscodings
- type MetricsUsageUploads
- type MetricsUsageValues
- type Notification
- type NotificationGetResponseEnvelope
- type NotificationListParams
- type NotificationListParamsCreated
- type NotificationListParamsResponseStatusCode
- type NotificationNewParams
- type NotificationNewResponseEnvelope
- type NotificationPayloadAsset
- type NotificationPayloadAssetData
- type NotificationPayloadAssetDeleted
- type NotificationPayloadAssetDeletedData
- type NotificationPayloadAssetDeletedEvent
- type NotificationPayloadAssetEvent
- type NotificationPayloadAssetOutput
- type NotificationPayloadAssetOutputData
- type NotificationPayloadAssetOutputDeleted
- type NotificationPayloadAssetOutputDeletedData
- type NotificationPayloadAssetOutputDeletedEvent
- type NotificationPayloadAssetOutputEvent
- type NotificationPayloadJobCompleted
- type NotificationPayloadJobCompletedData
- type NotificationPayloadJobCompletedEvent
- type NotificationPayloadJobCreated
- type NotificationPayloadJobCreatedData
- type NotificationPayloadJobCreatedEvent
- type NotificationPayloadJobFailed
- type NotificationPayloadJobFailedData
- type NotificationPayloadJobFailedEvent
- type NotificationPayloadSourceCreated
- type NotificationPayloadSourceCreatedData
- type NotificationPayloadSourceCreatedEvent
- type NotificationPayloadSourceDeleted
- type NotificationPayloadSourceDeletedData
- type NotificationPayloadSourceDeletedEvent
- type NotificationPayloadThumbnail
- type NotificationPayloadThumbnailData
- type NotificationPayloadThumbnailEvent
- type NotificationPayloadTranscoding
- type NotificationPayloadTranscodingData
- type NotificationPayloadTranscodingEvent
- type NotificationPayloadUploadCompleted
- type NotificationPayloadUploadCompletedData
- type NotificationPayloadUploadCompletedEvent
- type NotificationPayloadUploadCreated
- type NotificationPayloadUploadCreatedData
- type NotificationPayloadUploadCreatedEvent
- type NotificationPayloadUploadFailed
- type NotificationPayloadUploadFailedData
- type NotificationPayloadUploadFailedEvent
- type NotificationPayloadWorkflowRun
- type NotificationPayloadWorkflowRunData
- type NotificationPayloadWorkflowRunEvent
- type NotificationService
- func (r *NotificationService) Delete(ctx context.Context, notificationID string, opts ...option.RequestOption) (err error)
- func (r *NotificationService) Get(ctx context.Context, notificationID string, opts ...option.RequestOption) (res *Notification, err error)
- func (r *NotificationService) List(ctx context.Context, query NotificationListParams, ...) (res *pagination.PaginatedResults[Notification], err error)
- func (r *NotificationService) ListAutoPaging(ctx context.Context, query NotificationListParams, ...) *pagination.PaginatedResultsAutoPager[Notification]
- func (r *NotificationService) New(ctx context.Context, body NotificationNewParams, opts ...option.RequestOption) (res *Notification, err error)
- type Project
- type ProjectAnalyticsConnectionDeleteParams
- type ProjectAnalyticsConnectionGetParams
- type ProjectAnalyticsConnectionGetResponseEnvelope
- type ProjectAnalyticsConnectionKeyListParams
- type ProjectAnalyticsConnectionKeyListResponse
- type ProjectAnalyticsConnectionKeyNewParams
- type ProjectAnalyticsConnectionKeyNewParamsPurpose
- type ProjectAnalyticsConnectionKeyNewResponse
- type ProjectAnalyticsConnectionKeyRotateParams
- type ProjectAnalyticsConnectionKeyRotateResponse
- type ProjectAnalyticsConnectionKeyService
- func (r *ProjectAnalyticsConnectionKeyService) List(ctx context.Context, connectionID string, ...) (res *ProjectAnalyticsConnectionKeyListResponse, err error)
- func (r *ProjectAnalyticsConnectionKeyService) New(ctx context.Context, connectionID string, ...) (res *ProjectAnalyticsConnectionKeyNewResponse, err error)
- func (r *ProjectAnalyticsConnectionKeyService) Rotate(ctx context.Context, keyID string, ...) (res *ProjectAnalyticsConnectionKeyRotateResponse, err error)
- type ProjectAnalyticsConnectionListResponse
- type ProjectAnalyticsConnectionNewParams
- type ProjectAnalyticsConnectionNewParamsType
- type ProjectAnalyticsConnectionNewResponse
- type ProjectAnalyticsConnectionService
- func (r *ProjectAnalyticsConnectionService) Delete(ctx context.Context, connectionID string, ...) (err error)
- func (r *ProjectAnalyticsConnectionService) Get(ctx context.Context, connectionID string, ...) (res *AnalyticsConnection, err error)
- func (r *ProjectAnalyticsConnectionService) List(ctx context.Context, projectID string, opts ...option.RequestOption) (res *ProjectAnalyticsConnectionListResponse, err error)
- func (r *ProjectAnalyticsConnectionService) New(ctx context.Context, projectID string, ...) (res *ProjectAnalyticsConnectionNewResponse, err error)
- func (r *ProjectAnalyticsConnectionService) Update(ctx context.Context, connectionID string, ...) (res *AnalyticsConnection, err error)
- type ProjectAnalyticsConnectionUpdateParams
- type ProjectAnalyticsConnectionUpdateResponseEnvelope
- type ProjectAnalyticsService
- type ProjectGetResponseEnvelope
- type ProjectListResponse
- type ProjectNewParams
- type ProjectNewResponseEnvelope
- type ProjectService
- func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (err error)
- func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) List(ctx context.Context, opts ...option.RequestOption) (res *ProjectListResponse, err error)
- func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
- func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, ...) (err error)
- type ProjectUpdateParams
- type Source
- type SourceCreateStorageParams
- type SourceGetResponseEnvelope
- type SourceListParams
- type SourceListParamsCreated
- type SourceListParamsDevice
- type SourceListParamsDuration
- type SourceListParamsHeight
- type SourceListParamsSize
- type SourceListParamsWidth
- type SourceNewParams
- type SourceNewResponseEnvelope
- type SourceService
- func (r *SourceService) Delete(ctx context.Context, sourceID string, opts ...option.RequestOption) (err error)
- func (r *SourceService) Get(ctx context.Context, sourceID string, opts ...option.RequestOption) (res *Source, err error)
- func (r *SourceService) List(ctx context.Context, query SourceListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Source], err error)
- func (r *SourceService) ListAutoPaging(ctx context.Context, query SourceListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Source]
- func (r *SourceService) New(ctx context.Context, body SourceNewParams, opts ...option.RequestOption) (res *Source, err error)
- type StorageAws
- type StorageAwsCreateParams
- type StorageChunkify
- type StorageChunkifyCreateParams
- type StorageCloudflare
- type StorageCloudflareCreateParams
- type StorageCloudflareCreateParamsLocation
- type StorageGetResponseEnvelope
- type StorageListResponse
- type StorageLocation
- type StorageNewParams
- type StorageNewResponseEnvelope
- type StorageS3Compatible
- type StorageS3CompatibleAddressingStyle
- type StorageS3CompatibleCreateParams
- type StorageService
- func (r *StorageService) Delete(ctx context.Context, storageID string, opts ...option.RequestOption) (err error)
- func (r *StorageService) Get(ctx context.Context, storageID string, opts ...option.RequestOption) (res *StorageUnion, err error)
- func (r *StorageService) List(ctx context.Context, opts ...option.RequestOption) (res *StorageListResponse, err error)
- func (r *StorageService) New(ctx context.Context, body StorageNewParams, opts ...option.RequestOption) (res *StorageUnion, err error)
- func (r *StorageService) Update(ctx context.Context, storageID string, body StorageUpdateParams, ...) (err error)
- type StorageUnion
- func (u StorageUnion) AsAny() anyStorage
- func (u StorageUnion) AsAws() (v StorageAws)
- func (u StorageUnion) AsChunkify() (v StorageChunkify)
- func (u StorageUnion) AsCloudflare() (v StorageCloudflare)
- func (u StorageUnion) AsS3Compatible() (v StorageS3Compatible)
- func (u StorageUnion) RawJSON() string
- func (r *StorageUnion) UnmarshalJSON(data []byte) error
- type StorageUpdateParams
- type Thumbnail
- type ThumbnailCreateStorageParams
- type ThumbnailCrop
- type ThumbnailDeleteParams
- type ThumbnailError
- type ThumbnailFile
- type ThumbnailFileKind
- type ThumbnailFormat
- type ThumbnailGetResponseEnvelope
- type ThumbnailListParams
- type ThumbnailListParamsCreated
- type ThumbnailNewParams
- type ThumbnailNewResponseEnvelope
- type ThumbnailOutput
- type ThumbnailRange
- type ThumbnailRangeParams
- type ThumbnailSample
- type ThumbnailService
- func (r *ThumbnailService) Delete(ctx context.Context, thumbnailID string, body ThumbnailDeleteParams, ...) (err error)
- func (r *ThumbnailService) Get(ctx context.Context, thumbnailID string, opts ...option.RequestOption) (res *Thumbnail, err error)
- func (r *ThumbnailService) List(ctx context.Context, query ThumbnailListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Thumbnail], err error)
- func (r *ThumbnailService) ListAutoPaging(ctx context.Context, query ThumbnailListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Thumbnail]
- func (r *ThumbnailService) New(ctx context.Context, body ThumbnailNewParams, opts ...option.RequestOption) (res *Thumbnail, err error)
- type ThumbnailSettings
- type ThumbnailStatus
- type Token
- type TokenListResponse
- type TokenNewParams
- type TokenNewResponseEnvelope
- type TokenScope
- type TokenService
- func (r *TokenService) List(ctx context.Context, opts ...option.RequestOption) (res *TokenListResponse, err error)
- func (r *TokenService) New(ctx context.Context, body TokenNewParams, opts ...option.RequestOption) (res *Token, err error)
- func (r *TokenService) Revoke(ctx context.Context, tokenID string, opts ...option.RequestOption) (err error)
- type TranscoderStatus
- type TranscoderStatusStatus
- type Transcoding
- type TranscodingCreateFormatParamsUnion
- func (u TranscodingCreateFormatParamsUnion) GetAudioBitrate() *int64
- func (u TranscodingCreateFormatParamsUnion) GetAudioSamplerate() *int64
- func (u TranscodingCreateFormatParamsUnion) GetBufsize() *int64
- func (u TranscodingCreateFormatParamsUnion) GetCPUUsed() *string
- func (u TranscodingCreateFormatParamsUnion) GetChannels() *int64
- func (u TranscodingCreateFormatParamsUnion) GetCrf() *int64
- func (u TranscodingCreateFormatParamsUnion) GetDisableAudio() *bool
- func (u TranscodingCreateFormatParamsUnion) GetDisableVideo() *bool
- func (u TranscodingCreateFormatParamsUnion) GetDuration() *float64
- func (u TranscodingCreateFormatParamsUnion) GetFramerate() *float64
- func (u TranscodingCreateFormatParamsUnion) GetGop() *int64
- func (u TranscodingCreateFormatParamsUnion) GetHeight() *int64
- func (u TranscodingCreateFormatParamsUnion) GetID() *string
- func (u TranscodingCreateFormatParamsUnion) GetLevel() *int64
- func (u TranscodingCreateFormatParamsUnion) GetMaxrate() *int64
- func (u TranscodingCreateFormatParamsUnion) GetMinrate() *int64
- func (u TranscodingCreateFormatParamsUnion) GetMovflags() *string
- func (u TranscodingCreateFormatParamsUnion) GetPerTitle() *bool
- func (u TranscodingCreateFormatParamsUnion) GetPixfmt() *string
- func (u TranscodingCreateFormatParamsUnion) GetPreset() *string
- func (u TranscodingCreateFormatParamsUnion) GetProfilev() *string
- func (u TranscodingCreateFormatParamsUnion) GetQuality() *string
- func (u TranscodingCreateFormatParamsUnion) GetSeek() *float64
- func (u TranscodingCreateFormatParamsUnion) GetVideoBitrate() *int64
- func (u TranscodingCreateFormatParamsUnion) GetWidth() *int64
- func (u TranscodingCreateFormatParamsUnion) GetX264Keyint() *int64
- func (u TranscodingCreateFormatParamsUnion) GetX265Keyint() *int64
- func (u TranscodingCreateFormatParamsUnion) MarshalJSON() ([]byte, error)
- func (u *TranscodingCreateFormatParamsUnion) UnmarshalJSON(data []byte) error
- type TranscodingCreateStorageParams
- type TranscodingDeleteParams
- type TranscodingError
- type TranscodingFile
- type TranscodingFileThumbnail
- type TranscodingFileThumbnailFormat
- type TranscodingFileThumbnailStatus
- type TranscodingFormat
- type TranscodingFormatID
- type TranscodingGetResponseEnvelope
- type TranscodingListParams
- type TranscodingListParamsCreated
- type TranscodingListParamsFormat
- type TranscodingM4aAacParam
- type TranscodingMP4Av1Movflags
- type TranscodingMP4Av1Param
- type TranscodingMP4Av1Pixfmt
- type TranscodingMP4Av1Preset
- type TranscodingMP4Av1Profilev
- type TranscodingMP4H264Movflags
- type TranscodingMP4H264Param
- type TranscodingMP4H264Pixfmt
- type TranscodingMP4H264Preset
- type TranscodingMP4H264Profilev
- type TranscodingMP4H265Movflags
- type TranscodingMP4H265Param
- type TranscodingMP4H265Pixfmt
- type TranscodingMP4H265Preset
- type TranscodingMP4H265Profilev
- type TranscodingNewParams
- type TranscodingNewResponseEnvelope
- type TranscodingProcessingStage
- type TranscodingService
- func (r *TranscodingService) Cancel(ctx context.Context, transcodingID string, opts ...option.RequestOption) (err error)
- func (r *TranscodingService) Delete(ctx context.Context, transcodingID string, body TranscodingDeleteParams, ...) (err error)
- func (r *TranscodingService) Get(ctx context.Context, transcodingID string, opts ...option.RequestOption) (res *Transcoding, err error)
- func (r *TranscodingService) List(ctx context.Context, query TranscodingListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Transcoding], err error)
- func (r *TranscodingService) ListAutoPaging(ctx context.Context, query TranscodingListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Transcoding]
- func (r *TranscodingService) New(ctx context.Context, body TranscodingNewParams, opts ...option.RequestOption) (res *Transcoding, err error)
- type TranscodingStatus
- type TranscodingStorage
- type TranscodingWebmVp9CPUUsed
- type TranscodingWebmVp9Param
- type TranscodingWebmVp9Pixfmt
- type TranscodingWebmVp9Quality
- type UnwrapWebhookEventUnion
- func (u UnwrapWebhookEventUnion) AsAssetDeleted() (v NotificationPayloadAssetDeleted)
- func (u UnwrapWebhookEventUnion) AsAssetOutputDeleted() (v NotificationPayloadAssetOutputDeleted)
- func (u UnwrapWebhookEventUnion) AsJobCompleted() (v NotificationPayloadJobCompleted)
- func (u UnwrapWebhookEventUnion) AsJobCreated() (v NotificationPayloadJobCreated)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadAsset() (v NotificationPayloadAsset)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadAssetOutput() (v NotificationPayloadAssetOutput)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadJobFailed() (v NotificationPayloadJobFailed)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadThumbnail() (v NotificationPayloadThumbnail)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadTranscoding() (v NotificationPayloadTranscoding)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadUploadFailed() (v NotificationPayloadUploadFailed)
- func (u UnwrapWebhookEventUnion) AsNotificationPayloadWorkflowRun() (v NotificationPayloadWorkflowRun)
- func (u UnwrapWebhookEventUnion) AsSourceCreated() (v NotificationPayloadSourceCreated)
- func (u UnwrapWebhookEventUnion) AsSourceDeleted() (v NotificationPayloadSourceDeleted)
- func (u UnwrapWebhookEventUnion) AsUploadCompleted() (v NotificationPayloadUploadCompleted)
- func (u UnwrapWebhookEventUnion) AsUploadCreated() (v NotificationPayloadUploadCreated)
- func (u UnwrapWebhookEventUnion) RawJSON() string
- func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
- type UnwrapWebhookEventUnionData
- type Upload
- type UploadCompleteParams
- type UploadCreateStorageParams
- type UploadGetResponseEnvelope
- type UploadListParams
- type UploadListParamsCreated
- type UploadListParamsStatus
- type UploadMultipartPartParams
- type UploadMultipartSession
- type UploadMultipartSignedPart
- type UploadNewParams
- type UploadNewParamsUploadMode
- type UploadNewResponseEnvelope
- type UploadService
- func (r *UploadService) Complete(ctx context.Context, token string, body UploadCompleteParams, ...) (err error)
- func (r *UploadService) Delete(ctx context.Context, uploadID string, opts ...option.RequestOption) (err error)
- func (r *UploadService) Get(ctx context.Context, uploadID string, opts ...option.RequestOption) (res *Upload, err error)
- func (r *UploadService) List(ctx context.Context, query UploadListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Upload], err error)
- func (r *UploadService) ListAutoPaging(ctx context.Context, query UploadListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Upload]
- func (r *UploadService) New(ctx context.Context, body UploadNewParams, opts ...option.RequestOption) (res *Upload, err error)
- type UploadStatus
- type UploadUploadMode
- type Webhook
- type WebhookEvent
- type WebhookGetResponseEnvelope
- type WebhookListResponse
- type WebhookNewParams
- type WebhookNewResponseEnvelope
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)
- func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *Webhook, err error)
- func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
- func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)
- func (r *WebhookService) Unwrap(payload []byte, headers http.Header, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, error)
- func (r *WebhookService) Update(ctx context.Context, webhookID string, body WebhookUpdateParams, ...) (err error)
- type WebhookUpdateParams
- type WebmVp9
- type WebmVp9CPUUsed
- type WebmVp9Param
- type WebmVp9Pixfmt
- type WebmVp9Quality
- type Workflow
- type WorkflowActionCounts
- type WorkflowActionParamsUnion
- func WorkflowActionParamsOfCreateCaption(id string, params WorkflowCaptionParams) WorkflowActionParamsUnion
- func WorkflowActionParamsOfCreateStaticRendition(id string, params WorkflowStaticParams) WorkflowActionParamsUnion
- func WorkflowActionParamsOfCreateThumbnails(id string, params WorkflowThumbnailParams) WorkflowActionParamsUnion
- func WorkflowActionParamsOfCreateTranscript(id string, params WorkflowTranscriptParams) WorkflowActionParamsUnion
- func WorkflowActionParamsOfTranslateCaption(captionID WorkflowOutputBindingParams, id string, ...) WorkflowActionParamsUnion
- func (u WorkflowActionParamsUnion) GetCaptionID() *WorkflowOutputBindingParams
- func (u WorkflowActionParamsUnion) GetID() *string
- func (u WorkflowActionParamsUnion) GetParams() (res workflowActionParamsUnionParams)
- func (u WorkflowActionParamsUnion) GetTranscriptID() *WorkflowOutputBindingParams
- func (u WorkflowActionParamsUnion) GetType() *string
- func (u WorkflowActionParamsUnion) MarshalJSON() ([]byte, error)
- func (u *WorkflowActionParamsUnion) UnmarshalJSON(data []byte) error
- type WorkflowActionUnion
- func (u WorkflowActionUnion) AsAny() anyWorkflowAction
- func (u WorkflowActionUnion) AsCreateCaption() (v WorkflowCaptionAction)
- func (u WorkflowActionUnion) AsCreateStaticRendition() (v WorkflowStaticAction)
- func (u WorkflowActionUnion) AsCreateThumbnails() (v WorkflowThumbnailAction)
- func (u WorkflowActionUnion) AsCreateTranscript() (v WorkflowTranscriptAction)
- func (u WorkflowActionUnion) AsTranslateCaption() (v WorkflowTranslationAction)
- func (u WorkflowActionUnion) RawJSON() string
- func (r *WorkflowActionUnion) UnmarshalJSON(data []byte) error
- type WorkflowActionUnionParams
- type WorkflowCaption
- type WorkflowCaptionAction
- type WorkflowCaptionActionParams
- type WorkflowCaptionParams
- type WorkflowGetResponseEnvelope
- type WorkflowListParams
- type WorkflowNewParams
- type WorkflowNewResponseEnvelope
- type WorkflowOrigin
- type WorkflowOriginParams
- type WorkflowOutputBinding
- type WorkflowOutputBindingFrom
- type WorkflowOutputBindingParams
- type WorkflowRevision
- type WorkflowRevisionGetParams
- type WorkflowRevisionGetResponseEnvelope
- type WorkflowRevisionService
- type WorkflowRule
- type WorkflowRuleEvent
- type WorkflowRuleParams
- type WorkflowRun
- type WorkflowRunActionGetParams
- type WorkflowRunActionGetResponseEnvelope
- type WorkflowRunActionListParams
- type WorkflowRunActionListParamsCreated
- type WorkflowRunActionListParamsStatus
- type WorkflowRunActionListParamsType
- type WorkflowRunActionService
- func (r *WorkflowRunActionService) Get(ctx context.Context, actionRunID string, query WorkflowRunActionGetParams, ...) (res *AssetActionRun, err error)
- func (r *WorkflowRunActionService) List(ctx context.Context, runID string, params WorkflowRunActionListParams, ...) (res *pagination.PaginatedResults[AssetActionRun], err error)
- func (r *WorkflowRunActionService) ListAutoPaging(ctx context.Context, runID string, params WorkflowRunActionListParams, ...) *pagination.PaginatedResultsAutoPager[AssetActionRun]
- type WorkflowRunGetParams
- type WorkflowRunGetResponseEnvelope
- type WorkflowRunListParams
- type WorkflowRunListParamsCreated
- type WorkflowRunListParamsStatus
- type WorkflowRunService
- func (r *WorkflowRunService) Get(ctx context.Context, runID string, query WorkflowRunGetParams, ...) (res *WorkflowRun, err error)
- func (r *WorkflowRunService) List(ctx context.Context, workflowID string, query WorkflowRunListParams, ...) (res *pagination.PaginatedResults[WorkflowRun], err error)
- func (r *WorkflowRunService) ListAutoPaging(ctx context.Context, workflowID string, query WorkflowRunListParams, ...) *pagination.PaginatedResultsAutoPager[WorkflowRun]
- type WorkflowRunStatus
- type WorkflowService
- func (r *WorkflowService) Delete(ctx context.Context, workflowID string, opts ...option.RequestOption) (err error)
- func (r *WorkflowService) Get(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *Workflow, err error)
- func (r *WorkflowService) List(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Workflow], err error)
- func (r *WorkflowService) ListAutoPaging(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Workflow]
- func (r *WorkflowService) New(ctx context.Context, body WorkflowNewParams, opts ...option.RequestOption) (res *Workflow, err error)
- func (r *WorkflowService) Update(ctx context.Context, workflowID string, body WorkflowUpdateParams, ...) (err error)
- type WorkflowStatic
- type WorkflowStaticAction
- type WorkflowStaticActionParams
- type WorkflowStaticParams
- type WorkflowStaticResolution
- type WorkflowThumbnail
- type WorkflowThumbnailAction
- type WorkflowThumbnailActionParams
- type WorkflowThumbnailParams
- type WorkflowThumbnailRange
- type WorkflowThumbnailRangeParams
- type WorkflowTranscript
- type WorkflowTranscriptAction
- type WorkflowTranscriptActionParams
- type WorkflowTranscriptParams
- type WorkflowTranslation
- type WorkflowTranslationAction
- type WorkflowTranslationActionParams
- type WorkflowTranslationLanguageCode
- type WorkflowTranslationParams
- type WorkflowUpdateParams
Constants ¶
const ChunkifyErrorTypeCancelled = shared.ChunkifyErrorTypeCancelled
Equals "cancelled"
const ChunkifyErrorTypeDownload = shared.ChunkifyErrorTypeDownload
Equals "download"
const ChunkifyErrorTypeFfmpeg = shared.ChunkifyErrorTypeFfmpeg
Equals "ffmpeg"
const ChunkifyErrorTypeIngest = shared.ChunkifyErrorTypeIngest
Equals "ingest"
const ChunkifyErrorTypeJob = shared.ChunkifyErrorTypeJob
Equals "job"
const ChunkifyErrorTypePermission = shared.ChunkifyErrorTypePermission
Equals "permission"
const ChunkifyErrorTypeSetup = shared.ChunkifyErrorTypeSetup
Equals "setup"
const ChunkifyErrorTypeSource = shared.ChunkifyErrorTypeSource
Equals "source"
const ChunkifyErrorTypeTimeout = shared.ChunkifyErrorTypeTimeout
Equals "timeout"
const ChunkifyErrorTypeUnexpected = shared.ChunkifyErrorTypeUnexpected
Equals "unexpected"
const ChunkifyErrorTypeUpload = shared.ChunkifyErrorTypeUpload
Equals "upload"
const CreatedViaAPI = shared.CreatedViaAPI
Equals "api"
const CreatedViaDashboard = shared.CreatedViaDashboard
Equals "dashboard"
const CreatedViaMcp = shared.CreatedViaMcp
Equals "mcp"
const CreatedViaWorkflow = shared.CreatedViaWorkflow
Equals "workflow"
const InstanceType16vCPU = shared.InstanceType16vCPU
Equals "16vCPU"
const InstanceType4vCPU = shared.InstanceType4vCPU
Equals "4vCPU"
const InstanceType8vCPU = shared.InstanceType8vCPU
Equals "8vCPU"
const LogLevelDebug = shared.LogLevelDebug
Equals "debug"
const LogLevelError = shared.LogLevelError
Equals "error"
const LogLevelInfo = shared.LogLevelInfo
Equals "info"
const LogServiceManager = shared.LogServiceManager
Equals "manager"
const LogServiceTranscoder = shared.LogServiceTranscoder
Equals "transcoder"
const TranscoderStatusStatusCancelled = shared.TranscoderStatusStatusCancelled
Equals "cancelled"
const TranscoderStatusStatusCompleted = shared.TranscoderStatusStatusCompleted
Equals "completed"
const TranscoderStatusStatusFailed = shared.TranscoderStatusStatusFailed
Equals "failed"
const TranscoderStatusStatusPending = shared.TranscoderStatusStatusPending
Equals "pending"
const TranscoderStatusStatusStarting = shared.TranscoderStatusStatusStarting
Equals "starting"
const TranscoderStatusStatusTranscoding = shared.TranscoderStatusStatusTranscoding
Equals "transcoding"
Variables ¶
This section is empty.
Functions ¶
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 Opt ¶ added in v0.6.0
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type AnalyticsConnection ¶ added in v0.17.0
type AnalyticsConnection struct {
// Id identifies this saved analytics connection.
ID string `json:"id" api:"required"`
// CreatedAt records when this connection was added.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// DefaultForDashboard selects this connection for Chunkify dashboard players,
// public previews, the playground and newly generated snippets. It does not change
// existing external players. At most one connection per project is selected.
DefaultForDashboard bool `json:"default_for_dashboard" api:"required"`
// Endpoint specifies the analytics server base URL. It does not configure the
// player.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Name identifies this connection in the dashboard.
Name string `json:"name" api:"required"`
// ProjectId identifies the owning Chunkify project.
ProjectID string `json:"project_id" api:"required"`
// Status indicates whether the connection is ready to read or requires setup
// repair.
//
// Any of "preparing", "ready", "failed".
Status AnalyticsConnectionStatus `json:"status" api:"required"`
// Type specifies whether Chunkify manages the analytics project.
//
// Any of "hosted", "custom".
Type AnalyticsConnectionType `json:"type" api:"required"`
// UpdatedAt records when this connection was last changed.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// AllowedOrigins lists additional website origins permitted to ingest events for a
// hosted connection. Shared installation origins remain allowed. An empty list
// clears project-specific origins. Custom servers manage origins on their own
// infrastructure.
AllowedOrigins []string `json:"allowed_origins"`
// LastCheckedAt records the most recent successful connection check.
LastCheckedAt time.Time `json:"last_checked_at" format:"date-time"`
// PublicIngestKey is the public browser ingestion key used by Chunkify previews
// and player examples. It cannot read or manage analytics. Hosted connections use
// their primary public key. Omitted when preview tracking is not configured.
PublicIngestKey string `json:"public_ingest_key"`
// RetentionSeconds is the last retention applied to a hosted project, in seconds.
// Omitted for custom connections.
RetentionSeconds int64 `json:"retention_seconds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DefaultForDashboard respjson.Field
Endpoint respjson.Field
Name respjson.Field
ProjectID respjson.Field
Status respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
AllowedOrigins respjson.Field
LastCheckedAt respjson.Field
PublicIngestKey respjson.Field
RetentionSeconds respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A saved source for analytics reports. The dashboard player default is independent of the connection selected in reports. External players keep their own configuration. Only the public ingest key is included; read and management credentials stay private.
func (AnalyticsConnection) RawJSON ¶ added in v0.17.0
func (r AnalyticsConnection) RawJSON() string
Returns the unmodified JSON received from the API
func (*AnalyticsConnection) UnmarshalJSON ¶ added in v0.17.0
func (r *AnalyticsConnection) UnmarshalJSON(data []byte) error
type AnalyticsConnectionStatus ¶ added in v0.17.0
type AnalyticsConnectionStatus string
Status indicates whether the connection is ready to read or requires setup repair.
const ( AnalyticsConnectionStatusPreparing AnalyticsConnectionStatus = "preparing" AnalyticsConnectionStatusReady AnalyticsConnectionStatus = "ready" AnalyticsConnectionStatusFailed AnalyticsConnectionStatus = "failed" )
type AnalyticsConnectionType ¶ added in v0.17.0
type AnalyticsConnectionType string
Type specifies whether Chunkify manages the analytics project.
const ( AnalyticsConnectionTypeHosted AnalyticsConnectionType = "hosted" AnalyticsConnectionTypeCustom AnalyticsConnectionType = "custom" )
type AnalyticsKey ¶ added in v0.17.0
type AnalyticsKey struct {
// Id identifies this key in the collector.
ID string `json:"id" api:"required"`
// Purpose distinguishes player ingestion, read-only API access and a separate
// read-only MCP credential. Read and MCP keys have the same collector permissions.
//
// Any of "player", "read", "mcp".
Purpose AnalyticsKeyPurpose `json:"purpose" api:"required"`
// PublicKey is the browser ingestion credential for a player key. Omitted for
// read-only API and MCP keys, whose secret values are shown once.
PublicKey string `json:"public_key"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Purpose respjson.Field
PublicKey respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One key per purpose. Public player values remain available; read and MCP values are returned only on creation or rotation.
func (AnalyticsKey) RawJSON ¶ added in v0.17.0
func (r AnalyticsKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*AnalyticsKey) UnmarshalJSON ¶ added in v0.17.0
func (r *AnalyticsKey) UnmarshalJSON(data []byte) error
type AnalyticsKeyPurpose ¶ added in v0.17.0
type AnalyticsKeyPurpose string
Purpose distinguishes player ingestion, read-only API access and a separate read-only MCP credential. Read and MCP keys have the same collector permissions.
const ( AnalyticsKeyPurposePlayer AnalyticsKeyPurpose = "player" AnalyticsKeyPurposeRead AnalyticsKeyPurpose = "read" AnalyticsKeyPurposeMcp AnalyticsKeyPurpose = "mcp" )
type Asset ¶ added in v0.17.0
type Asset struct {
// Unique Asset ID.
ID string `json:"id" api:"required"`
// Whether the Asset can accept new static rendition requests. Creation can still
// fail if the original video is no longer accessible.
CanAddStaticRenditions bool `json:"can_add_static_renditions" api:"required"`
// When the Asset was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Maximum streaming resolution selected at creation. Does not limit static
// renditions.
//
// Any of "1080p", "2160p".
MaxResolution AssetMaxResolution `json:"max_resolution" api:"required"`
// String metadata attached to the Asset.
Metadata map[string]string `json:"metadata" api:"required"`
// Minimum streaming resolution selected at creation. auto means no minimum;
// smaller sources are not upscaled.
//
// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
MinResolution AssetMinResolution `json:"min_resolution" api:"required"`
// Whether HLS playback is available, including while the Asset is preparing.
PlaybackReady bool `json:"playback_ready" api:"required"`
// Allow public preview access without an API token. Does not control CDN or static
// download access. Disabling it does not revoke signed URLs already issued.
PreviewEnabled bool `json:"preview_enabled" api:"required"`
// Original media metadata saved at Asset creation and preserved after Source
// deletion.
SourceMetadata AssetSourceMetadata `json:"source_metadata" api:"required"`
// Status specifies the Asset preparation state. ready means the video is prepared
// for playback, with its poster and timeline previews available. Static renditions
// and captions have independent statuses.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetStatus `json:"status" api:"required"`
// ID of the output Storage.
StorageID string `json:"storage_id" api:"required"`
// Asset title.
Title string `json:"title" api:"required"`
// When the Asset was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Selected Workflow ID, or null.
WorkflowID string `json:"workflow_id" api:"required"`
// Pinned Workflow revision, or null.
WorkflowRevision int64 `json:"workflow_revision" api:"required"`
// Unsigned CDN URL of the HLS master playlist. Available when playback_ready is
// true and Storage has a CDN URL.
CdnURL string `json:"cdn_url" format:"uri"`
// CreatedByTokenId specifies the Project token used to create the resource. It
// remains set after the token is revoked. Omitted for dashboard requests, MCP
// OAuth connections, Workflow actions, and unknown creators.
CreatedByTokenID string `json:"created_by_token_id"`
// CreatedByUserId specifies the team member who created the resource. Omitted for
// Workflow actions, unknown creators, and deleted accounts.
CreatedByUserID string `json:"created_by_user_id"`
// CreatedVia specifies how the resource was created: api for API requests,
// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
// Workflow actions. Omitted when the creator is unknown.
//
// Any of "api", "dashboard", "mcp", "workflow".
CreatedVia shared.CreatedVia `json:"created_via"`
Error AssetError `json:"error"`
// When managed outputs expire, 24 hours after readiness. Omitted for
// customer-connected Storage.
ExpiresAt time.Time `json:"expires_at" format:"date-time"`
// Path of the HLS master playlist in Storage. Available when playback_ready is
// true.
PlaybackPath string `json:"playback_path"`
// When HLS playback first became available.
PlaybackReadyAt time.Time `json:"playback_ready_at" format:"date-time"`
// Poster image, available once generated.
Poster AssetPoster `json:"poster"`
// Public HLS preview URL. Available when playback_ready and preview_enabled are
// true. No API token is required.
PreviewURL string `json:"preview_url" format:"uri"`
// When all required Asset outputs finished processing.
ReadyAt time.Time `json:"ready_at" format:"date-time"`
// Size specifies the total bytes of available streaming, playback preview, poster,
// and timeline files. Excludes static renditions. Omitted until the Asset is
// ready.
Size int64 `json:"size"`
// Original Source ID. Omitted after Source deletion.
SourceID string `json:"source_id"`
// Timeline thumbnails. The WebVTT file maps video timestamps to image URLs and
// crop coordinates.
TimelinePreviews AssetTimelinePreviews `json:"timeline_previews"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CanAddStaticRenditions respjson.Field
CreatedAt respjson.Field
MaxResolution respjson.Field
Metadata respjson.Field
MinResolution respjson.Field
PlaybackReady respjson.Field
PreviewEnabled respjson.Field
SourceMetadata respjson.Field
Status respjson.Field
StorageID respjson.Field
Title respjson.Field
UpdatedAt respjson.Field
WorkflowID respjson.Field
WorkflowRevision respjson.Field
CdnURL respjson.Field
CreatedByTokenID respjson.Field
CreatedByUserID respjson.Field
CreatedVia respjson.Field
Error respjson.Field
ExpiresAt respjson.Field
PlaybackPath respjson.Field
PlaybackReadyAt respjson.Field
Poster respjson.Field
PreviewURL respjson.Field
ReadyAt respjson.Field
Size respjson.Field
SourceID respjson.Field
TimelinePreviews respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Asset) UnmarshalJSON ¶ added in v0.17.0
type AssetActionInput ¶ added in v1.0.0
type AssetActionInput struct {
// LanguageCode specifies the target language for the translated subtitle track,
// such as en or fr. The same code appears in the caption and HLS manifest.
//
// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
// "ru", "tr", "pl", "sv".
LanguageCode AssetActionInputLanguageCode `json:"language_code"`
// Resolution specifies the H.264 MP4 output resolution. highest selects the
// largest supported output without upscaling. Hobby supports up to 1080p; other
// plans support up to 2160p. Streaming resolution limits do not apply.
//
// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
// "2160p".
Resolution AssetActionInputResolution `json:"resolution"`
// ID of the original caption to translate. Included only for translation actions.
SourceCaptionID string `json:"source_caption_id"`
// Thumbnail settings. Included only for create_thumbnails actions.
Thumbnails WorkflowThumbnail `json:"thumbnails"`
// TranscriptId specifies the original transcript consumed by caption publication.
// Omitted for actions without a transcript input.
TranscriptID string `json:"transcript_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LanguageCode respjson.Field
Resolution respjson.Field
SourceCaptionID respjson.Field
Thumbnails respjson.Field
TranscriptID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Resolved action inputs. Only fields relevant to the action type are included.
func (AssetActionInput) RawJSON ¶ added in v1.0.0
func (r AssetActionInput) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetActionInput) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetActionInput) UnmarshalJSON(data []byte) error
type AssetActionInputLanguageCode ¶ added in v1.0.0
type AssetActionInputLanguageCode string
LanguageCode specifies the target language for the translated subtitle track, such as en or fr. The same code appears in the caption and HLS manifest.
const ( AssetActionInputLanguageCodeEn AssetActionInputLanguageCode = "en" AssetActionInputLanguageCodeFr AssetActionInputLanguageCode = "fr" AssetActionInputLanguageCodeEs AssetActionInputLanguageCode = "es" AssetActionInputLanguageCodeDe AssetActionInputLanguageCode = "de" AssetActionInputLanguageCodeIt AssetActionInputLanguageCode = "it" AssetActionInputLanguageCodePt AssetActionInputLanguageCode = "pt" AssetActionInputLanguageCodeNl AssetActionInputLanguageCode = "nl" AssetActionInputLanguageCodeJa AssetActionInputLanguageCode = "ja" AssetActionInputLanguageCodeKo AssetActionInputLanguageCode = "ko" AssetActionInputLanguageCodeZh AssetActionInputLanguageCode = "zh" AssetActionInputLanguageCodeAr AssetActionInputLanguageCode = "ar" AssetActionInputLanguageCodeHi AssetActionInputLanguageCode = "hi" AssetActionInputLanguageCodeRu AssetActionInputLanguageCode = "ru" AssetActionInputLanguageCodeTr AssetActionInputLanguageCode = "tr" AssetActionInputLanguageCodePl AssetActionInputLanguageCode = "pl" AssetActionInputLanguageCodeSv AssetActionInputLanguageCode = "sv" )
type AssetActionInputResolution ¶ added in v1.0.0
type AssetActionInputResolution string
Resolution specifies the H.264 MP4 output resolution. highest selects the largest supported output without upscaling. Hobby supports up to 1080p; other plans support up to 2160p. Streaming resolution limits do not apply.
const ( AssetActionInputResolutionHighest AssetActionInputResolution = "highest" AssetActionInputResolution240p AssetActionInputResolution = "240p" AssetActionInputResolution360p AssetActionInputResolution = "360p" AssetActionInputResolution480p AssetActionInputResolution = "480p" AssetActionInputResolution540p AssetActionInputResolution = "540p" AssetActionInputResolution720p AssetActionInputResolution = "720p" AssetActionInputResolution1080p AssetActionInputResolution = "1080p" AssetActionInputResolution1440p AssetActionInputResolution = "1440p" AssetActionInputResolution2160p AssetActionInputResolution = "2160p" )
type AssetActionResult ¶ added in v1.0.0
type AssetActionResult struct {
// ID of the caption, static rendition, or thumbnail request produced by the
// action.
OutputID string `json:"output_id" api:"required"`
// Type of output referenced by output_id. Caption generation and translation both
// produce caption outputs.
//
// Any of "caption", "static_rendition", "thumbnail", "transcript".
OutputType AssetActionResultOutputType `json:"output_type" api:"required"`
// Whether the action reused an existing output instead of creating one.
Reused bool `json:"reused" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
OutputID respjson.Field
OutputType respjson.Field
Reused respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Reference to the output created or reused by a completed action.
func (AssetActionResult) RawJSON ¶ added in v1.0.0
func (r AssetActionResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetActionResult) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetActionResult) UnmarshalJSON(data []byte) error
type AssetActionResultOutputType ¶ added in v1.0.0
type AssetActionResultOutputType string
Type of output referenced by output_id. Caption generation and translation both produce caption outputs.
const ( AssetActionResultOutputTypeCaption AssetActionResultOutputType = "caption" AssetActionResultOutputTypeStaticRendition AssetActionResultOutputType = "static_rendition" AssetActionResultOutputTypeThumbnail AssetActionResultOutputType = "thumbnail" AssetActionResultOutputTypeTranscript AssetActionResultOutputType = "transcript" )
type AssetActionRun ¶ added in v0.17.0
type AssetActionRun struct {
// Unique action execution ID, prefixed with acr\_.
ID string `json:"id" api:"required"`
// ID of the Asset processed by this action.
AssetID string `json:"asset_id" api:"required"`
// When the action completed, failed, was skipped, or was cancelled. Null while
// work remains.
CompletedAt time.Time `json:"completed_at" api:"required" format:"date-time"`
// When the action was accepted.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Resolved parameters and input references for this execution.
Input AssetActionInput `json:"input" api:"required"`
// Current execution status of the action.
//
// Any of "pending", "running", "waiting", "completed", "failed", "skipped",
// "cancelled".
Status AssetActionStatus `json:"status" api:"required"`
// Type of action performed.
//
// Any of "create_static_rendition", "create_caption", "create_transcript",
// "translate_caption", "create_thumbnails".
Type AssetActionType `json:"type" api:"required"`
// When the action was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// ID of the Workflow run that started the action. Null for direct output requests.
WorkflowRunID string `json:"workflow_run_id" api:"required"`
// Action key within the rule. Omitted for direct output requests.
ActionID string `json:"action_id"`
// Reason the action failed. Omitted when no failure message is available.
Error string `json:"error"`
// Machine-readable reason for waiting, skipping, failure, or cancellation. Omitted
// when no reason applies.
Reason string `json:"reason"`
// Output reference and reuse flag. Included when the action completes
// successfully.
Result AssetActionResult `json:"result"`
// Rule key from the Workflow definition. Omitted for direct output requests.
RuleID string `json:"rule_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
CompletedAt respjson.Field
CreatedAt respjson.Field
Input respjson.Field
Status respjson.Field
Type respjson.Field
UpdatedAt respjson.Field
WorkflowRunID respjson.Field
ActionID respjson.Field
Error respjson.Field
Reason respjson.Field
Result respjson.Field
RuleID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One execution of an Asset action, started by a Workflow or a direct output request.
func (AssetActionRun) RawJSON ¶ added in v0.17.0
func (r AssetActionRun) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetActionRun) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetActionRun) UnmarshalJSON(data []byte) error
type AssetActionStatus ¶ added in v1.0.0
type AssetActionStatus string
Current action status. pending means accepted; running means executing; waiting means awaiting Asset readiness or an output. completed, failed, skipped, and cancelled are terminal states.
const ( AssetActionStatusPending AssetActionStatus = "pending" AssetActionStatusRunning AssetActionStatus = "running" AssetActionStatusWaiting AssetActionStatus = "waiting" AssetActionStatusCompleted AssetActionStatus = "completed" AssetActionStatusFailed AssetActionStatus = "failed" AssetActionStatusSkipped AssetActionStatus = "skipped" AssetActionStatusCancelled AssetActionStatus = "cancelled" )
type AssetActionType ¶ added in v1.0.0
type AssetActionType string
The action performed: create a static rendition, generate an original transcript or captions, translate a caption, or generate thumbnails.
const ( AssetActionTypeCreateStaticRendition AssetActionType = "create_static_rendition" AssetActionTypeCreateCaption AssetActionType = "create_caption" AssetActionTypeCreateTranscript AssetActionType = "create_transcript" AssetActionTypeTranslateCaption AssetActionType = "translate_caption" AssetActionTypeCreateThumbnails AssetActionType = "create_thumbnails" )
type AssetCaption ¶ added in v1.0.0
type AssetCaption struct {
// Unique Asset output ID, prefixed with aop\_.
ID string `json:"id" api:"required"`
// Caption processing status.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetCaptionStatus `json:"status" api:"required"`
// Time this caption output was requested.
CreatedAt time.Time `json:"created_at" format:"date-time"`
// Reason caption processing failed.
Error shared.AssetOutputError `json:"error"`
// Primary language of this subtitle track, such as en or fr. Omitted when no
// speech was detected or processing has not finished.
LanguageCode string `json:"language_code"`
// Subtitle media playlist path in Storage. Available when speech was detected.
PlaylistPath string `json:"playlist_path"`
// Combined subtitle playlist and WebVTT size in bytes. Available when ready.
Size int64 `json:"size"`
// ID of the caption track translated to create this track. Omitted for speech
// transcription.
SourceCaptionID string `json:"source_caption_id"`
// TranscriptId identifies the original-language transcript used to generate this
// caption. Omitted for translated captions.
TranscriptID string `json:"transcript_id"`
// WebVTT subtitle segment path in Storage. Available when speech was detected.
VttPath string `json:"vtt_path"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
CreatedAt respjson.Field
Error respjson.Field
LanguageCode respjson.Field
PlaylistPath respjson.Field
Size respjson.Field
SourceCaptionID respjson.Field
TranscriptID respjson.Field
VttPath respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetCaption) RawJSON ¶ added in v1.0.0
func (r AssetCaption) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetCaption) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetCaption) UnmarshalJSON(data []byte) error
type AssetCaptionOutput ¶ added in v1.0.0
type AssetCaptionOutput struct {
// Id identifies the Asset output, prefixed with aop\_. The type field identifies
// the output kind.
ID string `json:"id" api:"required"`
// AssetId identifies the owning Asset.
AssetID string `json:"asset_id" api:"required"`
// Details contains the canonical typed output resource, including its available
// delivery fields.
Details AssetCaption `json:"details" api:"required"`
// Status specifies the output processing state. Expired means temporary output
// files are no longer available.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetOutputStatus `json:"status" api:"required"`
// Type identifies the output kind.
Type constant.Caption `json:"type" default:"caption"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
Details respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An Asset-owned caption output and its canonical resource details.
func (AssetCaptionOutput) RawJSON ¶ added in v1.0.0
func (r AssetCaptionOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetCaptionOutput) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetCaptionOutput) UnmarshalJSON(data []byte) error
type AssetCaptionOutputCreateParams ¶ added in v1.0.0
type AssetCaptionOutputCreateParams struct {
// Params specifies the settings for this output type.
Params AssetCaptionOutputParams `json:"params" api:"required"`
// Type specifies the output kind to create.
//
// This field can be elided, and will marshal its zero value as "caption".
Type constant.Caption `json:"type" default:"caption"`
// contains filtered or unexported fields
}
Create an Asset-owned caption output.
The properties Params, Type are required.
func (AssetCaptionOutputCreateParams) MarshalJSON ¶ added in v1.0.0
func (r AssetCaptionOutputCreateParams) MarshalJSON() (data []byte, err error)
func (*AssetCaptionOutputCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetCaptionOutputCreateParams) UnmarshalJSON(data []byte) error
type AssetCaptionOutputParams ¶ added in v1.0.0
type AssetCaptionOutputParams struct {
// SourceCaptionId specifies the caption on this Asset to translate. Supply
// language_code with this field. Omit both fields to generate original captions.
SourceCaptionID param.Opt[string] `json:"source_caption_id,omitzero"`
// LanguageCode specifies the target language for a translated caption. Supply
// source_caption_id with this field. Omit both fields to transcribe the Asset
// audio with automatic language detection.
//
// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
// "ru", "tr", "pl", "sv".
LanguageCode AssetCaptionOutputParamsLanguageCode `json:"language_code,omitzero"`
// contains filtered or unexported fields
}
Parameters for original captions or a translation of an existing caption on this Asset.
func (AssetCaptionOutputParams) MarshalJSON ¶ added in v1.0.0
func (r AssetCaptionOutputParams) MarshalJSON() (data []byte, err error)
func (*AssetCaptionOutputParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetCaptionOutputParams) UnmarshalJSON(data []byte) error
type AssetCaptionOutputParamsLanguageCode ¶ added in v1.0.0
type AssetCaptionOutputParamsLanguageCode string
LanguageCode specifies the target language for a translated caption. Supply source_caption_id with this field. Omit both fields to transcribe the Asset audio with automatic language detection.
const ( AssetCaptionOutputParamsLanguageCodeEn AssetCaptionOutputParamsLanguageCode = "en" AssetCaptionOutputParamsLanguageCodeFr AssetCaptionOutputParamsLanguageCode = "fr" AssetCaptionOutputParamsLanguageCodeEs AssetCaptionOutputParamsLanguageCode = "es" AssetCaptionOutputParamsLanguageCodeDe AssetCaptionOutputParamsLanguageCode = "de" AssetCaptionOutputParamsLanguageCodeIt AssetCaptionOutputParamsLanguageCode = "it" AssetCaptionOutputParamsLanguageCodePt AssetCaptionOutputParamsLanguageCode = "pt" AssetCaptionOutputParamsLanguageCodeNl AssetCaptionOutputParamsLanguageCode = "nl" AssetCaptionOutputParamsLanguageCodeJa AssetCaptionOutputParamsLanguageCode = "ja" AssetCaptionOutputParamsLanguageCodeKo AssetCaptionOutputParamsLanguageCode = "ko" AssetCaptionOutputParamsLanguageCodeZh AssetCaptionOutputParamsLanguageCode = "zh" AssetCaptionOutputParamsLanguageCodeAr AssetCaptionOutputParamsLanguageCode = "ar" AssetCaptionOutputParamsLanguageCodeHi AssetCaptionOutputParamsLanguageCode = "hi" AssetCaptionOutputParamsLanguageCodeRu AssetCaptionOutputParamsLanguageCode = "ru" AssetCaptionOutputParamsLanguageCodeTr AssetCaptionOutputParamsLanguageCode = "tr" AssetCaptionOutputParamsLanguageCodePl AssetCaptionOutputParamsLanguageCode = "pl" AssetCaptionOutputParamsLanguageCodeSv AssetCaptionOutputParamsLanguageCode = "sv" )
type AssetCaptionStatus ¶ added in v1.0.0
type AssetCaptionStatus string
Caption processing status.
const ( AssetCaptionStatusPreparing AssetCaptionStatus = "preparing" AssetCaptionStatusReady AssetCaptionStatus = "ready" AssetCaptionStatusFailed AssetCaptionStatus = "failed" AssetCaptionStatusExpired AssetCaptionStatus = "expired" )
type AssetCreateStorageParams ¶ added in v1.0.0
type AssetCreateStorageParams struct {
// ID of output Storage in this Project. Omit to use the Project default. Applies
// to all outputs, including static renditions added later.
ID param.Opt[string] `json:"id,omitzero"`
// contains filtered or unexported fields
}
func (AssetCreateStorageParams) MarshalJSON ¶ added in v1.0.0
func (r AssetCreateStorageParams) MarshalJSON() (data []byte, err error)
func (*AssetCreateStorageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetCreateStorageParams) UnmarshalJSON(data []byte) error
type AssetDefaults ¶ added in v1.0.0
type AssetDefaults struct {
// Delete generated and partial files from the output Storage when a new Asset
// fails. The Asset record and original Source are preserved. Cleanup is attempted
// once after a delay and requires delete permission on the Storage. Defaults to
// false. Existing Assets are unchanged.
DeleteFilesOnFailure bool `json:"delete_files_on_failure"`
// Maximum streaming resolution. Defaults to 1080p on Hobby and 2160p on other
// plans. 2160p requires Starter or above. Smaller sources are not upscaled. Does
// not affect static renditions.
//
// Any of "1080p", "2160p".
MaxResolution AssetDefaultsMaxResolution `json:"max_resolution"`
// Minimum streaming resolution. Defaults to auto, with no minimum. Must not exceed
// max_resolution. Smaller sources are not upscaled. Does not affect static
// renditions.
//
// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
MinResolution AssetDefaultsMinResolution `json:"min_resolution"`
// PathTemplate specifies the Asset output folder relative to Storage base_prefix.
// Supports {assetID} and case-sensitive {metadata.<key>}; referenced values must
// be non-empty. Ignored for Chunkify storage, which always uses {assetID}.
// Defaults to {assetID}. Maximum template size: 1024 UTF-8 bytes. Expanded prefix:
// 768 bytes including base_prefix and trailing slash.
PathTemplate string `json:"path_template"`
// Allow public preview access for new Assets without an API token. Defaults to
// true. Existing Assets are unchanged.
PreviewEnabled bool `json:"preview_enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DeleteFilesOnFailure respjson.Field
MaxResolution respjson.Field
MinResolution respjson.Field
PathTemplate respjson.Field
PreviewEnabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetDefaults) RawJSON ¶ added in v1.0.0
func (r AssetDefaults) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetDefaults) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetDefaults) UnmarshalJSON(data []byte) error
type AssetDefaultsMaxResolution ¶ added in v1.0.0
type AssetDefaultsMaxResolution string
const ( AssetDefaultsMaxResolution1080p AssetDefaultsMaxResolution = "1080p" AssetDefaultsMaxResolution2160p AssetDefaultsMaxResolution = "2160p" )
type AssetDefaultsMinResolution ¶ added in v1.0.0
type AssetDefaultsMinResolution string
const ( AssetDefaultsMinResolutionAuto AssetDefaultsMinResolution = "auto" AssetDefaultsMinResolution240p AssetDefaultsMinResolution = "240p" AssetDefaultsMinResolution360p AssetDefaultsMinResolution = "360p" AssetDefaultsMinResolution540p AssetDefaultsMinResolution = "540p" AssetDefaultsMinResolution720p AssetDefaultsMinResolution = "720p" AssetDefaultsMinResolution1080p AssetDefaultsMinResolution = "1080p" AssetDefaultsMinResolution1440p AssetDefaultsMinResolution = "1440p" AssetDefaultsMinResolution2160p AssetDefaultsMinResolution = "2160p" )
type AssetDefaultsParams ¶ added in v1.0.0
type AssetDefaultsParams struct {
// Delete generated and partial files from the output Storage when a new Asset
// fails. The Asset record and original Source are preserved. Cleanup is attempted
// once after a delay and requires delete permission on the Storage. Defaults to
// false. Existing Assets are unchanged.
DeleteFilesOnFailure param.Opt[bool] `json:"delete_files_on_failure,omitzero"`
// PathTemplate specifies the Asset output folder relative to Storage base_prefix.
// Supports {assetID} and case-sensitive {metadata.<key>}; referenced values must
// be non-empty. Ignored for Chunkify storage, which always uses {assetID}.
// Defaults to {assetID}. Maximum template size: 1024 UTF-8 bytes. Expanded prefix:
// 768 bytes including base_prefix and trailing slash.
PathTemplate param.Opt[string] `json:"path_template,omitzero"`
// Allow public preview access for new Assets without an API token. Defaults to
// true. Existing Assets are unchanged.
PreviewEnabled param.Opt[bool] `json:"preview_enabled,omitzero"`
// Maximum streaming resolution. Defaults to 1080p on Hobby and 2160p on other
// plans. 2160p requires Starter or above. Smaller sources are not upscaled. Does
// not affect static renditions.
//
// Any of "1080p", "2160p".
MaxResolution AssetDefaultsMaxResolution `json:"max_resolution,omitzero"`
// Minimum streaming resolution. Defaults to auto, with no minimum. Must not exceed
// max_resolution. Smaller sources are not upscaled. Does not affect static
// renditions.
//
// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
MinResolution AssetDefaultsMinResolution `json:"min_resolution,omitzero"`
// contains filtered or unexported fields
}
func (AssetDefaultsParams) MarshalJSON ¶ added in v1.0.0
func (r AssetDefaultsParams) MarshalJSON() (data []byte, err error)
func (*AssetDefaultsParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetDefaultsParams) UnmarshalJSON(data []byte) error
type AssetDeleteParams ¶ added in v0.17.0
type AssetDeleteParams struct {
// Also delete all files under the Asset's storage prefix, including streaming and
// static outputs. Other files and the original input are preserved. Defaults to
// false, which preserves published media files. Private transcript text and saved
// subtitle copies are always scheduled for removal. File deletion is irreversible.
// If cleanup fails, records remain for retry, but files may already be deleted.
DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetDeleteParams) URLQuery ¶ added in v0.17.0
func (r AssetDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes AssetDeleteParams's query parameters as `url.Values`.
type AssetError ¶ added in v0.17.0
type AssetError struct {
// Machine-readable processing error code.
Code string `json:"code" api:"required"`
// Description of the processing failure.
Message string `json:"message" api:"required"`
// Processing stage that failed.
//
// Any of "ingest", "analysis", "encoding", "packaging", "upload", "validation",
// "cleanup".
Stage AssetErrorStage `json:"stage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
Stage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetError) RawJSON ¶ added in v0.17.0
func (r AssetError) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetError) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetError) UnmarshalJSON(data []byte) error
type AssetErrorStage ¶ added in v1.0.0
type AssetErrorStage string
Processing stage that failed.
const ( AssetErrorStageIngest AssetErrorStage = "ingest" AssetErrorStageAnalysis AssetErrorStage = "analysis" AssetErrorStageEncoding AssetErrorStage = "encoding" AssetErrorStagePackaging AssetErrorStage = "packaging" AssetErrorStageUpload AssetErrorStage = "upload" AssetErrorStageValidation AssetErrorStage = "validation" AssetErrorStageCleanup AssetErrorStage = "cleanup" )
type AssetGetResponseEnvelope ¶ added in v0.17.0
type AssetGetResponseEnvelope struct {
Data Asset `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r AssetGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AssetListParams ¶ added in v0.17.0
type AssetListParams struct {
// Maximum number of Assets to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of Assets to skip.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Case-insensitive search of Asset IDs and titles.
Search param.Opt[string] `query:"search,omitzero" json:"-"`
// Filter Assets linked to this Source. Omit to include Assets from all Sources in
// the Project.
SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
// Filter by output Storage ID.
StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
Created AssetListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by metadata. Repeat key:value pairs to match all supplied metadata
// conditions.
Metadata []string `query:"metadata,omitzero" json:"-"`
// Filter by Asset status.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetListParams) URLQuery ¶ added in v0.17.0
func (r AssetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AssetListParams's query parameters as `url.Values`.
type AssetListParamsCreated ¶ added in v0.17.0
type AssetListParamsCreated struct {
// Created at or after this Unix timestamp in seconds.
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Created at or before this Unix timestamp in seconds.
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// Creation-time ordering. Defaults to newest first.
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetListParamsCreated) URLQuery ¶ added in v0.17.0
func (r AssetListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes AssetListParamsCreated's query parameters as `url.Values`.
type AssetMaxResolution ¶ added in v0.17.0
type AssetMaxResolution string
Maximum streaming resolution selected at creation. Does not limit static renditions.
const ( AssetMaxResolution1080p AssetMaxResolution = "1080p" AssetMaxResolution2160p AssetMaxResolution = "2160p" )
type AssetMinResolution ¶ added in v0.17.0
type AssetMinResolution string
Minimum streaming resolution selected at creation. auto means no minimum; smaller sources are not upscaled.
const ( AssetMinResolutionAuto AssetMinResolution = "auto" AssetMinResolution240p AssetMinResolution = "240p" AssetMinResolution360p AssetMinResolution = "360p" AssetMinResolution540p AssetMinResolution = "540p" AssetMinResolution720p AssetMinResolution = "720p" AssetMinResolution1080p AssetMinResolution = "1080p" AssetMinResolution1440p AssetMinResolution = "1440p" AssetMinResolution2160p AssetMinResolution = "2160p" )
type AssetNewParams ¶ added in v0.17.0
type AssetNewParams struct {
// ID of the video Source to process.
SourceID string `json:"source_id" api:"required"`
// WorkflowId specifies the Workflow to select. Omit to use the Project default.
// Set null to disable automatic actions. The current revision is pinned when
// creation is accepted.
WorkflowID param.Opt[string] `json:"workflow_id,omitzero"`
// PathTemplate specifies the Asset output folder relative to Storage base_prefix.
// Supports {assetID} and case-sensitive {metadata.<key>}; referenced values must
// be non-empty. Ignored for Chunkify storage, which always uses {assetID}.
// Overrides the Project default. Defaults to {assetID} when neither is set.
// Maximum template size: 1024 UTF-8 bytes. Expanded prefix: 768 bytes including
// base_prefix and trailing slash.
PathTemplate param.Opt[string] `json:"path_template,omitzero"`
// Allow public preview access without an API token. Omit to use the Project
// default. Does not control CDN or static download access.
PreviewEnabled param.Opt[bool] `json:"preview_enabled,omitzero"`
// Asset title, up to 256 characters. Defaults to an empty string.
Title param.Opt[string] `json:"title,omitzero"`
// Maximum streaming resolution. Omit to use the Project default, or the plan
// maximum if unset. 2160p requires Starter or above. Smaller sources are not
// upscaled. Does not affect static renditions.
//
// Any of "1080p", "2160p".
MaxResolution AssetNewParamsMaxResolution `json:"max_resolution,omitzero"`
// String metadata with a maximum encoded JSON size of 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Minimum streaming resolution. Omit to use the Project default; auto removes the
// minimum. Must not exceed max_resolution. Smaller sources are not upscaled. Does
// not affect static renditions.
//
// Any of "auto", "240p", "360p", "540p", "720p", "1080p", "1440p", "2160p".
MinResolution AssetNewParamsMinResolution `json:"min_resolution,omitzero"`
// Output Storage. Omit to use the Project default. The path_template controls the
// folder for generated output paths.
Storage AssetCreateStorageParams `json:"storage,omitzero"`
// contains filtered or unexported fields
}
func (AssetNewParams) MarshalJSON ¶ added in v0.17.0
func (r AssetNewParams) MarshalJSON() (data []byte, err error)
func (*AssetNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetNewParams) UnmarshalJSON(data []byte) error
type AssetNewParamsMaxResolution ¶ added in v0.17.0
type AssetNewParamsMaxResolution string
Maximum streaming resolution. Omit to use the Project default, or the plan maximum if unset. 2160p requires Starter or above. Smaller sources are not upscaled. Does not affect static renditions.
const ( AssetNewParamsMaxResolution1080p AssetNewParamsMaxResolution = "1080p" AssetNewParamsMaxResolution2160p AssetNewParamsMaxResolution = "2160p" )
type AssetNewParamsMinResolution ¶ added in v0.17.0
type AssetNewParamsMinResolution string
Minimum streaming resolution. Omit to use the Project default; auto removes the minimum. Must not exceed max_resolution. Smaller sources are not upscaled. Does not affect static renditions.
const ( AssetNewParamsMinResolutionAuto AssetNewParamsMinResolution = "auto" AssetNewParamsMinResolution240p AssetNewParamsMinResolution = "240p" AssetNewParamsMinResolution360p AssetNewParamsMinResolution = "360p" AssetNewParamsMinResolution540p AssetNewParamsMinResolution = "540p" AssetNewParamsMinResolution720p AssetNewParamsMinResolution = "720p" AssetNewParamsMinResolution1080p AssetNewParamsMinResolution = "1080p" AssetNewParamsMinResolution1440p AssetNewParamsMinResolution = "1440p" AssetNewParamsMinResolution2160p AssetNewParamsMinResolution = "2160p" )
type AssetNewResponseEnvelope ¶ added in v0.17.0
type AssetNewResponseEnvelope struct {
Data Asset `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetNewResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r AssetNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetNewResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AssetOutputDeleteParams ¶ added in v0.17.0
type AssetOutputDeleteParams struct {
AssetID string `path:"assetId" api:"required" json:"-"`
// DeleteFiles specifies whether to remove this output's published media files from
// Storage. Defaults to false, preserving those files. Transcript deletion always
// schedules removal of its private text and saved subtitle copy, regardless of
// this option. The Asset, Source, and other outputs are preserved. File cleanup
// failures retain the output record for retry; files already removed cannot be
// restored.
DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetOutputDeleteParams) URLQuery ¶ added in v0.17.0
func (r AssetOutputDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes AssetOutputDeleteParams's query parameters as `url.Values`.
type AssetOutputError ¶ added in v1.0.0
type AssetOutputError = shared.AssetOutputError
A customer-facing Asset output processing failure.
This is an alias to an internal type.
type AssetOutputGetParams ¶ added in v0.17.0
type AssetOutputGetParams struct {
AssetID string `path:"assetId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type AssetOutputGetResponseEnvelope ¶ added in v0.17.0
type AssetOutputGetResponseEnvelope struct {
// A resource produced for an Asset, requested directly or by a Workflow. Its type
// selects the details schema. Output state is independent of Asset playback
// readiness.
Data AssetOutputUnion `json:"data" api:"required"`
// Status is success for a successful request.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One Asset output.
func (AssetOutputGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r AssetOutputGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetOutputGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetOutputGetResponseEnvelope) UnmarshalJSON(data []byte) error
type AssetOutputListParams ¶ added in v0.17.0
type AssetOutputListParams struct {
// Limit specifies the maximum number of results to return. Accepts 1 to 100.
// Defaults to 100.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Offset specifies the number of matching results to skip. Must be at least 0.
// Defaults to 0.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Status specifies the current output state to include. Omit it to include all
// states.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetOutputListParamsStatus `query:"status,omitzero" json:"-"`
// Type specifies the output kind to include. Omit it to include all kinds.
//
// Any of "caption", "transcript", "static_rendition", "thumbnail".
Type AssetOutputListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetOutputListParams) URLQuery ¶ added in v0.17.0
func (r AssetOutputListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AssetOutputListParams's query parameters as `url.Values`.
type AssetOutputListParamsStatus ¶ added in v0.17.0
type AssetOutputListParamsStatus string
Status specifies the current output state to include. Omit it to include all states.
const ( AssetOutputListParamsStatusPreparing AssetOutputListParamsStatus = "preparing" AssetOutputListParamsStatusReady AssetOutputListParamsStatus = "ready" AssetOutputListParamsStatusFailed AssetOutputListParamsStatus = "failed" AssetOutputListParamsStatusExpired AssetOutputListParamsStatus = "expired" )
type AssetOutputListParamsType ¶ added in v0.17.0
type AssetOutputListParamsType string
Type specifies the output kind to include. Omit it to include all kinds.
const ( AssetOutputListParamsTypeCaption AssetOutputListParamsType = "caption" AssetOutputListParamsTypeTranscript AssetOutputListParamsType = "transcript" AssetOutputListParamsTypeStaticRendition AssetOutputListParamsType = "static_rendition" AssetOutputListParamsTypeThumbnail AssetOutputListParamsType = "thumbnail" )
type AssetOutputNewParams ¶ added in v0.17.0
type AssetOutputNewParams struct {
// This field is a request body variant, only one variant field can be set. Create
// an Asset-owned caption output.
OfCaption *AssetCaptionOutputCreateParams `json:",inline"`
// This field is a request body variant, only one variant field can be set. Create
// an Asset-owned static rendition output.
OfStaticRendition *AssetStaticRenditionOutputCreateParams `json:",inline"`
// This field is a request body variant, only one variant field can be set. Create
// an Asset-owned thumbnail output.
OfThumbnail *AssetThumbnailOutputCreateParams `json:",inline"`
// This field is a request body variant, only one variant field can be set. Create
// or reuse the original-language transcript for an Asset. Caption generation
// shares this transcript and its speech-recognition charge.
OfTranscript *AssetTranscriptOutputCreateParams `json:",inline"`
// contains filtered or unexported fields
}
func (AssetOutputNewParams) MarshalJSON ¶ added in v0.17.0
func (u AssetOutputNewParams) MarshalJSON() ([]byte, error)
func (*AssetOutputNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetOutputNewParams) UnmarshalJSON(data []byte) error
type AssetOutputNewResponseEnvelope ¶ added in v0.17.0
type AssetOutputNewResponseEnvelope struct {
// A resource produced for an Asset, requested directly or by a Workflow. Its type
// selects the details schema. Output state is independent of Asset playback
// readiness.
Data AssetOutputUnion `json:"data" api:"required"`
// Status is success for a successful request.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One Asset output.
func (AssetOutputNewResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r AssetOutputNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetOutputNewResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetOutputNewResponseEnvelope) UnmarshalJSON(data []byte) error
type AssetOutputService ¶ added in v0.17.0
type AssetOutputService struct {
Options []option.RequestOption
}
Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
AssetOutputService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAssetOutputService method instead.
func NewAssetOutputService ¶ added in v0.17.0
func NewAssetOutputService(opts ...option.RequestOption) (r AssetOutputService)
NewAssetOutputService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AssetOutputService) Delete ¶ added in v0.17.0
func (r *AssetOutputService) Delete(ctx context.Context, outputID string, params AssetOutputDeleteParams, opts ...option.RequestOption) (err error)
Delete one output belonging to this Asset and Project. Its type is resolved from the output ID. Type-specific processing and dependency restrictions still apply.
func (*AssetOutputService) Get ¶ added in v0.17.0
func (r *AssetOutputService) Get(ctx context.Context, outputID string, query AssetOutputGetParams, opts ...option.RequestOption) (res *AssetOutputUnion, err error)
Retrieve one output belonging to the specified Asset and authenticated Project. Delivery URLs follow the output resource retention and expiry rules.
func (*AssetOutputService) List ¶ added in v0.17.0
func (r *AssetOutputService) List(ctx context.Context, assetID string, query AssetOutputListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[AssetOutputUnion], err error)
List outputs requested directly or by a Workflow. Results are ordered by creation date, newest first, with descending output ID as a tie-breaker. Pagination and total apply after type and status filters. Core playback, poster and default timeline previews remain on the Asset.
func (*AssetOutputService) ListAutoPaging ¶ added in v0.17.0
func (r *AssetOutputService) ListAutoPaging(ctx context.Context, assetID string, query AssetOutputListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[AssetOutputUnion]
List outputs requested directly or by a Workflow. Results are ordered by creation date, newest first, with descending output ID as a tie-breaker. Pagination and total apply after type and status filters. Core playback, poster and default timeline previews remain on the Asset.
func (*AssetOutputService) New ¶ added in v0.17.0
func (r *AssetOutputService) New(ctx context.Context, assetID string, body AssetOutputNewParams, opts ...option.RequestOption) (res *AssetOutputUnion, err error)
Create one caption, static rendition or additional thumbnail output. The accepted output processes asynchronously and is returned in the same envelope as output reads.
type AssetOutputStatus ¶ added in v1.0.0
type AssetOutputStatus string
Status specifies the output processing state. Expired means temporary output files are no longer available.
const ( AssetOutputStatusPreparing AssetOutputStatus = "preparing" AssetOutputStatusReady AssetOutputStatus = "ready" AssetOutputStatusFailed AssetOutputStatus = "failed" AssetOutputStatusExpired AssetOutputStatus = "expired" )
type AssetOutputUnion ¶ added in v0.17.0
type AssetOutputUnion struct {
ID string `json:"id"`
AssetID string `json:"asset_id"`
// This field is a union of [AssetCaption], [AssetStaticRendition], [Thumbnail],
// [AssetTranscript]
Details AssetOutputUnionDetails `json:"details"`
// This field is from variant [AssetCaptionOutput].
Status AssetOutputStatus `json:"status"`
// Any of "caption", "static_rendition", "thumbnail", "transcript".
Type string `json:"type"`
JSON struct {
ID respjson.Field
AssetID respjson.Field
Details respjson.Field
Status respjson.Field
Type respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AssetOutputUnion contains all possible properties and values from AssetCaptionOutput, AssetStaticRenditionOutput, AssetThumbnailOutput, AssetTranscriptOutput.
Use the AssetOutputUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (AssetOutputUnion) AsAny ¶ added in v0.17.0
func (u AssetOutputUnion) AsAny() anyAssetOutput
Use the following switch statement to find the correct variant
switch variant := AssetOutputUnion.AsAny().(type) {
case chunkify.AssetCaptionOutput:
case chunkify.AssetStaticRenditionOutput:
case chunkify.AssetThumbnailOutput:
case chunkify.AssetTranscriptOutput:
default:
fmt.Errorf("no variant present")
}
func (AssetOutputUnion) AsCaption ¶ added in v0.17.0
func (u AssetOutputUnion) AsCaption() (v AssetCaptionOutput)
func (AssetOutputUnion) AsStaticRendition ¶ added in v0.17.0
func (u AssetOutputUnion) AsStaticRendition() (v AssetStaticRenditionOutput)
func (AssetOutputUnion) AsThumbnail ¶ added in v0.17.0
func (u AssetOutputUnion) AsThumbnail() (v AssetThumbnailOutput)
func (AssetOutputUnion) AsTranscript ¶ added in v0.17.0
func (u AssetOutputUnion) AsTranscript() (v AssetTranscriptOutput)
func (AssetOutputUnion) RawJSON ¶ added in v0.17.0
func (u AssetOutputUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetOutputUnion) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetOutputUnion) UnmarshalJSON(data []byte) error
type AssetOutputUnionDetails ¶ added in v0.17.0
type AssetOutputUnionDetails struct {
ID string `json:"id"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
// This field is a union of [shared.AssetOutputError], [ThumbnailError]
Error AssetOutputUnionDetailsError `json:"error"`
LanguageCode string `json:"language_code"`
// This field is from variant [AssetCaption].
PlaylistPath string `json:"playlist_path"`
Size int64 `json:"size"`
// This field is from variant [AssetCaption].
SourceCaptionID string `json:"source_caption_id"`
// This field is from variant [AssetCaption].
TranscriptID string `json:"transcript_id"`
// This field is from variant [AssetCaption].
VttPath string `json:"vtt_path"`
AssetID string `json:"asset_id"`
// This field is from variant [AssetStaticRendition].
Container constant.MP4 `json:"container"`
// This field is from variant [AssetStaticRendition].
Height int64 `json:"height"`
// This field is from variant [AssetStaticRendition].
Path string `json:"path"`
// This field is from variant [AssetStaticRendition].
RequestedResolution AssetStaticRenditionRequestedResolution `json:"requested_resolution"`
// This field is from variant [AssetStaticRendition].
Resolution string `json:"resolution"`
StorageID string `json:"storage_id"`
UpdatedAt time.Time `json:"updated_at"`
// This field is from variant [AssetStaticRendition].
VideoCodec constant.H264 `json:"video_codec"`
// This field is from variant [AssetStaticRendition].
Width int64 `json:"width"`
// This field is from variant [AssetStaticRendition].
AudioBitrate int64 `json:"audio_bitrate"`
// This field is from variant [AssetStaticRendition].
AudioCodec string `json:"audio_codec"`
// This field is from variant [AssetStaticRendition].
AudioSamplerate int64 `json:"audio_samplerate"`
// This field is from variant [AssetStaticRendition].
CdnURL string `json:"cdn_url"`
// This field is from variant [AssetStaticRendition].
Duration float64 `json:"duration"`
// This field is from variant [AssetStaticRendition].
Progress AssetRenditionProgress `json:"progress"`
ReadyAt time.Time `json:"ready_at"`
// This field is from variant [AssetStaticRendition].
URL string `json:"url"`
// This field is from variant [AssetStaticRendition].
VideoBitrate int64 `json:"video_bitrate"`
// This field is from variant [AssetStaticRendition].
VideoFramerate float64 `json:"video_framerate"`
// This field is from variant [Thumbnail].
Files []ThumbnailFile `json:"files"`
// This field is from variant [Thumbnail].
Metadata map[string]string `json:"metadata"`
// This field is from variant [Thumbnail].
Samples []ThumbnailSample `json:"samples"`
// This field is from variant [Thumbnail].
Settings ThumbnailSettings `json:"settings"`
// This field is from variant [Thumbnail].
SourceID string `json:"source_id"`
// This field is from variant [Thumbnail].
StoragePath string `json:"storage_path"`
// This field is from variant [Thumbnail].
StoragePrefix string `json:"storage_prefix"`
// This field is from variant [Thumbnail].
CreatedByTokenID string `json:"created_by_token_id"`
// This field is from variant [Thumbnail].
CreatedByUserID string `json:"created_by_user_id"`
// This field is from variant [Thumbnail].
CreatedVia shared.CreatedVia `json:"created_via"`
// This field is from variant [Thumbnail].
DeleteAt time.Time `json:"delete_at"`
// This field is from variant [Thumbnail].
ExpiresAt time.Time `json:"expires_at"`
// This field is from variant [AssetTranscript].
Content AssetTranscriptContent `json:"content"`
JSON struct {
ID respjson.Field
Status respjson.Field
CreatedAt respjson.Field
Error respjson.Field
LanguageCode respjson.Field
PlaylistPath respjson.Field
Size respjson.Field
SourceCaptionID respjson.Field
TranscriptID respjson.Field
VttPath respjson.Field
AssetID respjson.Field
Container respjson.Field
Height respjson.Field
Path respjson.Field
RequestedResolution respjson.Field
Resolution respjson.Field
StorageID respjson.Field
UpdatedAt respjson.Field
VideoCodec respjson.Field
Width respjson.Field
AudioBitrate respjson.Field
AudioCodec respjson.Field
AudioSamplerate respjson.Field
CdnURL respjson.Field
Duration respjson.Field
Progress respjson.Field
ReadyAt respjson.Field
URL respjson.Field
VideoBitrate respjson.Field
VideoFramerate respjson.Field
Files respjson.Field
Metadata respjson.Field
Samples respjson.Field
Settings respjson.Field
SourceID respjson.Field
StoragePath respjson.Field
StoragePrefix respjson.Field
CreatedByTokenID respjson.Field
CreatedByUserID respjson.Field
CreatedVia respjson.Field
DeleteAt respjson.Field
ExpiresAt respjson.Field
Content respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AssetOutputUnionDetails is an implicit subunion of AssetOutputUnion. AssetOutputUnionDetails provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the AssetOutputUnion.
func (*AssetOutputUnionDetails) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetOutputUnionDetails) UnmarshalJSON(data []byte) error
type AssetOutputUnionDetailsError ¶ added in v0.17.0
type AssetOutputUnionDetailsError struct {
Code string `json:"code"`
Message string `json:"message"`
JSON struct {
Code respjson.Field
Message respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
AssetOutputUnionDetailsError is an implicit subunion of AssetOutputUnion. AssetOutputUnionDetailsError provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the AssetOutputUnion.
func (*AssetOutputUnionDetailsError) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetOutputUnionDetailsError) UnmarshalJSON(data []byte) error
type AssetPoster ¶ added in v0.17.0
type AssetPoster struct {
// Image height in pixels.
Height int64 `json:"height" api:"required"`
// Image path in Storage.
Path string `json:"path" api:"required"`
// Image width in pixels.
Width int64 `json:"width" api:"required"`
// Unsigned image CDN URL. Available once the poster exists and Storage has a CDN
// URL.
CdnURL string `json:"cdn_url" format:"uri"`
// Public poster preview URL. Available when the Asset is ready and preview_enabled
// is true.
PreviewURL string `json:"preview_url" format:"uri"`
// Image size in bytes.
Size int64 `json:"size"`
// Position of the selected frame in seconds.
TimeSeconds float64 `json:"time_seconds"`
// Signed image URL, valid for up to ten minutes. Available once the poster exists,
// regardless of preview_enabled.
URL string `json:"url" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Height respjson.Field
Path respjson.Field
Width respjson.Field
CdnURL respjson.Field
PreviewURL respjson.Field
Size respjson.Field
TimeSeconds respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetPoster) RawJSON ¶ added in v0.17.0
func (r AssetPoster) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetPoster) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetPoster) UnmarshalJSON(data []byte) error
type AssetRenditionProgress ¶ added in v1.0.0
type AssetRenditionProgress struct {
// Stage specifies the current preparation activity. Finalization and streaming
// publication can overlap encoding; finalizing is shown once encoding has
// completed.
//
// Any of "queued", "starting", "encoding", "finalizing", "uploading".
Stage AssetRenditionProgressStage `json:"stage" api:"required"`
// Percent specifies the percentage of the video encoded so far. Present only
// during encoding when video duration is known. It may decrease if processing
// restarts. It does not estimate total preparation time.
Percent float64 `json:"percent"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Stage respjson.Field
Percent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Current rendition preparation progress. Encoding progress measures processed video duration, not elapsed time or playback availability.
func (AssetRenditionProgress) RawJSON ¶ added in v1.0.0
func (r AssetRenditionProgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetRenditionProgress) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetRenditionProgress) UnmarshalJSON(data []byte) error
type AssetRenditionProgressStage ¶ added in v1.0.0
type AssetRenditionProgressStage string
Stage specifies the current preparation activity. Finalization and streaming publication can overlap encoding; finalizing is shown once encoding has completed.
const ( AssetRenditionProgressStageQueued AssetRenditionProgressStage = "queued" AssetRenditionProgressStageStarting AssetRenditionProgressStage = "starting" AssetRenditionProgressStageEncoding AssetRenditionProgressStage = "encoding" AssetRenditionProgressStageFinalizing AssetRenditionProgressStage = "finalizing" AssetRenditionProgressStageUploading AssetRenditionProgressStage = "uploading" )
type AssetService ¶ added in v0.17.0
type AssetService struct {
Options []option.RequestOption
// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
Outputs AssetOutputService
// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
Workflow AssetWorkflowService
}
Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
AssetService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAssetService method instead.
func NewAssetService ¶ added in v0.17.0
func NewAssetService(opts ...option.RequestOption) (r AssetService)
NewAssetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AssetService) Delete ¶ added in v0.17.0
func (r *AssetService) Delete(ctx context.Context, assetID string, body AssetDeleteParams, opts ...option.RequestOption) (err error)
Delete an Asset after all processing finishes. Files remain in Storage unless delete_files is true.
func (*AssetService) Get ¶ added in v0.17.0
func (r *AssetService) Get(ctx context.Context, assetID string, opts ...option.RequestOption) (res *Asset, err error)
Retrieve an Asset and its streaming, static, poster, and timeline outputs.
func (*AssetService) List ¶ added in v0.17.0
func (r *AssetService) List(ctx context.Context, query AssetListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Asset], err error)
List Assets in the Project, with filtering and pagination.
func (*AssetService) ListAutoPaging ¶ added in v0.17.0
func (r *AssetService) ListAutoPaging(ctx context.Context, query AssetListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Asset]
List Assets in the Project, with filtering and pagination.
func (*AssetService) New ¶ added in v0.17.0
func (r *AssetService) New(ctx context.Context, body AssetNewParams, opts ...option.RequestOption) (res *Asset, err error)
Create an Asset from a video Source. Processing starts asynchronously.
func (*AssetService) Update ¶ added in v0.17.0
func (r *AssetService) Update(ctx context.Context, assetID string, body AssetUpdateParams, opts ...option.RequestOption) (err error)
Update the title, metadata, or public preview access. Omitted fields remain unchanged.
type AssetSourceMetadata ¶ added in v0.17.0
type AssetSourceMetadata struct {
// Original audio bitrate in bits per second, or zero when unavailable.
AudioBitrate int64 `json:"audio_bitrate" api:"required"`
// Original audio codec, or an empty string when there is no audio.
AudioCodec string `json:"audio_codec" api:"required"`
// Original audio sample rate in Hz, or zero when unavailable.
AudioSamplerate int64 `json:"audio_samplerate" api:"required"`
// Original duration in seconds.
Duration float64 `json:"duration" api:"required"`
// Original video height in pixels.
Height int64 `json:"height" api:"required"`
// Original file size in bytes.
Size int64 `json:"size" api:"required"`
// Original video bitrate in bits per second, or zero when unknown.
VideoBitrate int64 `json:"video_bitrate" api:"required"`
// Original video codec.
VideoCodec string `json:"video_codec" api:"required"`
// Original video frame rate in frames per second.
VideoFramerate float64 `json:"video_framerate" api:"required"`
// Original video width in pixels.
Width int64 `json:"width" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioBitrate respjson.Field
AudioCodec respjson.Field
AudioSamplerate respjson.Field
Duration respjson.Field
Height respjson.Field
Size respjson.Field
VideoBitrate respjson.Field
VideoCodec respjson.Field
VideoFramerate respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Original media metadata saved at Asset creation and preserved after Source deletion.
func (AssetSourceMetadata) RawJSON ¶ added in v0.17.0
func (r AssetSourceMetadata) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetSourceMetadata) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetSourceMetadata) UnmarshalJSON(data []byte) error
type AssetStaticRendition ¶ added in v1.0.0
type AssetStaticRendition struct {
// Unique Asset output ID, prefixed with aop\_.
ID string `json:"id" api:"required"`
// Parent Asset ID.
AssetID string `json:"asset_id" api:"required"`
// Media container.
Container constant.MP4 `json:"container" default:"mp4"`
// When the rendition was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Output height in pixels.
Height int64 `json:"height" api:"required"`
// MP4 path in Storage. Recreating the same resolution reuses this path and
// overwrites any retained file.
Path string `json:"path" api:"required"`
// Requested resolution selector.
//
// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
// "2160p".
RequestedResolution AssetStaticRenditionRequestedResolution `json:"requested_resolution" api:"required"`
// Selected output resolution. May be smaller than 240p for small sources. Use
// width and height for pixel dimensions.
Resolution string `json:"resolution" api:"required"`
// Processing status of this MP4, independent of streaming outputs.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetStaticRenditionStatus `json:"status" api:"required"`
// Storage containing this rendition, inherited from its Asset.
StorageID string `json:"storage_id" api:"required"`
// When the rendition was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Video codec.
VideoCodec constant.H264 `json:"video_codec" default:"h264"`
// Output width in pixels.
Width int64 `json:"width" api:"required"`
// Measured audio bitrate in bits per second. Omitted until known or when there is
// no audio.
AudioBitrate int64 `json:"audio_bitrate"`
// Measured audio codec. Omitted until known or when there is no audio.
AudioCodec string `json:"audio_codec"`
// Measured audio sample rate in Hz. Omitted until known or when there is no audio.
AudioSamplerate int64 `json:"audio_samplerate"`
// Unsigned MP4 CDN URL. Available when ready and unexpired and Storage has a CDN
// URL.
CdnURL string `json:"cdn_url" format:"uri"`
// Output duration in seconds. Omitted until ready.
Duration float64 `json:"duration"`
// A customer-facing Asset output processing failure.
Error shared.AssetOutputError `json:"error"`
// Progress specifies the current processing stage and encoding percentage. Omitted
// after processing ends.
Progress AssetRenditionProgress `json:"progress"`
// When the MP4 became available.
ReadyAt time.Time `json:"ready_at" format:"date-time"`
// File size in bytes. Omitted until ready.
Size int64 `json:"size"`
// Signed MP4 download URL, available when ready and unexpired. Valid for up to ten
// minutes. Retrieve the output to refresh it. Independent of preview_enabled.
URL string `json:"url" format:"uri"`
// Measured video bitrate in bits per second. Omitted until ready.
VideoBitrate int64 `json:"video_bitrate"`
// Measured video frame rate in frames per second. Omitted until known.
VideoFramerate float64 `json:"video_framerate"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
Container respjson.Field
CreatedAt respjson.Field
Height respjson.Field
Path respjson.Field
RequestedResolution respjson.Field
Resolution respjson.Field
Status respjson.Field
StorageID respjson.Field
UpdatedAt respjson.Field
VideoCodec respjson.Field
Width respjson.Field
AudioBitrate respjson.Field
AudioCodec respjson.Field
AudioSamplerate respjson.Field
CdnURL respjson.Field
Duration respjson.Field
Error respjson.Field
Progress respjson.Field
ReadyAt respjson.Field
Size respjson.Field
URL respjson.Field
VideoBitrate respjson.Field
VideoFramerate respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetStaticRendition) RawJSON ¶ added in v1.0.0
func (r AssetStaticRendition) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetStaticRendition) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetStaticRendition) UnmarshalJSON(data []byte) error
type AssetStaticRenditionCreateParams ¶ added in v0.17.0
type AssetStaticRenditionCreateParams struct {
// H.264 MP4 resolution. highest selects the largest supported output without
// upscaling. Hobby supports up to 1080p; other plans support up to 2160p.
// Independent of the streaming resolution limits.
//
// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
// "2160p".
Resolution AssetStaticRenditionCreateParamsResolution `json:"resolution,omitzero" api:"required"`
// contains filtered or unexported fields
}
Parameters for an independently processed H.264 MP4 rendition.
The property Resolution is required.
func (AssetStaticRenditionCreateParams) MarshalJSON ¶ added in v0.17.0
func (r AssetStaticRenditionCreateParams) MarshalJSON() (data []byte, err error)
func (*AssetStaticRenditionCreateParams) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetStaticRenditionCreateParams) UnmarshalJSON(data []byte) error
type AssetStaticRenditionCreateParamsResolution ¶ added in v0.17.0
type AssetStaticRenditionCreateParamsResolution string
H.264 MP4 resolution. highest selects the largest supported output without upscaling. Hobby supports up to 1080p; other plans support up to 2160p. Independent of the streaming resolution limits.
const ( AssetStaticRenditionCreateParamsResolutionHighest AssetStaticRenditionCreateParamsResolution = "highest" AssetStaticRenditionCreateParamsResolution240p AssetStaticRenditionCreateParamsResolution = "240p" AssetStaticRenditionCreateParamsResolution360p AssetStaticRenditionCreateParamsResolution = "360p" AssetStaticRenditionCreateParamsResolution480p AssetStaticRenditionCreateParamsResolution = "480p" AssetStaticRenditionCreateParamsResolution540p AssetStaticRenditionCreateParamsResolution = "540p" AssetStaticRenditionCreateParamsResolution720p AssetStaticRenditionCreateParamsResolution = "720p" AssetStaticRenditionCreateParamsResolution1080p AssetStaticRenditionCreateParamsResolution = "1080p" AssetStaticRenditionCreateParamsResolution1440p AssetStaticRenditionCreateParamsResolution = "1440p" AssetStaticRenditionCreateParamsResolution2160p AssetStaticRenditionCreateParamsResolution = "2160p" )
type AssetStaticRenditionOutput ¶ added in v1.0.0
type AssetStaticRenditionOutput struct {
// Id identifies the Asset output, prefixed with aop\_. The type field identifies
// the output kind.
ID string `json:"id" api:"required"`
// AssetId identifies the owning Asset.
AssetID string `json:"asset_id" api:"required"`
// Details contains the canonical typed output resource, including its available
// delivery fields.
Details AssetStaticRendition `json:"details" api:"required"`
// Status specifies the output processing state. Expired means temporary output
// files are no longer available.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetOutputStatus `json:"status" api:"required"`
// Type identifies the output kind.
Type constant.StaticRendition `json:"type" default:"static_rendition"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
Details respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An Asset-owned static rendition output and its canonical resource details.
func (AssetStaticRenditionOutput) RawJSON ¶ added in v1.0.0
func (r AssetStaticRenditionOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetStaticRenditionOutput) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetStaticRenditionOutput) UnmarshalJSON(data []byte) error
type AssetStaticRenditionOutputCreateParams ¶ added in v1.0.0
type AssetStaticRenditionOutputCreateParams struct {
// Params specifies the settings for this output type.
Params AssetStaticRenditionCreateParams `json:"params,omitzero" api:"required"`
// Type specifies the output kind to create.
//
// This field can be elided, and will marshal its zero value as "static_rendition".
Type constant.StaticRendition `json:"type" default:"static_rendition"`
// contains filtered or unexported fields
}
Create an Asset-owned static rendition output.
The properties Params, Type are required.
func (AssetStaticRenditionOutputCreateParams) MarshalJSON ¶ added in v1.0.0
func (r AssetStaticRenditionOutputCreateParams) MarshalJSON() (data []byte, err error)
func (*AssetStaticRenditionOutputCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetStaticRenditionOutputCreateParams) UnmarshalJSON(data []byte) error
type AssetStaticRenditionRequestedResolution ¶ added in v1.0.0
type AssetStaticRenditionRequestedResolution string
Requested resolution selector.
const ( AssetStaticRenditionRequestedResolutionHighest AssetStaticRenditionRequestedResolution = "highest" AssetStaticRenditionRequestedResolution240p AssetStaticRenditionRequestedResolution = "240p" AssetStaticRenditionRequestedResolution360p AssetStaticRenditionRequestedResolution = "360p" AssetStaticRenditionRequestedResolution480p AssetStaticRenditionRequestedResolution = "480p" AssetStaticRenditionRequestedResolution540p AssetStaticRenditionRequestedResolution = "540p" AssetStaticRenditionRequestedResolution720p AssetStaticRenditionRequestedResolution = "720p" AssetStaticRenditionRequestedResolution1080p AssetStaticRenditionRequestedResolution = "1080p" AssetStaticRenditionRequestedResolution1440p AssetStaticRenditionRequestedResolution = "1440p" AssetStaticRenditionRequestedResolution2160p AssetStaticRenditionRequestedResolution = "2160p" )
type AssetStaticRenditionStatus ¶ added in v1.0.0
type AssetStaticRenditionStatus string
Processing status of this MP4, independent of streaming outputs.
const ( AssetStaticRenditionStatusPreparing AssetStaticRenditionStatus = "preparing" AssetStaticRenditionStatusReady AssetStaticRenditionStatus = "ready" AssetStaticRenditionStatusFailed AssetStaticRenditionStatus = "failed" AssetStaticRenditionStatusExpired AssetStaticRenditionStatus = "expired" )
type AssetStatus ¶ added in v0.17.0
type AssetStatus string
const ( AssetStatusPreparing AssetStatus = "preparing" AssetStatusReady AssetStatus = "ready" AssetStatusFailed AssetStatus = "failed" AssetStatusExpired AssetStatus = "expired" )
type AssetThumbnailCreateParams ¶ added in v1.0.0
type AssetThumbnailCreateParams struct {
// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
// selected range.
Count param.Opt[int64] `json:"count,omitzero"`
// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
// cropping or upscaling.
Size param.Opt[int64] `json:"size,omitzero"`
// Format selects JPEG or WebP. Defaults to JPEG.
//
// Any of "jpeg", "webp".
Format ThumbnailFormat `json:"format,omitzero"`
// Metadata attaches string values to this request. The serialized object may
// contain at most 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Output selects images or sprites. Defaults to images.
//
// Any of "images", "sprites".
Output ThumbnailOutput `json:"output,omitzero"`
// Range limits sampling to part of the Source. Defaults to the whole Source
// duration.
Range ThumbnailRangeParams `json:"range,omitzero"`
// Timestamps specifies 1 to 100 Source-relative target times in seconds. Every
// timestamp must be within the selected range, including its start and excluding
// its end. Repeated targets produce separate outputs.
Timestamps []float64 `json:"timestamps,omitzero"`
// contains filtered or unexported fields
}
Generate additional thumbnails from a ready Asset using its retained input, folder and Storage. Specify exactly one of timestamps or count. Each layout, format and size combination can be requested once.
func (AssetThumbnailCreateParams) MarshalJSON ¶ added in v1.0.0
func (r AssetThumbnailCreateParams) MarshalJSON() (data []byte, err error)
func (*AssetThumbnailCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetThumbnailCreateParams) UnmarshalJSON(data []byte) error
type AssetThumbnailOutput ¶ added in v1.0.0
type AssetThumbnailOutput struct {
// Id identifies the Asset output, prefixed with aop\_. The type field identifies
// the output kind.
ID string `json:"id" api:"required"`
// AssetId identifies the owning Asset.
AssetID string `json:"asset_id" api:"required"`
// Details contains the canonical typed output resource, including its available
// delivery fields.
Details Thumbnail `json:"details" api:"required"`
// Status specifies the output processing state. Expired means temporary output
// files are no longer available.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetOutputStatus `json:"status" api:"required"`
// Type identifies the output kind.
Type constant.Thumbnail `json:"type" default:"thumbnail"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
Details respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An Asset-owned thumbnail output and its canonical resource details.
func (AssetThumbnailOutput) RawJSON ¶ added in v1.0.0
func (r AssetThumbnailOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetThumbnailOutput) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetThumbnailOutput) UnmarshalJSON(data []byte) error
type AssetThumbnailOutputCreateParams ¶ added in v1.0.0
type AssetThumbnailOutputCreateParams struct {
// Params specifies the settings for this output type.
Params AssetThumbnailCreateParams `json:"params" api:"required"`
// Type specifies the output kind to create.
//
// This field can be elided, and will marshal its zero value as "thumbnail".
Type constant.Thumbnail `json:"type" default:"thumbnail"`
// contains filtered or unexported fields
}
Create an Asset-owned thumbnail output.
The properties Params, Type are required.
func (AssetThumbnailOutputCreateParams) MarshalJSON ¶ added in v1.0.0
func (r AssetThumbnailOutputCreateParams) MarshalJSON() (data []byte, err error)
func (*AssetThumbnailOutputCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetThumbnailOutputCreateParams) UnmarshalJSON(data []byte) error
type AssetTimelinePreviews ¶ added in v0.17.0
type AssetTimelinePreviews struct {
// Thumbnail image layout.
Format constant.Sprite `json:"format" default:"sprite"`
// WebVTT file path in Storage.
VttPath string `json:"vtt_path" api:"required"`
// Unsigned WebVTT CDN URL. Available when the Asset is ready and Storage has a CDN
// URL.
CdnURL string `json:"cdn_url" format:"uri"`
// Number of thumbnails.
ImageCount int64 `json:"image_count"`
// Target thumbnail sampling interval in seconds. The WebVTT file provides actual
// cue timestamps.
IntervalSeconds float64 `json:"interval_seconds"`
// Public WebVTT preview URL with signed image references. Available when the Asset
// is ready and preview_enabled is true.
PreviewURL string `json:"preview_url" format:"uri"`
// Combined WebVTT and sprite image size in bytes.
Size int64 `json:"size"`
// Number of sprite images containing the thumbnails.
SpriteCount int64 `json:"sprite_count"`
// Thumbnail height in pixels.
ThumbnailHeight int64 `json:"thumbnail_height"`
// Thumbnail width in pixels.
ThumbnailWidth int64 `json:"thumbnail_width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Format respjson.Field
VttPath respjson.Field
CdnURL respjson.Field
ImageCount respjson.Field
IntervalSeconds respjson.Field
PreviewURL respjson.Field
Size respjson.Field
SpriteCount respjson.Field
ThumbnailHeight respjson.Field
ThumbnailWidth respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AssetTimelinePreviews) RawJSON ¶ added in v0.17.0
func (r AssetTimelinePreviews) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetTimelinePreviews) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetTimelinePreviews) UnmarshalJSON(data []byte) error
type AssetTranscript ¶ added in v1.0.0
type AssetTranscript struct {
// Id identifies the Asset output, prefixed with aop\_.
ID string `json:"id" api:"required"`
// Status specifies the output processing state. Expired means temporary output
// files are no longer available.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetOutputStatus `json:"status" api:"required"`
// Content contains the complete text and timed segments. Included when ready;
// omitted while preparing, failed or expired.
Content AssetTranscriptContent `json:"content"`
// A customer-facing Asset output processing failure.
Error shared.AssetOutputError `json:"error"`
// LanguageCode identifies the detected primary language, such as en. Omitted
// before recognition or when no speech is detected.
LanguageCode string `json:"language_code"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Status respjson.Field
Content respjson.Field
Error respjson.Field
LanguageCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An original-language transcript. Content is included in ready output responses and lifecycle event snapshots. Transcripts have no download or CDN URL.
func (AssetTranscript) RawJSON ¶ added in v1.0.0
func (r AssetTranscript) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetTranscript) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetTranscript) UnmarshalJSON(data []byte) error
type AssetTranscriptContent ¶ added in v1.0.0
type AssetTranscriptContent struct {
// Segments contains timed passages in chronological order. Individual word
// timestamps are not included.
Segments []AssetTranscriptSegment `json:"segments" api:"required"`
// Text contains the complete recognized speech in the original language.
Text string `json:"text" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Segments respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The complete transcript and its timed passages. An audio track without speech produces empty text and an empty segments array.
func (AssetTranscriptContent) RawJSON ¶ added in v1.0.0
func (r AssetTranscriptContent) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetTranscriptContent) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetTranscriptContent) UnmarshalJSON(data []byte) error
type AssetTranscriptOutput ¶ added in v1.0.0
type AssetTranscriptOutput struct {
// Id identifies the Asset output, prefixed with aop\_.
ID string `json:"id" api:"required"`
// AssetId identifies the owning Asset.
AssetID string `json:"asset_id" api:"required"`
// An original-language transcript. Content is included in ready output responses
// and lifecycle event snapshots. Transcripts have no download or CDN URL.
Details AssetTranscript `json:"details" api:"required"`
// Status specifies the output processing state. Expired means temporary output
// files are no longer available.
//
// Any of "preparing", "ready", "failed", "expired".
Status AssetOutputStatus `json:"status" api:"required"`
// Type identifies the output kind.
Type constant.Transcript `json:"type" default:"transcript"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
Details respjson.Field
Status respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An Asset-owned transcript output and its content.
func (AssetTranscriptOutput) RawJSON ¶ added in v1.0.0
func (r AssetTranscriptOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetTranscriptOutput) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetTranscriptOutput) UnmarshalJSON(data []byte) error
type AssetTranscriptOutputCreateParams ¶ added in v1.0.0
type AssetTranscriptOutputCreateParams struct {
// Parameters for an original-language transcript. Pass an empty object; the spoken
// language is detected automatically.
Params AssetTranscriptOutputParams `json:"params" api:"required"`
// Type specifies the output kind.
//
// This field can be elided, and will marshal its zero value as "transcript".
Type constant.Transcript `json:"type" default:"transcript"`
// contains filtered or unexported fields
}
Create or reuse the original-language transcript for an Asset. Caption generation shares this transcript and its speech-recognition charge.
The properties Params, Type are required.
func (AssetTranscriptOutputCreateParams) MarshalJSON ¶ added in v1.0.0
func (r AssetTranscriptOutputCreateParams) MarshalJSON() (data []byte, err error)
func (*AssetTranscriptOutputCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetTranscriptOutputCreateParams) UnmarshalJSON(data []byte) error
type AssetTranscriptOutputParams ¶ added in v1.0.0
type AssetTranscriptOutputParams struct {
// contains filtered or unexported fields
}
Parameters for an original-language transcript. Pass an empty object; the spoken language is detected automatically.
func (AssetTranscriptOutputParams) MarshalJSON ¶ added in v1.0.0
func (r AssetTranscriptOutputParams) MarshalJSON() (data []byte, err error)
func (*AssetTranscriptOutputParams) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetTranscriptOutputParams) UnmarshalJSON(data []byte) error
type AssetTranscriptSegment ¶ added in v1.0.0
type AssetTranscriptSegment struct {
// End specifies the passage end time in seconds.
End float64 `json:"end" api:"required"`
// Start specifies the passage start time in seconds.
Start float64 `json:"start" api:"required"`
// Text contains the recognized passage, including punctuation.
Text string `json:"text" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
End respjson.Field
Start respjson.Field
Text respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A timed passage of recognized speech. Times are seconds from the start of the Asset.
func (AssetTranscriptSegment) RawJSON ¶ added in v1.0.0
func (r AssetTranscriptSegment) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetTranscriptSegment) UnmarshalJSON ¶ added in v1.0.0
func (r *AssetTranscriptSegment) UnmarshalJSON(data []byte) error
type AssetUpdateParams ¶ added in v0.17.0
type AssetUpdateParams struct {
// Allow public preview access without an API token. Does not control CDN or static
// download access. Disabling it does not revoke signed URLs already issued.
PreviewEnabled param.Opt[bool] `json:"preview_enabled,omitzero"`
// Asset title, up to 256 characters. Send an empty string to clear it; omit to
// leave unchanged.
Title param.Opt[string] `json:"title,omitzero"`
// Replaces all metadata. Send {} to clear it; omit to leave unchanged. Maximum
// encoded JSON size: 2,048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// contains filtered or unexported fields
}
func (AssetUpdateParams) MarshalJSON ¶ added in v0.17.0
func (r AssetUpdateParams) MarshalJSON() (data []byte, err error)
func (*AssetUpdateParams) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetUpdateParams) UnmarshalJSON(data []byte) error
type AssetWorkflowActionListParams ¶ added in v0.17.0
type AssetWorkflowActionListParams struct {
// LatestPerAction specifies whether to return only the latest execution of each
// rule and action on the Asset. Defaults to false. Pagination and total count
// apply after this selection.
LatestPerAction param.Opt[bool] `query:"latest_per_action,omitzero" json:"-"`
// Limit specifies the maximum number of results to return. Accepts 1 to 100.
// Defaults to 100.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Offset specifies the number of matching results to skip. Must be at least 0.
// Defaults to 0.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Revision specifies the Workflow revision to filter by. Omit it to include all
// revisions.
Revision param.Opt[int64] `query:"revision,omitzero" json:"-"`
Created AssetWorkflowActionListParamsCreated `query:"created,omitzero" json:"-"`
// Status specifies the action status to filter by. Omit it to include all
// statuses.
//
// Any of "pending", "running", "waiting", "completed", "failed", "skipped",
// "cancelled".
Status AssetWorkflowActionListParamsStatus `query:"status,omitzero" json:"-"`
// Type specifies the action type to filter by. Omit it to include all action
// types.
//
// Any of "create_static_rendition", "create_caption", "create_transcript",
// "translate_caption".
Type AssetWorkflowActionListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetWorkflowActionListParams) URLQuery ¶ added in v0.17.0
func (r AssetWorkflowActionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AssetWorkflowActionListParams's query parameters as `url.Values`.
type AssetWorkflowActionListParamsCreated ¶ added in v0.17.0
type AssetWorkflowActionListParamsCreated struct {
// Created at or after this Unix timestamp in seconds.
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Created at or before this Unix timestamp in seconds.
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AssetWorkflowActionListParamsCreated) URLQuery ¶ added in v0.17.0
func (r AssetWorkflowActionListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes AssetWorkflowActionListParamsCreated's query parameters as `url.Values`.
type AssetWorkflowActionListParamsStatus ¶ added in v0.17.0
type AssetWorkflowActionListParamsStatus string
Status specifies the action status to filter by. Omit it to include all statuses.
const ( AssetWorkflowActionListParamsStatusPending AssetWorkflowActionListParamsStatus = "pending" AssetWorkflowActionListParamsStatusRunning AssetWorkflowActionListParamsStatus = "running" AssetWorkflowActionListParamsStatusWaiting AssetWorkflowActionListParamsStatus = "waiting" AssetWorkflowActionListParamsStatusCompleted AssetWorkflowActionListParamsStatus = "completed" AssetWorkflowActionListParamsStatusFailed AssetWorkflowActionListParamsStatus = "failed" AssetWorkflowActionListParamsStatusSkipped AssetWorkflowActionListParamsStatus = "skipped" AssetWorkflowActionListParamsStatusCancelled AssetWorkflowActionListParamsStatus = "cancelled" )
type AssetWorkflowActionListParamsType ¶ added in v0.17.0
type AssetWorkflowActionListParamsType string
Type specifies the action type to filter by. Omit it to include all action types.
const ( AssetWorkflowActionListParamsTypeCreateStaticRendition AssetWorkflowActionListParamsType = "create_static_rendition" AssetWorkflowActionListParamsTypeCreateCaption AssetWorkflowActionListParamsType = "create_caption" AssetWorkflowActionListParamsTypeCreateTranscript AssetWorkflowActionListParamsType = "create_transcript" AssetWorkflowActionListParamsTypeTranslateCaption AssetWorkflowActionListParamsType = "translate_caption" )
type AssetWorkflowActionService ¶ added in v0.17.0
type AssetWorkflowActionService struct {
Options []option.RequestOption
}
Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
AssetWorkflowActionService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAssetWorkflowActionService method instead.
func NewAssetWorkflowActionService ¶ added in v0.17.0
func NewAssetWorkflowActionService(opts ...option.RequestOption) (r AssetWorkflowActionService)
NewAssetWorkflowActionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AssetWorkflowActionService) List ¶ added in v0.17.0
func (r *AssetWorkflowActionService) List(ctx context.Context, assetID string, query AssetWorkflowActionListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[AssetActionRun], err error)
List retained Workflow actions for an Asset, newest first. Direct output requests are excluded.
func (*AssetWorkflowActionService) ListAutoPaging ¶ added in v0.17.0
func (r *AssetWorkflowActionService) ListAutoPaging(ctx context.Context, assetID string, query AssetWorkflowActionListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[AssetActionRun]
List retained Workflow actions for an Asset, newest first. Direct output requests are excluded.
type AssetWorkflowService ¶ added in v0.17.0
type AssetWorkflowService struct {
Options []option.RequestOption
// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
Actions AssetWorkflowActionService
}
Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
AssetWorkflowService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAssetWorkflowService method instead.
func NewAssetWorkflowService ¶ added in v0.17.0
func NewAssetWorkflowService(opts ...option.RequestOption) (r AssetWorkflowService)
NewAssetWorkflowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AssetWorkflowService) Update ¶ added in v0.17.0
func (r *AssetWorkflowService) Update(ctx context.Context, assetID string, opts ...option.RequestOption) (res *WorkflowRun, err error)
Update a ready Asset to the latest revision of its selected Workflow. Existing outputs are preserved and missing outputs are created.
type AssetWorkflowUpdateResponseEnvelope ¶ added in v0.17.0
type AssetWorkflowUpdateResponseEnvelope struct {
// The requested Workflow run.
Data WorkflowRun `json:"data" api:"required"`
// Status of the API request. Always success for this response.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing one Workflow run.
func (AssetWorkflowUpdateResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r AssetWorkflowUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetWorkflowUpdateResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *AssetWorkflowUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type AwsRegion ¶ added in v1.0.0
type AwsRegion string
Region specifies the region of the storage provider.
const ( AwsRegionUsEast1 AwsRegion = "us-east-1" AwsRegionUsEast2 AwsRegion = "us-east-2" AwsRegionUsCentral1 AwsRegion = "us-central-1" AwsRegionUsWest1 AwsRegion = "us-west-1" AwsRegionUsWest2 AwsRegion = "us-west-2" AwsRegionEuWest1 AwsRegion = "eu-west-1" AwsRegionEuWest2 AwsRegion = "eu-west-2" AwsRegionEuWest3 AwsRegion = "eu-west-3" AwsRegionEuCentral1 AwsRegion = "eu-central-1" AwsRegionEuNorth1 AwsRegion = "eu-north-1" AwsRegionApEast1 AwsRegion = "ap-east-1" AwsRegionApEast2 AwsRegion = "ap-east-2" AwsRegionApNortheast1 AwsRegion = "ap-northeast-1" AwsRegionApNortheast2 AwsRegion = "ap-northeast-2" AwsRegionApSouth1 AwsRegion = "ap-south-1" AwsRegionApSoutheast1 AwsRegion = "ap-southeast-1" AwsRegionApSoutheast2 AwsRegion = "ap-southeast-2" )
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 ChunkifyRegion ¶ added in v1.0.0
type ChunkifyRegion string
Chunkify available regions.
const ( ChunkifyRegionUsEast1 ChunkifyRegion = "us-east-1" ChunkifyRegionUsEast2 ChunkifyRegion = "us-east-2" ChunkifyRegionUsWest1 ChunkifyRegion = "us-west-1" ChunkifyRegionUsWest2 ChunkifyRegion = "us-west-2" ChunkifyRegionEuWest1 ChunkifyRegion = "eu-west-1" ChunkifyRegionEuWest2 ChunkifyRegion = "eu-west-2" ChunkifyRegionApNortheast1 ChunkifyRegion = "ap-northeast-1" ChunkifyRegionApSoutheast1 ChunkifyRegion = "ap-southeast-1" )
type Client ¶
type Client struct {
Options []option.RequestOption
// Automatic video-on-demand Assets and independent H.264 MP4 static renditions.
Assets AssetService
Events EventService
Files FileService
Jobs JobService
Metrics MetricService
Notifications NotificationService
Projects ProjectService
Sources SourceService
Storages StorageService
Thumbnails ThumbnailService
Tokens TokenService
Transcodings TranscodingService
Uploads UploadService
Webhooks WebhookService
Workflows WorkflowService
}
Client creates a struct with services and top level methods that help with interacting with the chunkify API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (CHUNKIFY_TOKEN, CHUNKIFY_TEAM_TOKEN, CHUNKIFY_WEBHOOK_SECRET, CHUNKIFY_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶ added in v0.6.0
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶ added in v0.6.0
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶ added in v0.6.0
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶ added in v0.6.0
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶ added in v0.6.0
func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CreatedVia ¶ added in v1.0.0
type CreatedVia = shared.CreatedVia
CreatedVia specifies how the resource was created: api for API requests, dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for Workflow actions. Omitted when the creator is unknown.
This is an alias to an internal type.
type Event ¶ added in v0.17.0
type Event struct {
// Unique event ID.
ID string `json:"id" api:"required"`
// Time the event occurred.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Number of retained webhook delivery attempts.
DeliveryCount int64 `json:"delivery_count" api:"required"`
// Summary of the latest retained attempt for each webhook. none means no retained
// attempts; pending means at least one latest attempt is awaiting delivery; failed
// means at least one latest attempt failed and none are pending; delivered means
// all latest attempts succeeded. Earlier failures superseded by successful retries
// do not mark the event failed.
//
// Any of "none", "pending", "delivered", "failed".
DeliveryStatus EventDeliveryStatus `json:"delivery_status" api:"required"`
// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
// "source.created", "source.deleted", "upload.created", "upload.completed",
// "upload.failed", "upload.expired", "asset.created", "asset.ready",
// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
// "asset.output.created", "asset.output.ready", "asset.output.failed",
// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
Event WebhookEvent `json:"event" api:"required"`
// Retention deadline set from the project team plan when the event was recorded.
// Deliveries and retries share this deadline.
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
// ID of the resource that caused this event.
ObjectID string `json:"object_id" api:"required"`
// Immutable JSON event envelope. Its ID is the event ID; webhook delivery
// envelopes retain their notification IDs. Signed links in historical snapshots
// may have expired.
Payload string `json:"payload" api:"required"`
// Related resource IDs retained independently of resource deletion.
RelatedObjectIDs []string `json:"related_object_ids" api:"required"`
// First 100 delivery attempts, oldest first; included on retrieval. List
// notifications with event_id to paginate all attempts.
Deliveries []Notification `json:"deliveries"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
DeliveryCount respjson.Field
DeliveryStatus respjson.Field
Event respjson.Field
ExpiresAt respjson.Field
ObjectID respjson.Field
Payload respjson.Field
RelatedObjectIDs respjson.Field
Deliveries respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A retained lifecycle event, recorded independently of webhook subscriptions. The payload is an immutable JSON snapshot.
func (*Event) UnmarshalJSON ¶ added in v0.17.0
type EventDeliveryStatus ¶ added in v0.17.0
type EventDeliveryStatus string
Summary of the latest retained attempt for each webhook. none means no retained attempts; pending means at least one latest attempt is awaiting delivery; failed means at least one latest attempt failed and none are pending; delivered means all latest attempts succeeded. Earlier failures superseded by successful retries do not mark the event failed.
const ( EventDeliveryStatusNone EventDeliveryStatus = "none" EventDeliveryStatusPending EventDeliveryStatus = "pending" EventDeliveryStatusDelivered EventDeliveryStatus = "delivered" EventDeliveryStatusFailed EventDeliveryStatus = "failed" )
type EventGetResponseEnvelope ¶ added in v0.17.0
type EventGetResponseEnvelope struct {
// A retained lifecycle event, recorded independently of webhook subscriptions. The
// payload is an immutable JSON snapshot.
Data Event `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (EventGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r EventGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*EventGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *EventGetResponseEnvelope) UnmarshalJSON(data []byte) error
type EventListParams ¶ added in v0.17.0
type EventListParams struct {
// Pagination limit (max 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter by the primary or a related resource ID, including retained associations
// after resource deletion.
ObjectID param.Opt[string] `query:"object_id,omitzero" json:"-"`
// Pagination offset
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
Created EventListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by events
Events []WebhookEvent `query:"events,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EventListParams) URLQuery ¶ added in v0.17.0
func (r EventListParams) URLQuery() (v url.Values, err error)
URLQuery serializes EventListParams's query parameters as `url.Values`.
type EventListParamsCreated ¶ added in v0.17.0
type EventListParamsCreated struct {
// Filter by creation date greater than or equal (UNIX epoch time)
Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
// Filter by creation date less than or equal (UNIX epoch time)
Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
// Sort by creation date (asc/desc)
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (EventListParamsCreated) URLQuery ¶ added in v0.17.0
func (r EventListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes EventListParamsCreated's query parameters as `url.Values`.
type EventService ¶ added in v0.17.0
type EventService struct {
Options []option.RequestOption
}
EventService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEventService method instead.
func NewEventService ¶ added in v0.17.0
func NewEventService(opts ...option.RequestOption) (r EventService)
NewEventService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EventService) Get ¶ added in v0.17.0
func (r *EventService) Get(ctx context.Context, eventID string, opts ...option.RequestOption) (res *Event, err error)
Retrieve a retained event, its frozen payload, related resources, and up to 100 delivery attempts. No webhook configuration is required.
func (*EventService) List ¶ added in v0.17.0
func (r *EventService) List(ctx context.Context, query EventListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Event], err error)
List lifecycle events recorded with or without webhooks. Events and their deliveries expire according to the plan retention deadline. Historical notifications recorded before the event log remain available through Notifications.
func (*EventService) ListAutoPaging ¶ added in v0.17.0
func (r *EventService) ListAutoPaging(ctx context.Context, query EventListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Event]
List lifecycle events recorded with or without webhooks. Events and their deliveries expire according to the plan retention deadline. Historical notifications recorded before the event log remain available through Notifications.
type FileGetResponseEnvelope ¶ added in v0.6.0
type FileGetResponseEnvelope struct {
// Data contains the response object
Data JobFile `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Successful response
func (FileGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r FileGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*FileGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *FileGetResponseEnvelope) UnmarshalJSON(data []byte) error
type FileListParams ¶
type FileListParams struct {
// Filter by file ID
ID param.Opt[string] `query:"id,omitzero" json:"-"`
// Filter by audio codec
AudioCodec param.Opt[string] `query:"audio_codec,omitzero" json:"-"`
// Filter by job ID
JobID param.Opt[string] `query:"job_id,omitzero" json:"-"`
// Pagination limit (max 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter by mime type
MimeType param.Opt[string] `query:"mime_type,omitzero" json:"-"`
// Pagination offset
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter by storage ID
StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
// Filter by video codec
VideoCodec param.Opt[string] `query:"video_codec,omitzero" json:"-"`
Created FileListParamsCreated `query:"created,omitzero" json:"-"`
Duration FileListParamsDuration `query:"duration,omitzero" json:"-"`
Height FileListParamsHeight `query:"height,omitzero" json:"-"`
Path FileListParamsPath `query:"path,omitzero" json:"-"`
Size FileListParamsSize `query:"size,omitzero" json:"-"`
Width FileListParamsWidth `query:"width,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParams) URLQuery ¶ added in v0.6.0
func (r FileListParams) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParams's query parameters as `url.Values`.
type FileListParamsCreated ¶ added in v0.6.0
type FileListParamsCreated struct {
// Filter by creation date greater than or equal (UNIX epoch time)
Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
// Filter by creation date less than or equal (UNIX epoch time)
Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
// Sort by creation date (asc/desc)
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParamsCreated) URLQuery ¶ added in v0.6.0
func (r FileListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParamsCreated's query parameters as `url.Values`.
type FileListParamsDuration ¶ added in v0.6.0
type FileListParamsDuration struct {
// Filter by exact duration
Eq param.Opt[float64] `query:"eq,omitzero" json:"-"`
// Filter by duration greater than
Gt param.Opt[float64] `query:"gt,omitzero" json:"-"`
// Filter by duration greater than or equal
Gte param.Opt[float64] `query:"gte,omitzero" json:"-"`
// Filter by duration less than
Lt param.Opt[float64] `query:"lt,omitzero" json:"-"`
// Filter by duration less than or equal
Lte param.Opt[float64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParamsDuration) URLQuery ¶ added in v0.6.0
func (r FileListParamsDuration) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParamsDuration's query parameters as `url.Values`.
type FileListParamsHeight ¶ added in v0.6.0
type FileListParamsHeight struct {
// Filter by exact height
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by height greater than
Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
// Filter by height greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by height less than
Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
// Filter by height less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParamsHeight) URLQuery ¶ added in v0.6.0
func (r FileListParamsHeight) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParamsHeight's query parameters as `url.Values`.
type FileListParamsPath ¶ added in v0.6.0
type FileListParamsPath struct {
// Filter by path
Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
// Filter by path (case insensitive)
Ilike param.Opt[string] `query:"ilike,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParamsPath) URLQuery ¶ added in v0.6.0
func (r FileListParamsPath) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParamsPath's query parameters as `url.Values`.
type FileListParamsSize ¶ added in v0.6.0
type FileListParamsSize struct {
// Filter by exact file size
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by file size greater than
Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
// Filter by file size greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by file size less than
Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
// Filter by file size less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParamsSize) URLQuery ¶ added in v0.6.0
func (r FileListParamsSize) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParamsSize's query parameters as `url.Values`.
type FileListParamsWidth ¶ added in v0.6.0
type FileListParamsWidth struct {
// Filter by exact width
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by width greater than
Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
// Filter by width greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by width less than
Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
// Filter by width less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (FileListParamsWidth) URLQuery ¶ added in v0.6.0
func (r FileListParamsWidth) URLQuery() (v url.Values, err error)
URLQuery serializes FileListParamsWidth's query parameters as `url.Values`.
type FileService ¶ added in v0.6.0
type FileService struct {
Options []option.RequestOption
}
FileService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.
func NewFileService ¶ added in v0.6.0
func NewFileService(opts ...option.RequestOption) (r FileService)
NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FileService) Delete
deprecated
added in
v0.6.0
func (r *FileService) Delete(ctx context.Context, fileID string, opts ...option.RequestOption) (err error)
Delete a file. It will fail if there are processing jobs using this file. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.
Deprecated: deprecated
func (*FileService) Get
deprecated
added in
v0.6.0
func (r *FileService) Get(ctx context.Context, fileID string, opts ...option.RequestOption) (res *JobFile, err error)
Retrieve details of a specific file by its ID, including metadata, media properties, and associated jobs. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.
Deprecated: deprecated
func (*FileService) List
deprecated
added in
v0.6.0
func (r *FileService) List(ctx context.Context, query FileListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[JobFile], err error)
Retrieve a list of files with optional filtering and pagination. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.
Deprecated: deprecated
func (*FileService) ListAutoPaging
deprecated
added in
v0.6.0
func (r *FileService) ListAutoPaging(ctx context.Context, query FileListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[JobFile]
Retrieve a list of files with optional filtering and pagination. Deprecated: Files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.
Deprecated: deprecated
type HlsAv1 ¶ added in v0.6.0
type HlsAv1 struct {
ID constant.HlsAv1 `json:"id" default:"hls_av1"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 63. Recommended
// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// HlsEnc enables encryption for HLS segments when set to true.
HlsEnc bool `json:"hls_enc"`
// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncIv string `json:"hls_enc_iv"`
// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncKey string `json:"hls_enc_key"`
// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
// Required when HlsEnc is true.
HlsEncKeyURL string `json:"hls_enc_key_url"`
// HlsSegmentType specifies the type of HLS segments. Valid values:
//
// - mpegts: Traditional MPEG-TS segments, better compatibility
// - fmp4: Fragmented MP4 segments, better efficiency
//
// Any of "mpegts", "fmp4".
HlsSegmentType HlsAv1HlsSegmentType `json:"hls_segment_type"`
// HlsSingleFile specifies whether to store HLS segments in one file using byte
// ranges. Defaults to true. Set to false to create separate segment files.
HlsSingleFile bool `json:"hls_single_file"`
// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
// Shorter segments provide faster startup but more overhead, longer segments are
// more efficient.
HlsTime int64 `json:"hls_time"`
// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
// Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt HlsAv1Pixfmt `json:"pixfmt"`
// Preset controls the encoding efficiency and processing intensity. Lower presets
// use more optimization features, creating smaller files with better quality but
// requiring more compute time. Higher presets encode faster but produce larger
// files.
//
// Preset ranges:
//
// - 6-7: Fast encoding for real-time applications (smaller files)
// - 8-10: Balanced efficiency and speed for general use
// - 11-13: Fastest encoding for real-time applications (larger files)
//
// Any of "6", "7", "8", "9", "10", "11", "12", "13".
Preset HlsAv1Preset `json:"preset"`
// Profilev specifies the AV1 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev HlsAv1Profilev `json:"profilev"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
HlsEnc respjson.Field
HlsEncIv respjson.Field
HlsEncKey respjson.Field
HlsEncKeyURL respjson.Field
HlsSegmentType respjson.Field
HlsSingleFile respjson.Field
HlsTime respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (HlsAv1) 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
type HlsAv1HlsSegmentType ¶ added in v0.6.0
type HlsAv1HlsSegmentType string
HlsSegmentType specifies the type of HLS segments. Valid values:
- mpegts: Traditional MPEG-TS segments, better compatibility - fmp4: Fragmented MP4 segments, better efficiency
const ( HlsAv1HlsSegmentTypeMpegts HlsAv1HlsSegmentType = "mpegts" HlsAv1HlsSegmentTypeFmp4 HlsAv1HlsSegmentType = "fmp4" )
type HlsAv1Param ¶ added in v0.6.0
type HlsAv1Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 63. Recommended
// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// HlsEnc enables encryption for HLS segments when set to true.
HlsEnc param.Opt[bool] `json:"hls_enc,omitzero"`
// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncIv param.Opt[string] `json:"hls_enc_iv,omitzero"`
// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncKey param.Opt[string] `json:"hls_enc_key,omitzero"`
// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
// Required when HlsEnc is true.
HlsEncKeyURL param.Opt[string] `json:"hls_enc_key_url,omitzero"`
// HlsSingleFile specifies whether to store HLS segments in one file using byte
// ranges. Defaults to true. Set to false to create separate segment files.
HlsSingleFile param.Opt[bool] `json:"hls_single_file,omitzero"`
// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
// Shorter segments provide faster startup but more overhead, longer segments are
// more efficient.
HlsTime param.Opt[int64] `json:"hls_time,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
Movflags param.Opt[string] `json:"movflags,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// HlsSegmentType specifies the type of HLS segments. Valid values:
//
// - mpegts: Traditional MPEG-TS segments, better compatibility
// - fmp4: Fragmented MP4 segments, better efficiency
//
// Any of "mpegts", "fmp4".
HlsSegmentType HlsAv1HlsSegmentType `json:"hls_segment_type,omitzero"`
// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
// Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt HlsAv1Pixfmt `json:"pixfmt,omitzero"`
// Preset controls the encoding efficiency and processing intensity. Lower presets
// use more optimization features, creating smaller files with better quality but
// requiring more compute time. Higher presets encode faster but produce larger
// files.
//
// Preset ranges:
//
// - 6-7: Fast encoding for real-time applications (smaller files)
// - 8-10: Balanced efficiency and speed for general use
// - 11-13: Fastest encoding for real-time applications (larger files)
//
// Any of "6", "7", "8", "9", "10", "11", "12", "13".
Preset HlsAv1Preset `json:"preset,omitzero"`
// Profilev specifies the AV1 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev HlsAv1Profilev `json:"profilev,omitzero"`
// This field can be elided, and will marshal its zero value as "hls_av1".
ID constant.HlsAv1 `json:"id" default:"hls_av1"`
// contains filtered or unexported fields
}
The property ID is required.
func (HlsAv1Param) MarshalJSON ¶ added in v0.6.0
func (r HlsAv1Param) MarshalJSON() (data []byte, err error)
func (*HlsAv1Param) UnmarshalJSON ¶ added in v0.6.0
func (r *HlsAv1Param) UnmarshalJSON(data []byte) error
type HlsAv1Pixfmt ¶ added in v0.6.0
type HlsAv1Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( HlsAv1PixfmtYuv410p HlsAv1Pixfmt = "yuv410p" HlsAv1PixfmtYuv411p HlsAv1Pixfmt = "yuv411p" HlsAv1PixfmtYuv420p HlsAv1Pixfmt = "yuv420p" HlsAv1PixfmtYuv422p HlsAv1Pixfmt = "yuv422p" HlsAv1PixfmtYuv440p HlsAv1Pixfmt = "yuv440p" HlsAv1PixfmtYuv444p HlsAv1Pixfmt = "yuv444p" HlsAv1PixfmtYuvJ411p HlsAv1Pixfmt = "yuvJ411p" HlsAv1PixfmtYuvJ420p HlsAv1Pixfmt = "yuvJ420p" HlsAv1PixfmtYuvJ422p HlsAv1Pixfmt = "yuvJ422p" HlsAv1PixfmtYuvJ440p HlsAv1Pixfmt = "yuvJ440p" HlsAv1PixfmtYuvJ444p HlsAv1Pixfmt = "yuvJ444p" HlsAv1PixfmtYuv420p10le HlsAv1Pixfmt = "yuv420p10le" HlsAv1PixfmtYuv422p10le HlsAv1Pixfmt = "yuv422p10le" HlsAv1PixfmtYuv440p10le HlsAv1Pixfmt = "yuv440p10le" HlsAv1PixfmtYuv444p10le HlsAv1Pixfmt = "yuv444p10le" HlsAv1PixfmtYuv420p12le HlsAv1Pixfmt = "yuv420p12le" HlsAv1PixfmtYuv422p12le HlsAv1Pixfmt = "yuv422p12le" HlsAv1PixfmtYuv440p12le HlsAv1Pixfmt = "yuv440p12le" HlsAv1PixfmtYuv444p12le HlsAv1Pixfmt = "yuv444p12le" HlsAv1PixfmtYuv420p10be HlsAv1Pixfmt = "yuv420p10be" HlsAv1PixfmtYuv422p10be HlsAv1Pixfmt = "yuv422p10be" HlsAv1PixfmtYuv440p10be HlsAv1Pixfmt = "yuv440p10be" HlsAv1PixfmtYuv444p10be HlsAv1Pixfmt = "yuv444p10be" HlsAv1PixfmtYuv420p12be HlsAv1Pixfmt = "yuv420p12be" HlsAv1PixfmtYuv422p12be HlsAv1Pixfmt = "yuv422p12be" HlsAv1PixfmtYuv440p12be HlsAv1Pixfmt = "yuv440p12be" HlsAv1PixfmtYuv444p12be HlsAv1Pixfmt = "yuv444p12be" )
type HlsAv1Preset ¶ added in v0.6.0
type HlsAv1Preset string
Preset controls the encoding efficiency and processing intensity. Lower presets use more optimization features, creating smaller files with better quality but requiring more compute time. Higher presets encode faster but produce larger files.
Preset ranges:
- 6-7: Fast encoding for real-time applications (smaller files) - 8-10: Balanced efficiency and speed for general use - 11-13: Fastest encoding for real-time applications (larger files)
const ( HlsAv1Preset6 HlsAv1Preset = "6" HlsAv1Preset7 HlsAv1Preset = "7" HlsAv1Preset8 HlsAv1Preset = "8" HlsAv1Preset9 HlsAv1Preset = "9" HlsAv1Preset10 HlsAv1Preset = "10" HlsAv1Preset11 HlsAv1Preset = "11" HlsAv1Preset12 HlsAv1Preset = "12" HlsAv1Preset13 HlsAv1Preset = "13" )
type HlsAv1Profilev ¶ added in v0.6.0
type HlsAv1Profilev string
Profilev specifies the AV1 profile. Valid values:
- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images
const ( HlsAv1ProfilevMain HlsAv1Profilev = "main" HlsAv1ProfilevMain10 HlsAv1Profilev = "main10" HlsAv1ProfilevMainstillpicture HlsAv1Profilev = "mainstillpicture" )
type HlsH264 ¶ added in v0.6.0
type HlsH264 struct {
ID constant.HlsH264 `json:"id" default:"hls_h264"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// HlsEnc enables encryption for HLS segments when set to true.
HlsEnc bool `json:"hls_enc"`
// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncIv string `json:"hls_enc_iv"`
// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncKey string `json:"hls_enc_key"`
// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
// Required when HlsEnc is true.
HlsEncKeyURL string `json:"hls_enc_key_url"`
// HlsSegmentType specifies the type of HLS segments. Valid values:
//
// - mpegts: Traditional MPEG-TS segments, better compatibility
// - fmp4: Fragmented MP4 segments, better efficiency
//
// Any of "mpegts", "fmp4".
HlsSegmentType HlsH264HlsSegmentType `json:"hls_segment_type"`
// HlsSingleFile specifies whether to store HLS segments in one file using byte
// ranges. Defaults to true. Set to false to create separate segment files.
HlsSingleFile bool `json:"hls_single_file"`
// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
// Shorter segments provide faster startup but more overhead, longer segments are
// more efficient.
HlsTime int64 `json:"hls_time"`
// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
// resolutions and bitrates but require more processing power.
//
// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
Level int64 `json:"level"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt HlsH264Pixfmt `json:"pixfmt"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset HlsH264Preset `json:"preset"`
// Profilev specifies the H.264 profile. Valid values:
//
// - baseline: Basic profile, good for mobile devices
// - main: Main profile, good for most applications
// - high: High profile, best quality but requires more processing
// - high10: High 10-bit profile, supports 10-bit color
// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
//
// Any of "baseline", "main", "high", "high10", "high422", "high444".
Profilev HlsH264Profilev `json:"profilev"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// X264KeyInt specifies the maximum number of frames between keyframes for H.264
// encoding. Range: 1 to 960. Higher values can improve compression but may affect
// seeking.
X264Keyint int64 `json:"x264_keyint"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
HlsEnc respjson.Field
HlsEncIv respjson.Field
HlsEncKey respjson.Field
HlsEncKeyURL respjson.Field
HlsSegmentType respjson.Field
HlsSingleFile respjson.Field
HlsTime respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
X264Keyint respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (HlsH264) 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
type HlsH264HlsSegmentType ¶ added in v0.6.0
type HlsH264HlsSegmentType string
HlsSegmentType specifies the type of HLS segments. Valid values:
- mpegts: Traditional MPEG-TS segments, better compatibility - fmp4: Fragmented MP4 segments, better efficiency
const ( HlsH264HlsSegmentTypeMpegts HlsH264HlsSegmentType = "mpegts" HlsH264HlsSegmentTypeFmp4 HlsH264HlsSegmentType = "fmp4" )
type HlsH264Param ¶ added in v0.6.0
type HlsH264Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// HlsEnc enables encryption for HLS segments when set to true.
HlsEnc param.Opt[bool] `json:"hls_enc,omitzero"`
// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncIv param.Opt[string] `json:"hls_enc_iv,omitzero"`
// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncKey param.Opt[string] `json:"hls_enc_key,omitzero"`
// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
// Required when HlsEnc is true.
HlsEncKeyURL param.Opt[string] `json:"hls_enc_key_url,omitzero"`
// HlsSingleFile specifies whether to store HLS segments in one file using byte
// ranges. Defaults to true. Set to false to create separate segment files.
HlsSingleFile param.Opt[bool] `json:"hls_single_file,omitzero"`
// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
// Shorter segments provide faster startup but more overhead, longer segments are
// more efficient.
HlsTime param.Opt[int64] `json:"hls_time,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
Movflags param.Opt[string] `json:"movflags,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// X264KeyInt specifies the maximum number of frames between keyframes for H.264
// encoding. Range: 1 to 960. Higher values can improve compression but may affect
// seeking.
X264Keyint param.Opt[int64] `json:"x264_keyint,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// HlsSegmentType specifies the type of HLS segments. Valid values:
//
// - mpegts: Traditional MPEG-TS segments, better compatibility
// - fmp4: Fragmented MP4 segments, better efficiency
//
// Any of "mpegts", "fmp4".
HlsSegmentType HlsH264HlsSegmentType `json:"hls_segment_type,omitzero"`
// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
// resolutions and bitrates but require more processing power.
//
// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
Level int64 `json:"level,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt HlsH264Pixfmt `json:"pixfmt,omitzero"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset HlsH264Preset `json:"preset,omitzero"`
// Profilev specifies the H.264 profile. Valid values:
//
// - baseline: Basic profile, good for mobile devices
// - main: Main profile, good for most applications
// - high: High profile, best quality but requires more processing
// - high10: High 10-bit profile, supports 10-bit color
// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
//
// Any of "baseline", "main", "high", "high10", "high422", "high444".
Profilev HlsH264Profilev `json:"profilev,omitzero"`
// This field can be elided, and will marshal its zero value as "hls_h264".
ID constant.HlsH264 `json:"id" default:"hls_h264"`
// contains filtered or unexported fields
}
The property ID is required.
func (HlsH264Param) MarshalJSON ¶ added in v0.6.0
func (r HlsH264Param) MarshalJSON() (data []byte, err error)
func (*HlsH264Param) UnmarshalJSON ¶ added in v0.6.0
func (r *HlsH264Param) UnmarshalJSON(data []byte) error
type HlsH264Pixfmt ¶ added in v0.6.0
type HlsH264Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( HlsH264PixfmtYuv410p HlsH264Pixfmt = "yuv410p" HlsH264PixfmtYuv411p HlsH264Pixfmt = "yuv411p" HlsH264PixfmtYuv420p HlsH264Pixfmt = "yuv420p" HlsH264PixfmtYuv422p HlsH264Pixfmt = "yuv422p" HlsH264PixfmtYuv440p HlsH264Pixfmt = "yuv440p" HlsH264PixfmtYuv444p HlsH264Pixfmt = "yuv444p" HlsH264PixfmtYuvJ411p HlsH264Pixfmt = "yuvJ411p" HlsH264PixfmtYuvJ420p HlsH264Pixfmt = "yuvJ420p" HlsH264PixfmtYuvJ422p HlsH264Pixfmt = "yuvJ422p" HlsH264PixfmtYuvJ440p HlsH264Pixfmt = "yuvJ440p" HlsH264PixfmtYuvJ444p HlsH264Pixfmt = "yuvJ444p" HlsH264PixfmtYuv420p10le HlsH264Pixfmt = "yuv420p10le" HlsH264PixfmtYuv422p10le HlsH264Pixfmt = "yuv422p10le" HlsH264PixfmtYuv440p10le HlsH264Pixfmt = "yuv440p10le" HlsH264PixfmtYuv444p10le HlsH264Pixfmt = "yuv444p10le" HlsH264PixfmtYuv420p12le HlsH264Pixfmt = "yuv420p12le" HlsH264PixfmtYuv422p12le HlsH264Pixfmt = "yuv422p12le" HlsH264PixfmtYuv440p12le HlsH264Pixfmt = "yuv440p12le" HlsH264PixfmtYuv444p12le HlsH264Pixfmt = "yuv444p12le" HlsH264PixfmtYuv420p10be HlsH264Pixfmt = "yuv420p10be" HlsH264PixfmtYuv422p10be HlsH264Pixfmt = "yuv422p10be" HlsH264PixfmtYuv440p10be HlsH264Pixfmt = "yuv440p10be" HlsH264PixfmtYuv444p10be HlsH264Pixfmt = "yuv444p10be" HlsH264PixfmtYuv420p12be HlsH264Pixfmt = "yuv420p12be" HlsH264PixfmtYuv422p12be HlsH264Pixfmt = "yuv422p12be" HlsH264PixfmtYuv440p12be HlsH264Pixfmt = "yuv440p12be" HlsH264PixfmtYuv444p12be HlsH264Pixfmt = "yuv444p12be" )
type HlsH264Preset ¶ added in v0.6.0
type HlsH264Preset string
Preset specifies the encoding speed preset. Valid values (from fastest to slowest):
- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality
const ( HlsH264PresetUltrafast HlsH264Preset = "ultrafast" HlsH264PresetSuperfast HlsH264Preset = "superfast" HlsH264PresetVeryfast HlsH264Preset = "veryfast" HlsH264PresetFaster HlsH264Preset = "faster" HlsH264PresetFast HlsH264Preset = "fast" HlsH264PresetMedium HlsH264Preset = "medium" )
type HlsH264Profilev ¶ added in v0.6.0
type HlsH264Profilev string
Profilev specifies the H.264 profile. Valid values:
- baseline: Basic profile, good for mobile devices - main: Main profile, good for most applications - high: High profile, best quality but requires more processing - high10: High 10-bit profile, supports 10-bit color - high422: High 4:2:2 profile, supports 4:2:2 color sampling - high444: High 4:4:4 profile, supports 4:4:4 color sampling
const ( HlsH264ProfilevBaseline HlsH264Profilev = "baseline" HlsH264ProfilevMain HlsH264Profilev = "main" HlsH264ProfilevHigh HlsH264Profilev = "high" HlsH264ProfilevHigh10 HlsH264Profilev = "high10" HlsH264ProfilevHigh422 HlsH264Profilev = "high422" HlsH264ProfilevHigh444 HlsH264Profilev = "high444" )
type HlsH265 ¶ added in v0.6.0
type HlsH265 struct {
ID constant.HlsH265 `json:"id" default:"hls_h265"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// HlsEnc enables encryption for HLS segments when set to true.
HlsEnc bool `json:"hls_enc"`
// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncIv string `json:"hls_enc_iv"`
// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncKey string `json:"hls_enc_key"`
// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
// Required when HlsEnc is true.
HlsEncKeyURL string `json:"hls_enc_key_url"`
// HlsSegmentType specifies the type of HLS segments. Valid values:
//
// - mpegts: Traditional MPEG-TS segments, better compatibility
// - fmp4: Fragmented MP4 segments, better efficiency
//
// Any of "mpegts", "fmp4".
HlsSegmentType HlsH265HlsSegmentType `json:"hls_segment_type"`
// HlsSingleFile specifies whether to store HLS segments in one file using byte
// ranges. Defaults to true. Set to false to create separate segment files.
HlsSingleFile bool `json:"hls_single_file"`
// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
// Shorter segments provide faster startup but more overhead, longer segments are
// more efficient.
HlsTime int64 `json:"hls_time"`
// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
// (main10). Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt HlsH265Pixfmt `json:"pixfmt"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset HlsH265Preset `json:"preset"`
// Profilev specifies the H.265 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev HlsH265Profilev `json:"profilev"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// X265KeyInt specifies the maximum number of frames between keyframes for H.265
// encoding. Range: 1 to 300. Higher values can improve compression but may affect
// seeking.
X265Keyint int64 `json:"x265_keyint"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
HlsEnc respjson.Field
HlsEncIv respjson.Field
HlsEncKey respjson.Field
HlsEncKeyURL respjson.Field
HlsSegmentType respjson.Field
HlsSingleFile respjson.Field
HlsTime respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
X265Keyint respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (HlsH265) 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
type HlsH265HlsSegmentType ¶ added in v0.6.0
type HlsH265HlsSegmentType string
HlsSegmentType specifies the type of HLS segments. Valid values:
- mpegts: Traditional MPEG-TS segments, better compatibility - fmp4: Fragmented MP4 segments, better efficiency
const ( HlsH265HlsSegmentTypeMpegts HlsH265HlsSegmentType = "mpegts" HlsH265HlsSegmentTypeFmp4 HlsH265HlsSegmentType = "fmp4" )
type HlsH265Param ¶ added in v0.6.0
type HlsH265Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// HlsEnc enables encryption for HLS segments when set to true.
HlsEnc param.Opt[bool] `json:"hls_enc,omitzero"`
// HlsEncIv specifies the initialization vector for encryption. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncIv param.Opt[string] `json:"hls_enc_iv,omitzero"`
// HlsEncKey specifies the encryption key for HLS segments. Maximum length: 64
// characters. Required when HlsEnc is true.
HlsEncKey param.Opt[string] `json:"hls_enc_key,omitzero"`
// HlsEncKeyUrl specifies the URL where clients can fetch the encryption key.
// Required when HlsEnc is true.
HlsEncKeyURL param.Opt[string] `json:"hls_enc_key_url,omitzero"`
// HlsSingleFile specifies whether to store HLS segments in one file using byte
// ranges. Defaults to true. Set to false to create separate segment files.
HlsSingleFile param.Opt[bool] `json:"hls_single_file,omitzero"`
// HlsTime specifies the duration of each HLS segment in seconds. Range: 1 to 10.
// Shorter segments provide faster startup but more overhead, longer segments are
// more efficient.
HlsTime param.Opt[int64] `json:"hls_time,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
Movflags param.Opt[string] `json:"movflags,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// X265KeyInt specifies the maximum number of frames between keyframes for H.265
// encoding. Range: 1 to 300. Higher values can improve compression but may affect
// seeking.
X265Keyint param.Opt[int64] `json:"x265_keyint,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// HlsSegmentType specifies the type of HLS segments. Valid values:
//
// - mpegts: Traditional MPEG-TS segments, better compatibility
// - fmp4: Fragmented MP4 segments, better efficiency
//
// Any of "mpegts", "fmp4".
HlsSegmentType HlsH265HlsSegmentType `json:"hls_segment_type,omitzero"`
// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
// (main10). Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt HlsH265Pixfmt `json:"pixfmt,omitzero"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset HlsH265Preset `json:"preset,omitzero"`
// Profilev specifies the H.265 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev HlsH265Profilev `json:"profilev,omitzero"`
// This field can be elided, and will marshal its zero value as "hls_h265".
ID constant.HlsH265 `json:"id" default:"hls_h265"`
// contains filtered or unexported fields
}
The property ID is required.
func (HlsH265Param) MarshalJSON ¶ added in v0.6.0
func (r HlsH265Param) MarshalJSON() (data []byte, err error)
func (*HlsH265Param) UnmarshalJSON ¶ added in v0.6.0
func (r *HlsH265Param) UnmarshalJSON(data []byte) error
type HlsH265Pixfmt ¶ added in v0.6.0
type HlsH265Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( HlsH265PixfmtYuv410p HlsH265Pixfmt = "yuv410p" HlsH265PixfmtYuv411p HlsH265Pixfmt = "yuv411p" HlsH265PixfmtYuv420p HlsH265Pixfmt = "yuv420p" HlsH265PixfmtYuv422p HlsH265Pixfmt = "yuv422p" HlsH265PixfmtYuv440p HlsH265Pixfmt = "yuv440p" HlsH265PixfmtYuv444p HlsH265Pixfmt = "yuv444p" HlsH265PixfmtYuvJ411p HlsH265Pixfmt = "yuvJ411p" HlsH265PixfmtYuvJ420p HlsH265Pixfmt = "yuvJ420p" HlsH265PixfmtYuvJ422p HlsH265Pixfmt = "yuvJ422p" HlsH265PixfmtYuvJ440p HlsH265Pixfmt = "yuvJ440p" HlsH265PixfmtYuvJ444p HlsH265Pixfmt = "yuvJ444p" HlsH265PixfmtYuv420p10le HlsH265Pixfmt = "yuv420p10le" HlsH265PixfmtYuv422p10le HlsH265Pixfmt = "yuv422p10le" HlsH265PixfmtYuv440p10le HlsH265Pixfmt = "yuv440p10le" HlsH265PixfmtYuv444p10le HlsH265Pixfmt = "yuv444p10le" HlsH265PixfmtYuv420p12le HlsH265Pixfmt = "yuv420p12le" HlsH265PixfmtYuv422p12le HlsH265Pixfmt = "yuv422p12le" HlsH265PixfmtYuv440p12le HlsH265Pixfmt = "yuv440p12le" HlsH265PixfmtYuv444p12le HlsH265Pixfmt = "yuv444p12le" HlsH265PixfmtYuv420p10be HlsH265Pixfmt = "yuv420p10be" HlsH265PixfmtYuv422p10be HlsH265Pixfmt = "yuv422p10be" HlsH265PixfmtYuv440p10be HlsH265Pixfmt = "yuv440p10be" HlsH265PixfmtYuv444p10be HlsH265Pixfmt = "yuv444p10be" HlsH265PixfmtYuv420p12be HlsH265Pixfmt = "yuv420p12be" HlsH265PixfmtYuv422p12be HlsH265Pixfmt = "yuv422p12be" HlsH265PixfmtYuv440p12be HlsH265Pixfmt = "yuv440p12be" HlsH265PixfmtYuv444p12be HlsH265Pixfmt = "yuv444p12be" )
type HlsH265Preset ¶ added in v0.6.0
type HlsH265Preset string
Preset specifies the encoding speed preset. Valid values (from fastest to slowest):
- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality
const ( HlsH265PresetUltrafast HlsH265Preset = "ultrafast" HlsH265PresetSuperfast HlsH265Preset = "superfast" HlsH265PresetVeryfast HlsH265Preset = "veryfast" HlsH265PresetFaster HlsH265Preset = "faster" HlsH265PresetFast HlsH265Preset = "fast" HlsH265PresetMedium HlsH265Preset = "medium" )
type HlsH265Profilev ¶ added in v0.6.0
type HlsH265Profilev string
Profilev specifies the H.265 profile. Valid values:
- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images
const ( HlsH265ProfilevMain HlsH265Profilev = "main" HlsH265ProfilevMain10 HlsH265Profilev = "main10" HlsH265ProfilevMainstillpicture HlsH265Profilev = "mainstillpicture" )
type InstanceType ¶ added in v1.0.0
type InstanceType = shared.InstanceType
This is an alias to an internal type.
type Job ¶
type Job struct {
// Unique identifier for the job
ID string `json:"id" api:"required"`
// Billable time in seconds
BillableTime int64 `json:"billable_time" api:"required"`
// Creation timestamp
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// The format parameters and settings for a job
Format JobFormatUnion `json:"format" api:"required"`
// Progress percentage of the job (0-100)
Progress float64 `json:"progress" api:"required"`
// ID of the source media being processed
SourceID string `json:"source_id" api:"required"`
// Current status of the job.
//
// Any of "pending", "queued", "ingesting", "transcoding", "downloading",
// "merging", "uploading", "failed", "completed", "cancelled", "merged",
// "downloaded", "transcoded", "waiting".
Status JobStatus `json:"status" api:"required"`
// Storage settings for where the job output will be saved
Storage JobStorage `json:"storage" api:"required"`
// Last update timestamp
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Error message for the job
Error shared.ChunkifyError `json:"error"`
// HLS manifest ID
HlsManifestID string `json:"hls_manifest_id"`
// Additional metadata for the job
Metadata map[string]string `json:"metadata"`
// When the job started processing
StartedAt time.Time `json:"started_at" format:"date-time"`
// The transcoder configuration for a job
Transcoder JobTranscoder `json:"transcoder"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BillableTime respjson.Field
CreatedAt respjson.Field
Format respjson.Field
Progress respjson.Field
SourceID respjson.Field
Status respjson.Field
Storage respjson.Field
UpdatedAt respjson.Field
Error respjson.Field
HlsManifestID respjson.Field
Metadata respjson.Field
StartedAt respjson.Field
Transcoder respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Job) UnmarshalJSON ¶ added in v0.6.0
type JobCreateFormatParamsUnion ¶ added in v1.0.0
type JobCreateFormatParamsUnion 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 JobCreateFormatParamsOfJpg ¶ added in v1.0.0
func JobCreateFormatParamsOfJpg(interval int64) JobCreateFormatParamsUnion
func (JobCreateFormatParamsUnion) GetAudioBitrate ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetAudioBitrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetBufsize ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetBufsize() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetCPUUsed ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetCPUUsed() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetChannels ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetChannels() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetChunkDuration ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetChunkDuration() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetCrf ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetCrf() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetDisableAudio ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetDisableAudio() *bool
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetDisableVideo ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetDisableVideo() *bool
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetDuration ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetDuration() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetFramerate ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetFramerate() *float64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetFrames ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetFrames() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetGop ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetGop() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHeight ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHeight() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsEnc ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsEnc() *bool
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsEncIv ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsEncIv() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsEncKey ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsEncKey() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsEncKeyURL ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsEncKeyURL() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsSegmentType ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsSegmentType() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsSingleFile ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsSingleFile() *bool
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetHlsTime ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetHlsTime() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetID ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetInterval ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetInterval() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetLevel ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetLevel() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetMaxrate ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetMaxrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetMinrate ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetMinrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetMovflags ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetMovflags() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetPerTitle ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetPerTitle() *bool
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetPixfmt ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetPixfmt() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetPreset ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetPreset() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetProfilev ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetProfilev() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetQuality ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetQuality() *string
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetSeek ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetSeek() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetSprite ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetSprite() *bool
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetVideoBitrate ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetVideoBitrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetWidth ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetWidth() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetX264Keyint ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetX264Keyint() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) GetX265Keyint ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) GetX265Keyint() *int64
Returns a pointer to the underlying variant's property, if present.
func (JobCreateFormatParamsUnion) MarshalJSON ¶ added in v1.0.0
func (u JobCreateFormatParamsUnion) MarshalJSON() ([]byte, error)
func (*JobCreateFormatParamsUnion) UnmarshalJSON ¶ added in v1.0.0
func (u *JobCreateFormatParamsUnion) UnmarshalJSON(data []byte) error
type JobCreateStorageParams ¶
type JobCreateStorageParams struct {
// Storage Id specifies the storage configuration to use from pre-configured
// storage options. Must be 4-64 characters long and contain only alphanumeric
// characters, underscores and hyphens. Optional if Storage Path is provided.
ID param.Opt[string] `json:"id,omitzero"`
// Storage Path specifies an object path relative to the selected storage
// connection's base_prefix. Do not include the base_prefix. Leading slashes are
// accepted for compatibility and removed before the path is stored. The
// base_prefix and normalized path may contain at most 1024 bytes combined.
// Optional if Storage Id is provided.
Path param.Opt[string] `json:"path,omitzero"`
// contains filtered or unexported fields
}
func (JobCreateStorageParams) MarshalJSON ¶ added in v1.0.0
func (r JobCreateStorageParams) MarshalJSON() (data []byte, err error)
func (*JobCreateStorageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *JobCreateStorageParams) UnmarshalJSON(data []byte) error
type JobCreateTranscoderParams ¶
type JobCreateTranscoderParams 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 shared.InstanceType `json:"type,omitzero"`
// contains filtered or unexported fields
}
func (JobCreateTranscoderParams) MarshalJSON ¶ added in v1.0.0
func (r JobCreateTranscoderParams) MarshalJSON() (data []byte, err error)
func (*JobCreateTranscoderParams) UnmarshalJSON ¶ added in v1.0.0
func (r *JobCreateTranscoderParams) UnmarshalJSON(data []byte) error
type JobFile ¶ added in v0.9.3
type JobFile struct {
// Unique identifier of the file
ID string `json:"id" api:"required"`
// Audio bitrate in bits per second
AudioBitrate int64 `json:"audio_bitrate" api:"required"`
// Audio codec used
AudioCodec string `json:"audio_codec" api:"required"`
// Timestamp when the file was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Duration of the video in seconds
Duration int64 `json:"duration" api:"required"`
// Height of the video in pixels
Height int64 `json:"height" api:"required"`
// ID of the job that created this file
JobID string `json:"job_id" api:"required"`
// MIME type of the file
MimeType string `json:"mime_type" api:"required"`
// Path to the file in storage
Path string `json:"path" api:"required"`
// Size of the object at this File's path in bytes
Size int64 `json:"size" api:"required"`
// StorageId identifier where the file is stored
StorageID string `json:"storage_id" api:"required"`
// Pre-signed URL to directly access the file (only included when available)
URL string `json:"url" api:"required"`
// Video bitrate in bits per second
VideoBitrate int64 `json:"video_bitrate" api:"required"`
// Video codec used
VideoCodec string `json:"video_codec" api:"required"`
// Video framerate in frames per second
VideoFramerate float64 `json:"video_framerate" api:"required"`
// Width of the video in pixels
Width int64 `json:"width" api:"required"`
// Stable, unsigned CDN delivery URL derived from the file's current storage
// configuration. Omitted when no CDN base URL is configured.
CdnURL string `json:"cdn_url" api:"nullable" format:"uri"`
// PackageSize specifies the media playlist and every media object it references in
// bytes. Present only for HLS video media playlists; it excludes the shared master
// playlist.
PackageSize int64 `json:"package_size"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
AudioCodec respjson.Field
CreatedAt respjson.Field
Duration respjson.Field
Height respjson.Field
JobID respjson.Field
MimeType respjson.Field
Path respjson.Field
Size respjson.Field
StorageID respjson.Field
URL respjson.Field
VideoBitrate respjson.Field
VideoCodec respjson.Field
VideoFramerate respjson.Field
Width respjson.Field
CdnURL respjson.Field
PackageSize respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*JobFile) UnmarshalJSON ¶ added in v0.9.3
type JobFileListResponse ¶ added in v0.6.0
type JobFileListResponse struct {
Data []JobFile `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of files for a job
func (JobFileListResponse) RawJSON ¶ added in v0.6.0
func (r JobFileListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFileListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFileListResponse) UnmarshalJSON(data []byte) error
type JobFileService ¶ added in v0.6.0
type JobFileService struct {
Options []option.RequestOption
}
JobFileService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobFileService method instead.
func NewJobFileService ¶ added in v0.6.0
func NewJobFileService(opts ...option.RequestOption) (r JobFileService)
NewJobFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*JobFileService) List
deprecated
added in
v0.6.0
func (r *JobFileService) List(ctx context.Context, jobID string, opts ...option.RequestOption) (res *JobFileListResponse, err error)
Retrieve all files associated with a specific job. Deprecated: Job files are a legacy resource. Transcodings and Thumbnails include their output files, and List Asset outputs returns an Asset's outputs.
Deprecated: deprecated
type JobFormatHlsAv1 ¶ added in v0.6.0
type JobFormatHlsAv1 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
HlsAv1
}
FFmpeg encoding parameters specific to HLS with AV1 encoding. When per-title optimization is disabled, either audio_bitrate or video_bitrate is required.
func (JobFormatHlsAv1) RawJSON ¶ added in v0.6.0
func (r JobFormatHlsAv1) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatHlsAv1) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatHlsAv1) UnmarshalJSON(data []byte) error
type JobFormatHlsH264 ¶ added in v0.6.0
type JobFormatHlsH264 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
HlsH264
}
FFmpeg encoding parameters specific to HLS with H.264 encoding. When per-title optimization is disabled, either audio_bitrate or video_bitrate is required.
func (JobFormatHlsH264) RawJSON ¶ added in v0.6.0
func (r JobFormatHlsH264) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatHlsH264) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatHlsH264) UnmarshalJSON(data []byte) error
type JobFormatHlsH265 ¶ added in v0.6.0
type JobFormatHlsH265 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
HlsH265
}
FFmpeg encoding parameters specific to HLS with H.265 encoding. When per-title optimization is disabled, either audio_bitrate or video_bitrate is required.
func (JobFormatHlsH265) RawJSON ¶ added in v0.6.0
func (r JobFormatHlsH265) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatHlsH265) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatHlsH265) UnmarshalJSON(data []byte) error
type JobFormatID ¶ added in v1.0.0
type JobFormatID string
const ( JobFormatIDMP4H264 JobFormatID = "mp4_h264" JobFormatIDMP4H265 JobFormatID = "mp4_h265" JobFormatIDMP4Av1 JobFormatID = "mp4_av1" JobFormatIDWebmVp9 JobFormatID = "webm_vp9" JobFormatIDHlsH264 JobFormatID = "hls_h264" JobFormatIDHlsH265 JobFormatID = "hls_h265" JobFormatIDHlsAv1 JobFormatID = "hls_av1" JobFormatIDJpg JobFormatID = "jpg" )
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 JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
Jpg
}
FFmpeg encoding parameters specific to JPEG image extraction.
func (JobFormatJpg) RawJSON ¶ added in v0.6.0
func (r JobFormatJpg) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatJpg) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatJpg) UnmarshalJSON(data []byte) error
type JobFormatMP4Av1 ¶ added in v0.6.0
type JobFormatMP4Av1 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
MP4Av1
}
FFmpeg encoding parameters specific to MP4 with AV1 encoding.
func (JobFormatMP4Av1) RawJSON ¶ added in v0.6.0
func (r JobFormatMP4Av1) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatMP4Av1) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatMP4Av1) UnmarshalJSON(data []byte) error
type JobFormatMP4H264 ¶ added in v0.6.0
type JobFormatMP4H264 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
MP4H264
}
FFmpeg encoding parameters specific to MP4 with H.264 encoding.
func (JobFormatMP4H264) RawJSON ¶ added in v0.6.0
func (r JobFormatMP4H264) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatMP4H264) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatMP4H264) UnmarshalJSON(data []byte) error
type JobFormatMP4H265 ¶ added in v0.6.0
type JobFormatMP4H265 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
MP4H265
}
FFmpeg encoding parameters specific to MP4 with H.265 encoding.
func (JobFormatMP4H265) RawJSON ¶ added in v0.6.0
func (r JobFormatMP4H265) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatMP4H265) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatMP4H265) UnmarshalJSON(data []byte) error
type JobFormatUnion ¶ added in v0.6.0
type JobFormatUnion struct {
// Any of "mp4_av1", "mp4_h264", "mp4_h265", "webm_vp9", "hls_av1", "hls_h264",
// "hls_h265", "jpg".
ID string `json:"id"`
AudioBitrate int64 `json:"audio_bitrate"`
Bufsize int64 `json:"bufsize"`
Channels int64 `json:"channels"`
Crf int64 `json:"crf"`
DisableAudio bool `json:"disable_audio"`
DisableVideo bool `json:"disable_video"`
Duration int64 `json:"duration"`
Framerate float64 `json:"framerate"`
Gop int64 `json:"gop"`
Height int64 `json:"height"`
Level int64 `json:"level"`
Maxrate int64 `json:"maxrate"`
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
PerTitle bool `json:"per_title"`
Pixfmt string `json:"pixfmt"`
Preset string `json:"preset"`
Profilev string `json:"profilev"`
Seek int64 `json:"seek"`
VideoBitrate int64 `json:"video_bitrate"`
Width int64 `json:"width"`
X264Keyint int64 `json:"x264_keyint"`
X265Keyint int64 `json:"x265_keyint"`
// This field is from variant [JobFormatWebmVp9].
CPUUsed WebmVp9CPUUsed `json:"cpu_used"`
// This field is from variant [JobFormatWebmVp9].
Quality WebmVp9Quality `json:"quality"`
HlsEnc bool `json:"hls_enc"`
HlsEncIv string `json:"hls_enc_iv"`
HlsEncKey string `json:"hls_enc_key"`
HlsEncKeyURL string `json:"hls_enc_key_url"`
HlsSegmentType string `json:"hls_segment_type"`
HlsSingleFile bool `json:"hls_single_file"`
HlsTime int64 `json:"hls_time"`
// This field is from variant [JobFormatJpg].
Interval int64 `json:"interval"`
// This field is from variant [JobFormatJpg].
ChunkDuration int64 `json:"chunk_duration"`
// This field is from variant [JobFormatJpg].
Frames int64 `json:"frames"`
// This field is from variant [JobFormatJpg].
Sprite bool `json:"sprite"`
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
X264Keyint respjson.Field
X265Keyint respjson.Field
CPUUsed respjson.Field
Quality respjson.Field
HlsEnc respjson.Field
HlsEncIv respjson.Field
HlsEncKey respjson.Field
HlsEncKeyURL respjson.Field
HlsSegmentType respjson.Field
HlsSingleFile respjson.Field
HlsTime respjson.Field
Interval respjson.Field
ChunkDuration respjson.Field
Frames respjson.Field
Sprite respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
JobFormatUnion contains all possible properties and values from JobFormatMP4Av1, JobFormatMP4H264, JobFormatMP4H265, JobFormatWebmVp9, JobFormatHlsAv1, JobFormatHlsH264, JobFormatHlsH265, JobFormatJpg.
Use the JobFormatUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (JobFormatUnion) AsAny ¶ added in v0.6.0
func (u JobFormatUnion) AsAny() anyJobFormat
Use the following switch statement to find the correct variant
switch variant := JobFormatUnion.AsAny().(type) {
case chunkify.JobFormatMP4Av1:
case chunkify.JobFormatMP4H264:
case chunkify.JobFormatMP4H265:
case chunkify.JobFormatWebmVp9:
case chunkify.JobFormatHlsAv1:
case chunkify.JobFormatHlsH264:
case chunkify.JobFormatHlsH265:
case chunkify.JobFormatJpg:
default:
fmt.Errorf("no variant present")
}
func (JobFormatUnion) AsHlsAv1 ¶ added in v0.6.0
func (u JobFormatUnion) AsHlsAv1() (v JobFormatHlsAv1)
func (JobFormatUnion) AsHlsH264 ¶ added in v0.6.0
func (u JobFormatUnion) AsHlsH264() (v JobFormatHlsH264)
func (JobFormatUnion) AsHlsH265 ¶ added in v0.6.0
func (u JobFormatUnion) AsHlsH265() (v JobFormatHlsH265)
func (JobFormatUnion) AsJpg ¶ added in v0.6.0
func (u JobFormatUnion) AsJpg() (v JobFormatJpg)
func (JobFormatUnion) AsMP4Av1 ¶ added in v0.6.0
func (u JobFormatUnion) AsMP4Av1() (v JobFormatMP4Av1)
func (JobFormatUnion) AsMP4H264 ¶ added in v0.6.0
func (u JobFormatUnion) AsMP4H264() (v JobFormatMP4H264)
func (JobFormatUnion) AsMP4H265 ¶ added in v0.6.0
func (u JobFormatUnion) AsMP4H265() (v JobFormatMP4H265)
func (JobFormatUnion) AsWebmVp9 ¶ added in v0.6.0
func (u JobFormatUnion) AsWebmVp9() (v JobFormatWebmVp9)
func (JobFormatUnion) RawJSON ¶ added in v0.6.0
func (u JobFormatUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatUnion) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatUnion) UnmarshalJSON(data []byte) error
type JobFormatWebmVp9 ¶ added in v0.6.0
type JobFormatWebmVp9 struct {
// The format ID
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
ID JobFormatID `json:"id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
WebmVp9
}
FFmpeg encoding parameters specific to WebM with VP9 encoding.
func (JobFormatWebmVp9) RawJSON ¶ added in v0.6.0
func (r JobFormatWebmVp9) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobFormatWebmVp9) UnmarshalJSON ¶ added in v0.6.0
func (r *JobFormatWebmVp9) UnmarshalJSON(data []byte) error
type JobGetResponseEnvelope ¶ added in v0.6.0
type JobGetResponseEnvelope struct {
// Data contains the response object
Data Job `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (JobGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r JobGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *JobGetResponseEnvelope) UnmarshalJSON(data []byte) error
type JobListParams ¶
type JobListParams struct {
// Filter by job ID
ID param.Opt[string] `query:"id,omitzero" json:"-"`
// Filter by hls manifest ID
HlsManifestID param.Opt[string] `query:"hls_manifest_id,omitzero" json:"-"`
// Pagination limit
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Pagination offset
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter by source ID
SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
Created JobListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by format id
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "hls_h264", "hls_h265",
// "hls_av1", "jpg".
FormatID JobFormatID `query:"format_id,omitzero" json:"-"`
// Filter by metadata
Metadata [][]string `query:"metadata,omitzero" json:"-"`
// Filter by job status
//
// Any of "completed", "processing", "failed", "cancelled", "queued", "pending".
Status JobListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (JobListParams) URLQuery ¶ added in v0.6.0
func (r JobListParams) URLQuery() (v url.Values, err error)
URLQuery serializes JobListParams's query parameters as `url.Values`.
type JobListParamsCreated ¶ added in v0.6.0
type JobListParamsCreated struct {
// Filter by creation date greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
// Filter by creation date less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
// Sort by creation date (asc/desc)
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (JobListParamsCreated) URLQuery ¶ added in v0.6.0
func (r JobListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes JobListParamsCreated's query parameters as `url.Values`.
type JobListParamsStatus ¶ added in v0.6.0
type JobListParamsStatus string
Filter by job status
const ( JobListParamsStatusCompleted JobListParamsStatus = "completed" JobListParamsStatusProcessing JobListParamsStatus = "processing" JobListParamsStatusFailed JobListParamsStatus = "failed" JobListParamsStatusCancelled JobListParamsStatus = "cancelled" JobListParamsStatusQueued JobListParamsStatus = "queued" JobListParamsStatusPending JobListParamsStatus = "pending" )
type JobLogListParams ¶ added in v0.6.0
type JobLogListParams struct {
// Service type (transcoder or manager)
//
// Any of "transcoder", "manager".
Service JobLogListParamsService `query:"service,omitzero" api:"required" json:"-"`
// Transcoder ID (required if service is transcoder)
TranscoderID param.Opt[int64] `query:"transcoder_id,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (JobLogListParams) URLQuery ¶ added in v0.6.0
func (r JobLogListParams) URLQuery() (v url.Values, err error)
URLQuery serializes JobLogListParams's query parameters as `url.Values`.
type JobLogListParamsService ¶ added in v0.6.0
type JobLogListParamsService string
Service type (transcoder or manager)
const ( JobLogListParamsServiceTranscoder JobLogListParamsService = "transcoder" JobLogListParamsServiceManager JobLogListParamsService = "manager" )
type JobLogListResponse ¶ added in v0.6.0
type JobLogListResponse struct {
Data []shared.Log `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of logs for a job
func (JobLogListResponse) RawJSON ¶ added in v0.6.0
func (r JobLogListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobLogListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *JobLogListResponse) UnmarshalJSON(data []byte) error
type JobLogService ¶ added in v0.6.0
type JobLogService struct {
Options []option.RequestOption
}
JobLogService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobLogService method instead.
func NewJobLogService ¶ added in v0.6.0
func NewJobLogService(opts ...option.RequestOption) (r JobLogService)
NewJobLogService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*JobLogService) List
deprecated
added in
v0.6.0
func (r *JobLogService) List(ctx context.Context, jobID string, query JobLogListParams, opts ...option.RequestOption) (res *JobLogListResponse, err error)
Retrieve logs for a specific job, either from the transcoder or manager service. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
type JobNewParams ¶ added in v0.6.0
type JobNewParams struct {
// Required format configuration, one and only one valid format configuration must
// be provided. If you want to use a format without specifying any configuration,
// use an empty object in the corresponding field.
Format JobCreateFormatParamsUnion `json:"format,omitzero" api:"required"`
// The ID of the source file to transcode
SourceID string `json:"source_id" api:"required"`
// Optional HLS manifest configuration Use the same hls manifest ID to group
// multiple jobs into a single HLS manifest By default, it's automatically
// generated if no set for HLS jobs
HlsManifestID param.Opt[string] `json:"hls_manifest_id,omitzero"`
// Optional metadata to attach to the job, the maximum size allowed is 2048 bytes
Metadata map[string]string `json:"metadata,omitzero"`
// Optional storage configuration
Storage JobCreateStorageParams `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 JobCreateTranscoderParams `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 JobNewResponseEnvelope ¶ added in v0.6.0
type JobNewResponseEnvelope struct {
// Data contains the response object
Data Job `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (JobNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r JobNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *JobNewResponseEnvelope) UnmarshalJSON(data []byte) error
type JobService ¶ added in v0.6.0
type JobService struct {
Options []option.RequestOption
Files JobFileService
Logs JobLogService
Transcoders JobTranscoderService
}
JobService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobService method instead.
func NewJobService ¶ added in v0.6.0
func NewJobService(opts ...option.RequestOption) (r JobService)
NewJobService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*JobService) Cancel
deprecated
added in
v0.6.0
func (r *JobService) Cancel(ctx context.Context, jobID string, opts ...option.RequestOption) (err error)
Cancel a job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
func (*JobService) Delete
deprecated
added in
v0.6.0
func (r *JobService) Delete(ctx context.Context, jobID string, opts ...option.RequestOption) (err error)
Delete a job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
func (*JobService) Get
deprecated
added in
v0.6.0
func (r *JobService) Get(ctx context.Context, jobID string, opts ...option.RequestOption) (res *Job, err error)
Retrieve details of a specific job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
func (*JobService) List
deprecated
added in
v0.6.0
func (r *JobService) List(ctx context.Context, query JobListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Job], err error)
Retrieve a list of jobs with optional filtering and pagination. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
func (*JobService) ListAutoPaging
deprecated
added in
v0.6.0
func (r *JobService) ListAutoPaging(ctx context.Context, query JobListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Job]
Retrieve a list of jobs with optional filtering and pagination. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
func (*JobService) New
deprecated
added in
v0.6.0
func (r *JobService) New(ctx context.Context, body JobNewParams, opts ...option.RequestOption) (res *Job, err error)
Create a new video processing job with specified parameters. The job is created with pending status and waits for scheduler admission before processing. Pending jobs are admitted oldest first across all projects in the team as vCPU capacity becomes available. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
type JobStatus ¶ added in v0.6.0
type JobStatus string
Current status of the job.
const ( JobStatusPending JobStatus = "pending" JobStatusQueued JobStatus = "queued" JobStatusIngesting JobStatus = "ingesting" JobStatusTranscoding JobStatus = "transcoding" JobStatusDownloading JobStatus = "downloading" JobStatusMerging JobStatus = "merging" JobStatusUploading JobStatus = "uploading" JobStatusFailed JobStatus = "failed" JobStatusCompleted JobStatus = "completed" JobStatusCancelled JobStatus = "cancelled" JobStatusMerged JobStatus = "merged" JobStatusDownloaded JobStatus = "downloaded" JobStatusTranscoded JobStatus = "transcoded" JobStatusWaiting JobStatus = "waiting" )
type JobStorage ¶
type JobStorage struct {
// ID of the storage
ID string `json:"id" api:"required"`
// Path where the output will be stored
Path string `json:"path" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Path respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Storage settings for where the job output will be saved
func (JobStorage) RawJSON ¶ added in v0.6.0
func (r JobStorage) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobStorage) UnmarshalJSON ¶ added in v0.6.0
func (r *JobStorage) UnmarshalJSON(data []byte) error
type JobTranscoder ¶ added in v0.6.0
type JobTranscoder struct {
// Whether the transcoder configuration is automatically set by Chunkify
Auto bool `json:"auto" api:"required"`
// Number of instances allocated
Quantity int64 `json:"quantity" api:"required"`
// Type of transcoder instance
//
// Any of "4vCPU", "8vCPU", "16vCPU".
Type shared.InstanceType `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Auto respjson.Field
Quantity respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The transcoder configuration for a job
func (JobTranscoder) RawJSON ¶ added in v0.6.0
func (r JobTranscoder) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobTranscoder) UnmarshalJSON ¶ added in v0.6.0
func (r *JobTranscoder) UnmarshalJSON(data []byte) error
type JobTranscoderListResponse ¶ added in v0.6.0
type JobTranscoderListResponse struct {
Data []shared.TranscoderStatus `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing a list of transcoders for a job
func (JobTranscoderListResponse) RawJSON ¶ added in v0.6.0
func (r JobTranscoderListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*JobTranscoderListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *JobTranscoderListResponse) UnmarshalJSON(data []byte) error
type JobTranscoderService ¶ added in v0.6.0
type JobTranscoderService struct {
Options []option.RequestOption
}
JobTranscoderService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewJobTranscoderService method instead.
func NewJobTranscoderService ¶ added in v0.6.0
func NewJobTranscoderService(opts ...option.RequestOption) (r JobTranscoderService)
NewJobTranscoderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*JobTranscoderService) List
deprecated
added in
v0.6.0
func (r *JobTranscoderService) List(ctx context.Context, jobID string, opts ...option.RequestOption) (res *JobTranscoderListResponse, err error)
Retrieve all the transcoders statuses for a specific job. Deprecated: Jobs are a legacy resource. Use Assets, Transcodings or Thumbnails instead.
Deprecated: deprecated
type Jpg ¶ added in v0.6.0
type Jpg struct {
ID constant.Jpg `json:"id" default:"jpg"`
// Time interval in seconds at which frames are extracted from the video (e.g.,
// interval=10 extracts frames at 0s, 10s, 20s, etc.). Must be between 1 and 3600
// seconds.
Interval int64 `json:"interval" api:"required"`
ChunkDuration int64 `json:"chunk_duration"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
Frames int64 `json:"frames"`
Height int64 `json:"height"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
Sprite bool `json:"sprite"`
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Interval respjson.Field
ChunkDuration respjson.Field
Duration respjson.Field
Frames respjson.Field
Height respjson.Field
Seek respjson.Field
Sprite respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FFmpeg encoding parameters specific to JPEG image extraction.
func (Jpg) ToParam ¶ added in v0.6.0
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
type JpgParam ¶ added in v0.6.0
type JpgParam struct {
// Time interval in seconds at which frames are extracted from the video (e.g.,
// interval=10 extracts frames at 0s, 10s, 20s, etc.). Must be between 1 and 3600
// seconds.
Interval int64 `json:"interval" api:"required"`
ChunkDuration param.Opt[int64] `json:"chunk_duration,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
Frames param.Opt[int64] `json:"frames,omitzero"`
Height param.Opt[int64] `json:"height,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
Sprite param.Opt[bool] `json:"sprite,omitzero"`
Width param.Opt[int64] `json:"width,omitzero"`
// This field can be elided, and will marshal its zero value as "jpg".
ID constant.Jpg `json:"id" default:"jpg"`
// contains filtered or unexported fields
}
FFmpeg encoding parameters specific to JPEG image extraction.
The properties ID, Interval are required.
func (JpgParam) MarshalJSON ¶ added in v0.6.0
func (*JpgParam) UnmarshalJSON ¶ added in v0.6.0
type LogService ¶ added in v1.0.0
type LogService = shared.LogService
Name of the service that generated the log
This is an alias to an internal type.
type MP4Av1 ¶ added in v0.6.0
type MP4Av1 struct {
ID constant.MP4Av1 `json:"id" default:"mp4_av1"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 63. Recommended
// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
// Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt MP4Av1Pixfmt `json:"pixfmt"`
// Preset controls the encoding efficiency and processing intensity. Lower presets
// use more optimization features, creating smaller files with better quality but
// requiring more compute time. Higher presets encode faster but produce larger
// files.
//
// Preset ranges:
//
// - 6-7: Fast encoding for real-time applications (smaller files)
// - 8-10: Balanced efficiency and speed for general use
// - 11-13: Fastest encoding for real-time applications (larger files)
//
// Any of "6", "7", "8", "9", "10", "11", "12", "13".
Preset MP4Av1Preset `json:"preset"`
// Profilev specifies the AV1 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev MP4Av1Profilev `json:"profilev"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MP4Av1) 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
type MP4Av1Param ¶ added in v0.6.0
type MP4Av1Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 63. Recommended
// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
Movflags param.Opt[string] `json:"movflags,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// Level specifies the AV1 profile level. Valid values: 30-31 (main), 41 (main10).
// Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt MP4Av1Pixfmt `json:"pixfmt,omitzero"`
// Preset controls the encoding efficiency and processing intensity. Lower presets
// use more optimization features, creating smaller files with better quality but
// requiring more compute time. Higher presets encode faster but produce larger
// files.
//
// Preset ranges:
//
// - 6-7: Fast encoding for real-time applications (smaller files)
// - 8-10: Balanced efficiency and speed for general use
// - 11-13: Fastest encoding for real-time applications (larger files)
//
// Any of "6", "7", "8", "9", "10", "11", "12", "13".
Preset MP4Av1Preset `json:"preset,omitzero"`
// Profilev specifies the AV1 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev MP4Av1Profilev `json:"profilev,omitzero"`
// This field can be elided, and will marshal its zero value as "mp4_av1".
ID constant.MP4Av1 `json:"id" default:"mp4_av1"`
// contains filtered or unexported fields
}
The property ID is required.
func (MP4Av1Param) MarshalJSON ¶ added in v0.6.0
func (r MP4Av1Param) MarshalJSON() (data []byte, err error)
func (*MP4Av1Param) UnmarshalJSON ¶ added in v0.6.0
func (r *MP4Av1Param) UnmarshalJSON(data []byte) error
type MP4Av1Pixfmt ¶ added in v0.6.0
type MP4Av1Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( MP4Av1PixfmtYuv410p MP4Av1Pixfmt = "yuv410p" MP4Av1PixfmtYuv411p MP4Av1Pixfmt = "yuv411p" MP4Av1PixfmtYuv420p MP4Av1Pixfmt = "yuv420p" MP4Av1PixfmtYuv422p MP4Av1Pixfmt = "yuv422p" MP4Av1PixfmtYuv440p MP4Av1Pixfmt = "yuv440p" MP4Av1PixfmtYuv444p MP4Av1Pixfmt = "yuv444p" MP4Av1PixfmtYuvJ411p MP4Av1Pixfmt = "yuvJ411p" MP4Av1PixfmtYuvJ420p MP4Av1Pixfmt = "yuvJ420p" MP4Av1PixfmtYuvJ422p MP4Av1Pixfmt = "yuvJ422p" MP4Av1PixfmtYuvJ440p MP4Av1Pixfmt = "yuvJ440p" MP4Av1PixfmtYuvJ444p MP4Av1Pixfmt = "yuvJ444p" MP4Av1PixfmtYuv420p10le MP4Av1Pixfmt = "yuv420p10le" MP4Av1PixfmtYuv422p10le MP4Av1Pixfmt = "yuv422p10le" MP4Av1PixfmtYuv440p10le MP4Av1Pixfmt = "yuv440p10le" MP4Av1PixfmtYuv444p10le MP4Av1Pixfmt = "yuv444p10le" MP4Av1PixfmtYuv420p12le MP4Av1Pixfmt = "yuv420p12le" MP4Av1PixfmtYuv422p12le MP4Av1Pixfmt = "yuv422p12le" MP4Av1PixfmtYuv440p12le MP4Av1Pixfmt = "yuv440p12le" MP4Av1PixfmtYuv444p12le MP4Av1Pixfmt = "yuv444p12le" MP4Av1PixfmtYuv420p10be MP4Av1Pixfmt = "yuv420p10be" MP4Av1PixfmtYuv422p10be MP4Av1Pixfmt = "yuv422p10be" MP4Av1PixfmtYuv440p10be MP4Av1Pixfmt = "yuv440p10be" MP4Av1PixfmtYuv444p10be MP4Av1Pixfmt = "yuv444p10be" MP4Av1PixfmtYuv420p12be MP4Av1Pixfmt = "yuv420p12be" MP4Av1PixfmtYuv422p12be MP4Av1Pixfmt = "yuv422p12be" MP4Av1PixfmtYuv440p12be MP4Av1Pixfmt = "yuv440p12be" MP4Av1PixfmtYuv444p12be MP4Av1Pixfmt = "yuv444p12be" )
type MP4Av1Preset ¶ added in v0.6.0
type MP4Av1Preset string
Preset controls the encoding efficiency and processing intensity. Lower presets use more optimization features, creating smaller files with better quality but requiring more compute time. Higher presets encode faster but produce larger files.
Preset ranges:
- 6-7: Fast encoding for real-time applications (smaller files) - 8-10: Balanced efficiency and speed for general use - 11-13: Fastest encoding for real-time applications (larger files)
const ( MP4Av1Preset6 MP4Av1Preset = "6" MP4Av1Preset7 MP4Av1Preset = "7" MP4Av1Preset8 MP4Av1Preset = "8" MP4Av1Preset9 MP4Av1Preset = "9" MP4Av1Preset10 MP4Av1Preset = "10" MP4Av1Preset11 MP4Av1Preset = "11" MP4Av1Preset12 MP4Av1Preset = "12" MP4Av1Preset13 MP4Av1Preset = "13" )
type MP4Av1Profilev ¶ added in v0.6.0
type MP4Av1Profilev string
Profilev specifies the AV1 profile. Valid values:
- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images
const ( MP4Av1ProfilevMain MP4Av1Profilev = "main" MP4Av1ProfilevMain10 MP4Av1Profilev = "main10" MP4Av1ProfilevMainstillpicture MP4Av1Profilev = "mainstillpicture" )
type MP4H264 ¶ added in v0.6.0
type MP4H264 struct {
ID constant.MP4H264 `json:"id" default:"mp4_h264"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
// resolutions and bitrates but require more processing power.
//
// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
Level int64 `json:"level"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt MP4H264Pixfmt `json:"pixfmt"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset MP4H264Preset `json:"preset"`
// Profilev specifies the H.264 profile. Valid values:
//
// - baseline: Basic profile, good for mobile devices
// - main: Main profile, good for most applications
// - high: High profile, best quality but requires more processing
// - high10: High 10-bit profile, supports 10-bit color
// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
//
// Any of "baseline", "main", "high", "high10", "high422", "high444".
Profilev MP4H264Profilev `json:"profilev"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// X264KeyInt specifies the maximum number of frames between keyframes for H.264
// encoding. Range: 1 to 960. Higher values can improve compression but may affect
// seeking.
X264Keyint int64 `json:"x264_keyint"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
X264Keyint respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MP4H264) 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
type MP4H264Param ¶ added in v0.6.0
type MP4H264Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
Movflags param.Opt[string] `json:"movflags,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// X264KeyInt specifies the maximum number of frames between keyframes for H.264
// encoding. Range: 1 to 960. Higher values can improve compression but may affect
// seeking.
X264Keyint param.Opt[int64] `json:"x264_keyint,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// Level specifies the H.264 profile level. Valid values: 10-13 (baseline), 20-22
// (main), 30-32 (high), 40-42 (high), 50-51 (high). Higher levels support higher
// resolutions and bitrates but require more processing power.
//
// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
Level int64 `json:"level,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt MP4H264Pixfmt `json:"pixfmt,omitzero"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset MP4H264Preset `json:"preset,omitzero"`
// Profilev specifies the H.264 profile. Valid values:
//
// - baseline: Basic profile, good for mobile devices
// - main: Main profile, good for most applications
// - high: High profile, best quality but requires more processing
// - high10: High 10-bit profile, supports 10-bit color
// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
//
// Any of "baseline", "main", "high", "high10", "high422", "high444".
Profilev MP4H264Profilev `json:"profilev,omitzero"`
// This field can be elided, and will marshal its zero value as "mp4_h264".
ID constant.MP4H264 `json:"id" default:"mp4_h264"`
// contains filtered or unexported fields
}
The property ID is required.
func (MP4H264Param) MarshalJSON ¶ added in v0.6.0
func (r MP4H264Param) MarshalJSON() (data []byte, err error)
func (*MP4H264Param) UnmarshalJSON ¶ added in v0.6.0
func (r *MP4H264Param) UnmarshalJSON(data []byte) error
type MP4H264Pixfmt ¶ added in v0.6.0
type MP4H264Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( MP4H264PixfmtYuv410p MP4H264Pixfmt = "yuv410p" MP4H264PixfmtYuv411p MP4H264Pixfmt = "yuv411p" MP4H264PixfmtYuv420p MP4H264Pixfmt = "yuv420p" MP4H264PixfmtYuv422p MP4H264Pixfmt = "yuv422p" MP4H264PixfmtYuv440p MP4H264Pixfmt = "yuv440p" MP4H264PixfmtYuv444p MP4H264Pixfmt = "yuv444p" MP4H264PixfmtYuvJ411p MP4H264Pixfmt = "yuvJ411p" MP4H264PixfmtYuvJ420p MP4H264Pixfmt = "yuvJ420p" MP4H264PixfmtYuvJ422p MP4H264Pixfmt = "yuvJ422p" MP4H264PixfmtYuvJ440p MP4H264Pixfmt = "yuvJ440p" MP4H264PixfmtYuvJ444p MP4H264Pixfmt = "yuvJ444p" MP4H264PixfmtYuv420p10le MP4H264Pixfmt = "yuv420p10le" MP4H264PixfmtYuv422p10le MP4H264Pixfmt = "yuv422p10le" MP4H264PixfmtYuv440p10le MP4H264Pixfmt = "yuv440p10le" MP4H264PixfmtYuv444p10le MP4H264Pixfmt = "yuv444p10le" MP4H264PixfmtYuv420p12le MP4H264Pixfmt = "yuv420p12le" MP4H264PixfmtYuv422p12le MP4H264Pixfmt = "yuv422p12le" MP4H264PixfmtYuv440p12le MP4H264Pixfmt = "yuv440p12le" MP4H264PixfmtYuv444p12le MP4H264Pixfmt = "yuv444p12le" MP4H264PixfmtYuv420p10be MP4H264Pixfmt = "yuv420p10be" MP4H264PixfmtYuv422p10be MP4H264Pixfmt = "yuv422p10be" MP4H264PixfmtYuv440p10be MP4H264Pixfmt = "yuv440p10be" MP4H264PixfmtYuv444p10be MP4H264Pixfmt = "yuv444p10be" MP4H264PixfmtYuv420p12be MP4H264Pixfmt = "yuv420p12be" MP4H264PixfmtYuv422p12be MP4H264Pixfmt = "yuv422p12be" MP4H264PixfmtYuv440p12be MP4H264Pixfmt = "yuv440p12be" MP4H264PixfmtYuv444p12be MP4H264Pixfmt = "yuv444p12be" )
type MP4H264Preset ¶ added in v0.6.0
type MP4H264Preset string
Preset specifies the encoding speed preset. Valid values (from fastest to slowest):
- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality
const ( MP4H264PresetUltrafast MP4H264Preset = "ultrafast" MP4H264PresetSuperfast MP4H264Preset = "superfast" MP4H264PresetVeryfast MP4H264Preset = "veryfast" MP4H264PresetFaster MP4H264Preset = "faster" MP4H264PresetFast MP4H264Preset = "fast" MP4H264PresetMedium MP4H264Preset = "medium" )
type MP4H264Profilev ¶ added in v0.6.0
type MP4H264Profilev string
Profilev specifies the H.264 profile. Valid values:
- baseline: Basic profile, good for mobile devices - main: Main profile, good for most applications - high: High profile, best quality but requires more processing - high10: High 10-bit profile, supports 10-bit color - high422: High 4:2:2 profile, supports 4:2:2 color sampling - high444: High 4:4:4 profile, supports 4:4:4 color sampling
const ( MP4H264ProfilevBaseline MP4H264Profilev = "baseline" MP4H264ProfilevMain MP4H264Profilev = "main" MP4H264ProfilevHigh MP4H264Profilev = "high" MP4H264ProfilevHigh10 MP4H264Profilev = "high10" MP4H264ProfilevHigh422 MP4H264Profilev = "high422" MP4H264ProfilevHigh444 MP4H264Profilev = "high444" )
type MP4H265 ¶ added in v0.6.0
type MP4H265 struct {
ID constant.MP4H265 `json:"id" default:"mp4_h265"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
// (main10). Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
Movflags string `json:"movflags"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt MP4H265Pixfmt `json:"pixfmt"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset MP4H265Preset `json:"preset"`
// Profilev specifies the H.265 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev MP4H265Profilev `json:"profilev"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// X265KeyInt specifies the maximum number of frames between keyframes for H.265
// encoding. Range: 1 to 300. Higher values can improve compression but may affect
// seeking.
X265Keyint int64 `json:"x265_keyint"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
X265Keyint respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (MP4H265) 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
type MP4H265Param ¶ added in v0.6.0
type MP4H265Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
Movflags param.Opt[string] `json:"movflags,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// X265KeyInt specifies the maximum number of frames between keyframes for H.265
// encoding. Range: 1 to 300. Higher values can improve compression but may affect
// seeking.
X265Keyint param.Opt[int64] `json:"x265_keyint,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// Level specifies the H.265 profile level. Valid values: 30-31 (main), 41
// (main10). Higher levels support higher resolutions and bitrates but require more
// processing power.
//
// Any of 30, 31, 41.
Level int64 `json:"level,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt MP4H265Pixfmt `json:"pixfmt,omitzero"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset MP4H265Preset `json:"preset,omitzero"`
// Profilev specifies the H.265 profile. Valid values:
//
// - main: Main profile, good for most applications
// - main10: Main 10-bit profile, supports 10-bit color
// - mainstillpicture: Still picture profile, optimized for single images
//
// Any of "main", "main10", "mainstillpicture".
Profilev MP4H265Profilev `json:"profilev,omitzero"`
// This field can be elided, and will marshal its zero value as "mp4_h265".
ID constant.MP4H265 `json:"id" default:"mp4_h265"`
// contains filtered or unexported fields
}
The property ID is required.
func (MP4H265Param) MarshalJSON ¶ added in v0.6.0
func (r MP4H265Param) MarshalJSON() (data []byte, err error)
func (*MP4H265Param) UnmarshalJSON ¶ added in v0.6.0
func (r *MP4H265Param) UnmarshalJSON(data []byte) error
type MP4H265Pixfmt ¶ added in v0.6.0
type MP4H265Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( MP4H265PixfmtYuv410p MP4H265Pixfmt = "yuv410p" MP4H265PixfmtYuv411p MP4H265Pixfmt = "yuv411p" MP4H265PixfmtYuv420p MP4H265Pixfmt = "yuv420p" MP4H265PixfmtYuv422p MP4H265Pixfmt = "yuv422p" MP4H265PixfmtYuv440p MP4H265Pixfmt = "yuv440p" MP4H265PixfmtYuv444p MP4H265Pixfmt = "yuv444p" MP4H265PixfmtYuvJ411p MP4H265Pixfmt = "yuvJ411p" MP4H265PixfmtYuvJ420p MP4H265Pixfmt = "yuvJ420p" MP4H265PixfmtYuvJ422p MP4H265Pixfmt = "yuvJ422p" MP4H265PixfmtYuvJ440p MP4H265Pixfmt = "yuvJ440p" MP4H265PixfmtYuvJ444p MP4H265Pixfmt = "yuvJ444p" MP4H265PixfmtYuv420p10le MP4H265Pixfmt = "yuv420p10le" MP4H265PixfmtYuv422p10le MP4H265Pixfmt = "yuv422p10le" MP4H265PixfmtYuv440p10le MP4H265Pixfmt = "yuv440p10le" MP4H265PixfmtYuv444p10le MP4H265Pixfmt = "yuv444p10le" MP4H265PixfmtYuv420p12le MP4H265Pixfmt = "yuv420p12le" MP4H265PixfmtYuv422p12le MP4H265Pixfmt = "yuv422p12le" MP4H265PixfmtYuv440p12le MP4H265Pixfmt = "yuv440p12le" MP4H265PixfmtYuv444p12le MP4H265Pixfmt = "yuv444p12le" MP4H265PixfmtYuv420p10be MP4H265Pixfmt = "yuv420p10be" MP4H265PixfmtYuv422p10be MP4H265Pixfmt = "yuv422p10be" MP4H265PixfmtYuv440p10be MP4H265Pixfmt = "yuv440p10be" MP4H265PixfmtYuv444p10be MP4H265Pixfmt = "yuv444p10be" MP4H265PixfmtYuv420p12be MP4H265Pixfmt = "yuv420p12be" MP4H265PixfmtYuv422p12be MP4H265Pixfmt = "yuv422p12be" MP4H265PixfmtYuv440p12be MP4H265Pixfmt = "yuv440p12be" MP4H265PixfmtYuv444p12be MP4H265Pixfmt = "yuv444p12be" )
type MP4H265Preset ¶ added in v0.6.0
type MP4H265Preset string
Preset specifies the encoding speed preset. Valid values (from fastest to slowest):
- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality
const ( MP4H265PresetUltrafast MP4H265Preset = "ultrafast" MP4H265PresetSuperfast MP4H265Preset = "superfast" MP4H265PresetVeryfast MP4H265Preset = "veryfast" MP4H265PresetFaster MP4H265Preset = "faster" MP4H265PresetFast MP4H265Preset = "fast" MP4H265PresetMedium MP4H265Preset = "medium" )
type MP4H265Profilev ¶ added in v0.6.0
type MP4H265Profilev string
Profilev specifies the H.265 profile. Valid values:
- main: Main profile, good for most applications - main10: Main 10-bit profile, supports 10-bit color - mainstillpicture: Still picture profile, optimized for single images
const ( MP4H265ProfilevMain MP4H265Profilev = "main" MP4H265ProfilevMain10 MP4H265Profilev = "main10" MP4H265ProfilevMainstillpicture MP4H265Profilev = "mainstillpicture" )
type MetricAssetsParams ¶ added in v0.17.0
type MetricAssetsParams struct {
// Inclusive UTC start date, YYYY-MM-DD. Supply both dates for a custom range of at
// most 366 days. Omit both for the past 7 UTC calendar days including today.
From param.Opt[string] `query:"from,omitzero" json:"-"`
// Exclusive UTC end date, YYYY-MM-DD. Must be after from and at most 366 days
// later.
To param.Opt[string] `query:"to,omitzero" json:"-"`
// Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept
// when supplied; errors remain JSON.
//
// Any of "json", "csv".
Format MetricAssetsParamsFormat `query:"format,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MetricAssetsParams) URLQuery ¶ added in v0.17.0
func (r MetricAssetsParams) URLQuery() (v url.Values, err error)
URLQuery serializes MetricAssetsParams's query parameters as `url.Values`.
type MetricAssetsParamsFormat ¶ added in v0.17.0
type MetricAssetsParamsFormat string
Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept when supplied; errors remain JSON.
const ( MetricAssetsParamsFormatJson MetricAssetsParamsFormat = "json" MetricAssetsParamsFormatCsv MetricAssetsParamsFormat = "csv" )
type MetricAssetsResponseEnvelope ¶ added in v0.17.0
type MetricAssetsResponseEnvelope struct {
// Data contains the requested report.
Data MetricsAssets `json:"data" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Successful metrics response.
func (MetricAssetsResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r MetricAssetsResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricAssetsResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *MetricAssetsResponseEnvelope) UnmarshalJSON(data []byte) error
type MetricService ¶ added in v0.17.0
type MetricService struct {
Options []option.RequestOption
}
MetricService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMetricService method instead.
func NewMetricService ¶ added in v0.17.0
func NewMetricService(opts ...option.RequestOption) (r MetricService)
NewMetricService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MetricService) Assets ¶ added in v0.17.0
func (r *MetricService) Assets(ctx context.Context, query MetricAssetsParams, opts ...option.RequestOption) (res *MetricsAssets, err error)
Retrieve Asset outcomes, timings, output sizes and source profiles by UTC creation date.
func (*MetricService) Storage ¶ added in v0.17.0
func (r *MetricService) Storage(ctx context.Context, query MetricStorageParams, opts ...option.RequestOption) (res *MetricsStorage, err error)
Retrieve recorded additions and successful removals by storage and UTC date. Historical coverage depends on event retention.
func (*MetricService) Usage ¶ added in v0.17.0
func (r *MetricService) Usage(ctx context.Context, query MetricUsageParams, opts ...option.RequestOption) (res *MetricsUsage, err error)
Retrieve project usage totals and daily values for a UTC date range.
type MetricStorageParams ¶ added in v0.17.0
type MetricStorageParams struct {
// Inclusive UTC start date, YYYY-MM-DD. Supply both dates for a custom range of at
// most 366 days. Omit both for the past 7 UTC calendar days including today.
From param.Opt[string] `query:"from,omitzero" json:"-"`
// Filter to one persistent storage configuration in the authenticated project.
StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
// Exclusive UTC end date, YYYY-MM-DD. Must be after from and at most 366 days
// later.
To param.Opt[string] `query:"to,omitzero" json:"-"`
// Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept
// when supplied; errors remain JSON.
//
// Any of "json", "csv".
Format MetricStorageParamsFormat `query:"format,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MetricStorageParams) URLQuery ¶ added in v0.17.0
func (r MetricStorageParams) URLQuery() (v url.Values, err error)
URLQuery serializes MetricStorageParams's query parameters as `url.Values`.
type MetricStorageParamsFormat ¶ added in v0.17.0
type MetricStorageParamsFormat string
Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept when supplied; errors remain JSON.
const ( MetricStorageParamsFormatJson MetricStorageParamsFormat = "json" MetricStorageParamsFormatCsv MetricStorageParamsFormat = "csv" )
type MetricStorageResponseEnvelope ¶ added in v0.17.0
type MetricStorageResponseEnvelope struct {
// Data contains the requested report.
Data MetricsStorage `json:"data" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Successful metrics response.
func (MetricStorageResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r MetricStorageResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricStorageResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *MetricStorageResponseEnvelope) UnmarshalJSON(data []byte) error
type MetricUsageParams ¶ added in v0.17.0
type MetricUsageParams struct {
// Inclusive UTC start date, YYYY-MM-DD. Supply both dates for a custom range of at
// most 366 days. Omit both for the past 7 UTC calendar days including today.
From param.Opt[string] `query:"from,omitzero" json:"-"`
// Exclusive UTC end date, YYYY-MM-DD. Must be after from and at most 366 days
// later.
To param.Opt[string] `query:"to,omitzero" json:"-"`
// Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept
// when supplied; errors remain JSON.
//
// Any of "json", "csv".
Format MetricUsageParamsFormat `query:"format,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MetricUsageParams) URLQuery ¶ added in v0.17.0
func (r MetricUsageParams) URLQuery() (v url.Values, err error)
URLQuery serializes MetricUsageParams's query parameters as `url.Values`.
type MetricUsageParamsFormat ¶ added in v0.17.0
type MetricUsageParamsFormat string
Response format. Defaults to JSON unless Accept requests CSV. Overrides Accept when supplied; errors remain JSON.
const ( MetricUsageParamsFormatJson MetricUsageParamsFormat = "json" MetricUsageParamsFormatCsv MetricUsageParamsFormat = "csv" )
type MetricUsageResponseEnvelope ¶ added in v0.17.0
type MetricUsageResponseEnvelope struct {
// Data contains the requested report.
Data MetricsUsage `json:"data" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Successful metrics response.
func (MetricUsageResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r MetricUsageResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricUsageResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *MetricUsageResponseEnvelope) UnmarshalJSON(data []byte) error
type MetricsAssetCounts ¶ added in v1.0.0
type MetricsAssetCounts struct {
// Completed specifies Assets with a recorded ready timestamp.
Completed int64 `json:"completed" api:"required"`
// Failed specifies retained Assets currently in failed status.
Failed int64 `json:"failed" api:"required"`
// ProcessedSeconds specifies measured media duration of completed Assets,
// preserving fractional seconds.
ProcessedSeconds float64 `json:"processed_seconds" api:"required"`
// Saved specifies retained Assets created in the period.
Saved int64 `json:"saved" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Completed respjson.Field
Failed respjson.Field
ProcessedSeconds respjson.Field
Saved respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Asset outcomes grouped by Asset creation date.
func (MetricsAssetCounts) RawJSON ¶ added in v1.0.0
func (r MetricsAssetCounts) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetCounts) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetCounts) UnmarshalJSON(data []byte) error
type MetricsAssetDay ¶ added in v1.0.0
type MetricsAssetDay struct {
// Date specifies the UTC Asset creation day.
Date string `json:"date" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Date respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
MetricsAssetValues
}
Asset measurements grouped by creation day.
func (MetricsAssetDay) RawJSON ¶ added in v1.0.0
func (r MetricsAssetDay) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetDay) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetDay) UnmarshalJSON(data []byte) error
type MetricsAssetOutputs ¶ added in v1.0.0
type MetricsAssetOutputs struct {
// MeasuredAssetCount specifies completed Assets with at least one measured
// rendition.
MeasuredAssetCount int64 `json:"measured_asset_count" api:"required"`
// StaticBytes specifies the sum of measured ready static rendition sizes. Null
// when no measurements exist.
StaticBytes int64 `json:"static_bytes" api:"required"`
// StaticSampleCount specifies ready static renditions with measured sizes.
StaticSampleCount int64 `json:"static_sample_count" api:"required"`
// StreamingBytes specifies the sum of measured streaming rendition sizes. Null
// when no measurements exist.
StreamingBytes int64 `json:"streaming_bytes" api:"required"`
// StreamingSampleCount specifies streaming renditions with measured sizes.
StreamingSampleCount int64 `json:"streaming_sample_count" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
MeasuredAssetCount respjson.Field
StaticBytes respjson.Field
StaticSampleCount respjson.Field
StreamingBytes respjson.Field
StreamingSampleCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Measured output sizes for completed Assets. Sample counts describe measurement coverage.
func (MetricsAssetOutputs) RawJSON ¶ added in v1.0.0
func (r MetricsAssetOutputs) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetOutputs) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetOutputs) UnmarshalJSON(data []byte) error
type MetricsAssetSources ¶ added in v1.0.0
type MetricsAssetSources struct {
// AssetsByCodec specifies Asset counts by normalized source video codec, including
// unknown. All recorded codecs are returned.
AssetsByCodec map[string]int64 `json:"assets_by_codec" api:"required"`
// AssetsByDuration specifies Asset counts by source duration. Keys are under_1m,
// 1_to_5m, 5_to_10m, 10_to_30m, 30_to_60m, over_60m and unknown. Boundaries are
// 60, 300, 600, 1800 and 3600 seconds; exactly 3600 belongs to 30_to_60m.
AssetsByDuration map[string]int64 `json:"assets_by_duration" api:"required"`
// AssetsByResolution specifies Asset counts by source resolution. Keys are
// up_to_576, 577_to_720, 721_to_1080, 1081_to_2159, 2160_plus and unknown, using
// the shorter pixel edge.
AssetsByResolution map[string]int64 `json:"assets_by_resolution" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AssetsByCodec respjson.Field
AssetsByDuration respjson.Field
AssetsByResolution respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Source profiles count Assets, not unique Sources.
func (MetricsAssetSources) RawJSON ¶ added in v1.0.0
func (r MetricsAssetSources) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetSources) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetSources) UnmarshalJSON(data []byte) error
type MetricsAssetStreaming ¶ added in v1.0.0
type MetricsAssetStreaming struct {
// AssetCount specifies completed Assets, including those with no streaming
// renditions.
AssetCount int64 `json:"asset_count" api:"required"`
// AssetsByHighestResolution specifies counts by highest measured streaming
// resolution. Keys are up_to_576, 577_to_720, 721_to_1080, 1081_to_2159, 2160_plus
// and unknown, using the shorter pixel edge.
AssetsByHighestResolution map[string]int64 `json:"assets_by_highest_resolution" api:"required"`
// RenditionCount specifies streaming renditions on completed Assets.
RenditionCount int64 `json:"rendition_count" api:"required"`
// RenditionsPerAsset specifies rendition_count divided by asset_count. Null when
// no completed Assets exist.
RenditionsPerAsset float64 `json:"renditions_per_asset" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AssetCount respjson.Field
AssetsByHighestResolution respjson.Field
RenditionCount respjson.Field
RenditionsPerAsset respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Streaming output distribution on completed Assets.
func (MetricsAssetStreaming) RawJSON ¶ added in v1.0.0
func (r MetricsAssetStreaming) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetStreaming) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetStreaming) UnmarshalJSON(data []byte) error
type MetricsAssetTimings ¶ added in v1.0.0
type MetricsAssetTimings struct {
// CompletionMedianSeconds specifies the median elapsed time from creation to full
// readiness. Null when no samples exist.
CompletionMedianSeconds float64 `json:"completion_median_seconds" api:"required"`
// CompletionSampleCount specifies Assets with a full readiness measurement.
CompletionSampleCount int64 `json:"completion_sample_count" api:"required"`
// PlaybackMedianSeconds specifies the median elapsed time from creation to
// playback readiness. Null when no samples exist.
PlaybackMedianSeconds float64 `json:"playback_median_seconds" api:"required"`
// PlaybackSampleCount specifies Assets with a playback readiness measurement.
PlaybackSampleCount int64 `json:"playback_sample_count" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CompletionMedianSeconds respjson.Field
CompletionSampleCount respjson.Field
PlaybackMedianSeconds respjson.Field
PlaybackSampleCount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Lifecycle timing measurements. Period medians use all samples, not averages of daily medians.
func (MetricsAssetTimings) RawJSON ¶ added in v1.0.0
func (r MetricsAssetTimings) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetTimings) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetTimings) UnmarshalJSON(data []byte) error
type MetricsAssetValues ¶ added in v1.0.0
type MetricsAssetValues struct {
// Asset outcomes grouped by Asset creation date.
Assets MetricsAssetCounts `json:"assets" api:"required"`
// Measured output sizes for completed Assets. Sample counts describe measurement
// coverage.
Outputs MetricsAssetOutputs `json:"outputs" api:"required"`
// Source profiles count Assets, not unique Sources.
Sources MetricsAssetSources `json:"sources" api:"required"`
// Streaming output distribution on completed Assets.
Streaming MetricsAssetStreaming `json:"streaming" api:"required"`
// Lifecycle timing measurements. Period medians use all samples, not averages of
// daily medians.
Timings MetricsAssetTimings `json:"timings" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Assets respjson.Field
Outputs respjson.Field
Sources respjson.Field
Streaming respjson.Field
Timings respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Asset measurements for a creation-date cohort.
func (MetricsAssetValues) RawJSON ¶ added in v1.0.0
func (r MetricsAssetValues) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssetValues) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsAssetValues) UnmarshalJSON(data []byte) error
type MetricsAssets ¶ added in v0.17.0
type MetricsAssets struct {
// Daily specifies one record for each selected creation day, oldest first.
Daily []MetricsAssetDay `json:"daily" api:"required"`
// From specifies the inclusive UTC start date.
From string `json:"from" api:"required"`
// Summary specifies the complete creation-date cohort.
Summary MetricsAssetValues `json:"summary" api:"required"`
// To specifies the exclusive UTC end date.
To string `json:"to" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Daily respjson.Field
From respjson.Field
Summary respjson.Field
To respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Measurements saved on retained Assets. Explicit deletion can change historical results; temporary media cleanup does not erase saved Asset measurements.
func (MetricsAssets) RawJSON ¶ added in v0.17.0
func (r MetricsAssets) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsAssets) UnmarshalJSON ¶ added in v0.17.0
func (r *MetricsAssets) UnmarshalJSON(data []byte) error
type MetricsCreditsSpent ¶ added in v1.0.0
type MetricsCreditsSpent struct {
// Amount specifies settled credits spent on assets. Integer units; 10000 units
// equal USD 1 of credits.
Assets int64 `json:"assets" api:"required"`
// Amount specifies settled credits spent on egress. Integer units; 10000 units
// equal USD 1 of credits.
Egress int64 `json:"egress" api:"required"`
// Amount specifies settled credits spent on static renditions. Integer units;
// 10000 units equal USD 1 of credits.
StaticRenditions int64 `json:"static_renditions" api:"required"`
// Amount specifies settled credits spent on thumbnails. Integer units; 10000 units
// equal USD 1 of credits.
Thumbnails int64 `json:"thumbnails" api:"required"`
// Total specifies the sum of these media-processing and output-egress charges.
// Integer units; 10000 units equal USD 1 of credits.
Total int64 `json:"total" api:"required"`
// Amount specifies settled credits spent on transcodings. Integer units; 10000
// units equal USD 1 of credits.
Transcodings int64 `json:"transcodings" api:"required"`
// Amount specifies settled credits spent on transcription. Integer units; 10000
// units equal USD 1 of credits.
Transcription int64 `json:"transcription" api:"required"`
// Amount specifies settled credits spent on translation. Integer units; 10000
// units equal USD 1 of credits.
Translation int64 `json:"translation" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Assets respjson.Field
Egress respjson.Field
StaticRenditions respjson.Field
Thumbnails respjson.Field
Total respjson.Field
Transcodings respjson.Field
Transcription respjson.Field
Translation respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Settled credits in integer units, with 10000 units equal to USD 1 of credits. Category values are parts of total, not additional charges.
func (MetricsCreditsSpent) RawJSON ¶ added in v1.0.0
func (r MetricsCreditsSpent) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsCreditsSpent) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsCreditsSpent) UnmarshalJSON(data []byte) error
type MetricsStorage ¶ added in v0.17.0
type MetricsStorage struct {
// From specifies the inclusive UTC start date.
From string `json:"from" api:"required"`
// Storages specifies persistent project storage configurations, including those
// without recorded activity. Chunkify temporary storage is excluded.
Storages []MetricsStorageEntry `json:"storages" api:"required"`
// To specifies the exclusive UTC end date.
To string `json:"to" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
From respjson.Field
Storages respjson.Field
To respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Recorded additions and successful removals within event retention. Excludes external storage changes and does not measure current storage size.
func (MetricsStorage) RawJSON ¶ added in v0.17.0
func (r MetricsStorage) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsStorage) UnmarshalJSON ¶ added in v0.17.0
func (r *MetricsStorage) UnmarshalJSON(data []byte) error
type MetricsStorageDay ¶ added in v1.0.0
type MetricsStorageDay struct {
// Date specifies the UTC event day.
Date string `json:"date" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Date respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
MetricsStorageValues
}
Recorded storage activity grouped by event day.
func (MetricsStorageDay) RawJSON ¶ added in v1.0.0
func (r MetricsStorageDay) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsStorageDay) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsStorageDay) UnmarshalJSON(data []byte) error
type MetricsStorageEntry ¶ added in v1.0.0
type MetricsStorageEntry struct {
// Daily specifies one record for each selected event day, oldest first.
Daily []MetricsStorageDay `json:"daily" api:"required"`
// StorageId identifies the persistent storage configuration.
StorageID string `json:"storage_id" api:"required"`
// Summary specifies recorded activity in the selected period.
Summary MetricsStorageValues `json:"summary" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Daily respjson.Field
StorageID respjson.Field
Summary respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Activity for one persistent storage configuration.
func (MetricsStorageEntry) RawJSON ¶ added in v1.0.0
func (r MetricsStorageEntry) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsStorageEntry) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsStorageEntry) UnmarshalJSON(data []byte) error
type MetricsStorageValues ¶ added in v1.0.0
type MetricsStorageValues struct {
// AssetBytesAdded specifies recorded Asset package additions.
AssetBytesAdded int64 `json:"asset_bytes_added" api:"required"`
// BytesRemoved specifies recorded successful file removals as a positive amount.
BytesRemoved int64 `json:"bytes_removed" api:"required"`
// NetBytesChange specifies additions minus successful removals. This may be
// negative and is not bucket occupancy.
NetBytesChange int64 `json:"net_bytes_change" api:"required"`
// SourceBytesAdded specifies recorded Source additions.
SourceBytesAdded int64 `json:"source_bytes_added" api:"required"`
// StaticRenditionBytesAdded specifies recorded static rendition additions.
StaticRenditionBytesAdded int64 `json:"static_rendition_bytes_added" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AssetBytesAdded respjson.Field
BytesRemoved respjson.Field
NetBytesChange respjson.Field
SourceBytesAdded respjson.Field
StaticRenditionBytesAdded respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Recorded storage activity in bytes.
func (MetricsStorageValues) RawJSON ¶ added in v1.0.0
func (r MetricsStorageValues) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsStorageValues) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsStorageValues) UnmarshalJSON(data []byte) error
type MetricsUsage ¶ added in v0.17.0
type MetricsUsage struct {
// Daily specifies one record for every selected day, oldest first.
Daily []MetricsUsageDay `json:"daily" api:"required"`
// From specifies the inclusive UTC start date.
From string `json:"from" api:"required"`
// Summary specifies totals across the selected period.
Summary MetricsUsageValues `json:"summary" api:"required"`
// To specifies the exclusive UTC end date.
To string `json:"to" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Daily respjson.Field
From respjson.Field
Summary respjson.Field
To respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Project usage for the selected UTC accounting period.
func (MetricsUsage) RawJSON ¶ added in v0.17.0
func (r MetricsUsage) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsage) UnmarshalJSON ¶ added in v0.17.0
func (r *MetricsUsage) UnmarshalJSON(data []byte) error
type MetricsUsageAssets ¶ added in v1.0.0
type MetricsUsageAssets struct {
// Failed specifies recorded failed Asset outcomes.
Failed int64 `json:"failed" api:"required"`
// InputSeconds specifies settled billable Asset input duration.
InputSeconds int64 `json:"input_seconds" api:"required"`
// Video duration in seconds by pricing resolution tier: sd, hd, 2k and uhd.
InputSecondsByResolution map[string]int64 `json:"input_seconds_by_resolution" api:"required"`
// Ready specifies recorded successful Asset outcomes.
Ready int64 `json:"ready" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Failed respjson.Field
InputSeconds respjson.Field
InputSecondsByResolution respjson.Field
Ready respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Asset processing usage.
func (MetricsUsageAssets) RawJSON ¶ added in v1.0.0
func (r MetricsUsageAssets) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageAssets) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageAssets) UnmarshalJSON(data []byte) error
type MetricsUsageCaptions ¶ added in v1.0.0
type MetricsUsageCaptions struct {
// TranscriptionSeconds specifies audio duration transcribed.
TranscriptionSeconds int64 `json:"transcription_seconds" api:"required"`
// TranslationSeconds specifies caption duration translated, counted once per
// target language.
TranslationSeconds int64 `json:"translation_seconds" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TranscriptionSeconds respjson.Field
TranslationSeconds respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Caption processing usage.
func (MetricsUsageCaptions) RawJSON ¶ added in v1.0.0
func (r MetricsUsageCaptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageCaptions) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageCaptions) UnmarshalJSON(data []byte) error
type MetricsUsageDay ¶ added in v1.0.0
type MetricsUsageDay struct {
// Date specifies the UTC accounting day.
Date string `json:"date" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Date respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
MetricsUsageValues
}
Daily recorded usage. Inactive days contain zero counters.
func (MetricsUsageDay) RawJSON ¶ added in v1.0.0
func (r MetricsUsageDay) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageDay) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageDay) UnmarshalJSON(data []byte) error
type MetricsUsageEgress ¶ added in v1.0.0
type MetricsUsageEgress struct {
// Bytes specifies tariff-eligible output transfer bytes for Asset preparation.
AssetPreparationBytes int64 `json:"asset_preparation_bytes" api:"required"`
// Bytes specifies tariff-eligible output transfer bytes for streaming renditions.
AssetRenditionBytes int64 `json:"asset_rendition_bytes" api:"required"`
// BillableBytes specifies external output bytes charged after the allowance.
BillableBytes int64 `json:"billable_bytes" api:"required"`
// Bytes specifies tariff-eligible output transfer bytes for captions.
CaptionBytes int64 `json:"caption_bytes" api:"required"`
// IncludedBytes specifies external output bytes covered by the allowance.
IncludedBytes int64 `json:"included_bytes" api:"required"`
// Bytes specifies tariff-eligible output transfer bytes for static renditions.
StaticRenditionBytes int64 `json:"static_rendition_bytes" api:"required"`
// Bytes specifies tariff-eligible output transfer bytes for Thumbnails.
ThumbnailBytes int64 `json:"thumbnail_bytes" api:"required"`
// TotalBytes specifies the sum of tariff-eligible output transfers.
TotalBytes int64 `json:"total_bytes" api:"required"`
// Bytes specifies tariff-eligible output transfer bytes for Transcodings.
TranscodingBytes int64 `json:"transcoding_bytes" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AssetPreparationBytes respjson.Field
AssetRenditionBytes respjson.Field
BillableBytes respjson.Field
CaptionBytes respjson.Field
IncludedBytes respjson.Field
StaticRenditionBytes respjson.Field
ThumbnailBytes respjson.Field
TotalBytes respjson.Field
TranscodingBytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Recorded output egress eligible for the transfer tariff. Provider-exempt transfers are excluded.
func (MetricsUsageEgress) RawJSON ¶ added in v1.0.0
func (r MetricsUsageEgress) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageEgress) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageEgress) UnmarshalJSON(data []byte) error
type MetricsUsageNotifications ¶ added in v1.0.0
type MetricsUsageNotifications struct {
// Failed specifies recorded failed webhook delivery attempts.
Failed int64 `json:"failed" api:"required"`
// Sent specifies recorded successful webhook deliveries.
Sent int64 `json:"sent" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Failed respjson.Field
Sent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Webhook delivery activity.
func (MetricsUsageNotifications) RawJSON ¶ added in v1.0.0
func (r MetricsUsageNotifications) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageNotifications) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageNotifications) UnmarshalJSON(data []byte) error
type MetricsUsageSources ¶ added in v1.0.0
type MetricsUsageSources struct {
// Bytes specifies cumulative ingested Source bytes, not current storage occupancy.
Bytes int64 `json:"bytes" api:"required"`
// Created specifies the number of ingested Sources.
Created int64 `json:"created" api:"required"`
// IngestedSeconds specifies ingested media duration in seconds.
IngestedSeconds int64 `json:"ingested_seconds" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Bytes respjson.Field
Created respjson.Field
IngestedSeconds respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Source ingestion activity.
func (MetricsUsageSources) RawJSON ¶ added in v1.0.0
func (r MetricsUsageSources) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageSources) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageSources) UnmarshalJSON(data []byte) error
type MetricsUsageStaticRenditions ¶ added in v1.0.0
type MetricsUsageStaticRenditions struct {
// AudioOutputSeconds specifies the audio-only subset of output_seconds.
AudioOutputSeconds int64 `json:"audio_output_seconds" api:"required"`
// OutputSeconds specifies settled billable output duration, including audio-only
// output.
OutputSeconds int64 `json:"output_seconds" api:"required"`
// Video duration in seconds by pricing resolution tier. Contains sd, hd, 2k and
// uhd keys; audio is reported separately.
OutputSecondsByResolution map[string]int64 `json:"output_seconds_by_resolution" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioOutputSeconds respjson.Field
OutputSeconds respjson.Field
OutputSecondsByResolution respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Static rendition usage.
func (MetricsUsageStaticRenditions) RawJSON ¶ added in v1.0.0
func (r MetricsUsageStaticRenditions) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageStaticRenditions) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageStaticRenditions) UnmarshalJSON(data []byte) error
type MetricsUsageThumbnails ¶ added in v1.0.0
type MetricsUsageThumbnails struct {
// ImagesPublished specifies the number of published thumbnail images.
ImagesPublished int64 `json:"images_published" api:"required"`
// SetsFailed specifies recorded failed Thumbnail requests.
SetsFailed int64 `json:"sets_failed" api:"required"`
// SetsReady specifies recorded successful Thumbnail requests.
SetsReady int64 `json:"sets_ready" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ImagesPublished respjson.Field
SetsFailed respjson.Field
SetsReady respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Thumbnail processing usage.
func (MetricsUsageThumbnails) RawJSON ¶ added in v1.0.0
func (r MetricsUsageThumbnails) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageThumbnails) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageThumbnails) UnmarshalJSON(data []byte) error
type MetricsUsageTranscodings ¶ added in v1.0.0
type MetricsUsageTranscodings struct {
// AudioOutputSeconds specifies the audio-only subset of output_seconds.
AudioOutputSeconds int64 `json:"audio_output_seconds" api:"required"`
// Failed specifies recorded failed Transcoding outcomes.
Failed int64 `json:"failed" api:"required"`
// OutputSeconds specifies settled billable output duration, including audio-only
// output.
OutputSeconds int64 `json:"output_seconds" api:"required"`
// Video duration in seconds by pricing resolution tier. Contains sd, hd, 2k and
// uhd keys; audio is reported separately.
OutputSecondsByResolution map[string]int64 `json:"output_seconds_by_resolution" api:"required"`
// Ready specifies recorded successful Transcoding outcomes.
Ready int64 `json:"ready" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AudioOutputSeconds respjson.Field
Failed respjson.Field
OutputSeconds respjson.Field
OutputSecondsByResolution respjson.Field
Ready respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Standalone Transcoding usage.
func (MetricsUsageTranscodings) RawJSON ¶ added in v1.0.0
func (r MetricsUsageTranscodings) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageTranscodings) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageTranscodings) UnmarshalJSON(data []byte) error
type MetricsUsageUploads ¶ added in v1.0.0
type MetricsUsageUploads struct {
// Bytes specifies successfully uploaded bytes.
Bytes int64 `json:"bytes" api:"required"`
// Completed specifies successfully completed Uploads.
Completed int64 `json:"completed" api:"required"`
// Failed specifies recorded failed Uploads.
Failed int64 `json:"failed" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Bytes respjson.Field
Completed respjson.Field
Failed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Upload activity.
func (MetricsUsageUploads) RawJSON ¶ added in v1.0.0
func (r MetricsUsageUploads) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageUploads) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageUploads) UnmarshalJSON(data []byte) error
type MetricsUsageValues ¶ added in v1.0.0
type MetricsUsageValues struct {
// Asset processing usage.
Assets MetricsUsageAssets `json:"assets" api:"required"`
// Caption processing usage.
Captions MetricsUsageCaptions `json:"captions" api:"required"`
// Settled credits in integer units, with 10000 units equal to USD 1 of credits.
// Category values are parts of total, not additional charges.
CreditsSpent MetricsCreditsSpent `json:"credits_spent" api:"required"`
// Recorded output egress eligible for the transfer tariff. Provider-exempt
// transfers are excluded.
Egress MetricsUsageEgress `json:"egress" api:"required"`
// Webhook delivery activity.
Notifications MetricsUsageNotifications `json:"notifications" api:"required"`
// Source ingestion activity.
Sources MetricsUsageSources `json:"sources" api:"required"`
// Static rendition usage.
StaticRenditions MetricsUsageStaticRenditions `json:"static_renditions" api:"required"`
// Thumbnail processing usage.
Thumbnails MetricsUsageThumbnails `json:"thumbnails" api:"required"`
// Standalone Transcoding usage.
Transcodings MetricsUsageTranscodings `json:"transcodings" api:"required"`
// Upload activity.
Uploads MetricsUsageUploads `json:"uploads" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Assets respjson.Field
Captions respjson.Field
CreditsSpent respjson.Field
Egress respjson.Field
Notifications respjson.Field
Sources respjson.Field
StaticRenditions respjson.Field
Thumbnails respjson.Field
Transcodings respjson.Field
Uploads respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Recorded usage for a UTC accounting day or a complete period.
func (MetricsUsageValues) RawJSON ¶ added in v1.0.0
func (r MetricsUsageValues) RawJSON() string
Returns the unmodified JSON received from the API
func (*MetricsUsageValues) UnmarshalJSON ¶ added in v1.0.0
func (r *MetricsUsageValues) UnmarshalJSON(data []byte) error
type Notification ¶
type Notification struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Timestamp when the notification was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Type of event that triggered this notification
//
// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
// "source.created", "source.deleted", "upload.created", "upload.completed",
// "upload.failed", "upload.expired", "asset.created", "asset.ready",
// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
// "asset.output.created", "asset.output.ready", "asset.output.failed",
// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
Event WebhookEvent `json:"event" api:"required"`
// ID of the object that triggered this notification
ObjectID string `json:"object_id" api:"required"`
// JSON payload that was sent to the webhook endpoint
Payload string `json:"payload" api:"required"`
// Webhook endpoint configuration that received this notification
Webhook Webhook `json:"webhook" api:"required"`
// Originating event ID, when recorded by the event log.
EventID string `json:"event_id"`
// HTTP status code received from the webhook endpoint
ResponseStatusCode int64 `json:"response_status_code"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Event respjson.Field
ObjectID respjson.Field
Payload respjson.Field
Webhook respjson.Field
EventID respjson.Field
ResponseStatusCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (Notification) RawJSON ¶ added in v0.6.0
func (r Notification) RawJSON() string
Returns the unmodified JSON received from the API
func (*Notification) UnmarshalJSON ¶ added in v0.6.0
func (r *Notification) UnmarshalJSON(data []byte) error
type NotificationGetResponseEnvelope ¶ added in v0.6.0
type NotificationGetResponseEnvelope struct {
// Data contains the response object
Data Notification `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NotificationGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r NotificationGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *NotificationGetResponseEnvelope) UnmarshalJSON(data []byte) error
type NotificationListParams ¶
type NotificationListParams struct {
// Filter deliveries by their originating event ID.
EventID param.Opt[string] `query:"event_id,omitzero" json:"-"`
// Pagination limit (max 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Filter by object ID
ObjectID param.Opt[string] `query:"object_id,omitzero" json:"-"`
// Pagination offset
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter by webhook ID
WebhookID param.Opt[string] `query:"webhook_id,omitzero" json:"-"`
Created NotificationListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by events
Events []WebhookEvent `query:"events,omitzero" json:"-"`
ResponseStatusCode NotificationListParamsResponseStatusCode `query:"response_status_code,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NotificationListParams) URLQuery ¶ added in v0.6.0
func (r NotificationListParams) URLQuery() (v url.Values, err error)
URLQuery serializes NotificationListParams's query parameters as `url.Values`.
type NotificationListParamsCreated ¶ added in v0.6.0
type NotificationListParamsCreated struct {
// Filter by creation date greater than or equal (UNIX epoch time)
Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
// Filter by creation date less than or equal (UNIX epoch time)
Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
// Sort by creation date (asc/desc)
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NotificationListParamsCreated) URLQuery ¶ added in v0.6.0
func (r NotificationListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes NotificationListParamsCreated's query parameters as `url.Values`.
type NotificationListParamsResponseStatusCode ¶ added in v0.6.0
type NotificationListParamsResponseStatusCode struct {
// Filter by exact response status code
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by response status code greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by response status code less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NotificationListParamsResponseStatusCode) URLQuery ¶ added in v0.6.0
func (r NotificationListParamsResponseStatusCode) URLQuery() (v url.Values, err error)
URLQuery serializes NotificationListParamsResponseStatusCode's query parameters as `url.Values`.
type NotificationNewParams ¶ added in v0.6.0
type NotificationNewParams struct {
// Event specifies the type of event that triggered the notification.
//
// Any of "job.created", "job.completed", "job.failed", "job.cancelled",
// "source.created", "source.deleted", "upload.created", "upload.completed",
// "upload.failed", "upload.expired", "asset.created", "asset.ready",
// "asset.playback_ready", "asset.failed", "asset.expired", "asset.deleted",
// "asset.output.created", "asset.output.ready", "asset.output.failed",
// "asset.output.deleted", "workflow_run.created", "workflow_run.completed",
// "workflow_run.failed", "workflow_run.cancelled", "transcoding.created",
// "transcoding.ready", "transcoding.failed", "transcoding.cancelled",
// "transcoding.expired", "transcoding.deleted", "thumbnail.created",
// "thumbnail.ready", "thumbnail.failed", "thumbnail.expired", "thumbnail.deleted".
Event WebhookEvent `json:"event,omitzero" api:"required"`
// ID of the resource that triggered the event. Use the caption, static rendition,
// or thumbnail ID for their Asset child events. Replaying asset events,
// job.created, or source.created requires a retained snapshot. Resource deletion
// does not prevent replay.
ObjectID string `json:"object_id" api:"required"`
// WebhookId specifies the webhook endpoint that will receive the notification.
WebhookID string `json:"webhook_id" api:"required"`
// contains filtered or unexported fields
}
func (NotificationNewParams) MarshalJSON ¶ added in v0.6.0
func (r NotificationNewParams) MarshalJSON() (data []byte, err error)
func (*NotificationNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *NotificationNewParams) UnmarshalJSON(data []byte) error
type NotificationNewResponseEnvelope ¶ added in v0.6.0
type NotificationNewResponseEnvelope struct {
// Data contains the response object
Data Notification `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NotificationNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r NotificationNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *NotificationNewResponseEnvelope) UnmarshalJSON(data []byte) error
type NotificationPayloadAsset ¶ added in v1.0.0
type NotificationPayloadAsset struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadAssetData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "asset.created", "asset.ready", "asset.playback_ready", "asset.failed",
// "asset.expired".
Event NotificationPayloadAssetEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for asset.created, asset.ready, asset.playback_ready, asset.failed and asset.expired.
func (NotificationPayloadAsset) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAsset) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAsset) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetData ¶ added in v1.0.0
type NotificationPayloadAssetData struct {
Asset Asset `json:"asset" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Asset respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NotificationPayloadAssetData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetData) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetDeleted ¶ added in v1.0.0
type NotificationPayloadAssetDeleted struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadAssetDeletedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "asset.deleted".
Event NotificationPayloadAssetDeletedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for asset.deleted.
func (NotificationPayloadAssetDeleted) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetDeleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetDeleted) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetDeleted) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetDeletedData ¶ added in v1.0.0
type NotificationPayloadAssetDeletedData struct {
Asset Asset `json:"asset" api:"required"`
// FilesDeleted indicates whether the requested cleanup of the Asset's generated
// files completed without error. Missing files count as successful cleanup. False
// means these files were not removed at event time. Private transcript text and
// saved subtitle copies are always scheduled for asynchronous cleanup.
FilesDeleted bool `json:"files_deleted" api:"required"`
// DeletedSize specifies the recorded generated-file bytes removed with the Asset,
// including attached outputs. Omitted when cleanup was not requested or the total
// is unavailable. Missing storage objects still contribute their recorded sizes.
DeletedSize int64 `json:"deleted_size"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Asset respjson.Field
FilesDeleted respjson.Field
DeletedSize respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for asset.deleted. The Asset snapshot is preserved after record deletion.
func (NotificationPayloadAssetDeletedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetDeletedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetDeletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetDeletedData) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetDeletedEvent ¶ added in v1.0.0
type NotificationPayloadAssetDeletedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadAssetDeletedEventAssetDeleted NotificationPayloadAssetDeletedEvent = "asset.deleted"
)
type NotificationPayloadAssetEvent ¶ added in v1.0.0
type NotificationPayloadAssetEvent string
Type of event that triggered the notification.
const ( NotificationPayloadAssetEventAssetCreated NotificationPayloadAssetEvent = "asset.created" NotificationPayloadAssetEventAssetReady NotificationPayloadAssetEvent = "asset.ready" NotificationPayloadAssetEventAssetPlaybackReady NotificationPayloadAssetEvent = "asset.playback_ready" NotificationPayloadAssetEventAssetFailed NotificationPayloadAssetEvent = "asset.failed" NotificationPayloadAssetEventAssetExpired NotificationPayloadAssetEvent = "asset.expired" )
type NotificationPayloadAssetOutput ¶ added in v1.0.0
type NotificationPayloadAssetOutput struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadAssetOutputData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "asset.output.created", "asset.output.ready", "asset.output.failed".
Event NotificationPayloadAssetOutputEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for asset.output.created, asset.output.ready and asset.output.failed.
func (NotificationPayloadAssetOutput) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetOutput) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetOutput) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetOutput) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetOutputData ¶ added in v1.0.0
type NotificationPayloadAssetOutputData struct {
// Output contains the canonical typed output snapshot at the event time, matching
// the output API.
Output AssetOutputUnion `json:"output" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for Asset output creation, readiness, and failure events.
func (NotificationPayloadAssetOutputData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetOutputData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetOutputData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetOutputData) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetOutputDeleted ¶ added in v1.0.0
type NotificationPayloadAssetOutputDeleted struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadAssetOutputDeletedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "asset.output.deleted".
Event NotificationPayloadAssetOutputDeletedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for asset.output.deleted.
func (NotificationPayloadAssetOutputDeleted) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetOutputDeleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetOutputDeleted) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetOutputDeleted) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetOutputDeletedData ¶ added in v1.0.0
type NotificationPayloadAssetOutputDeletedData struct {
// FilesDeleted indicates whether the requested cleanup of the output files
// completed without error. Missing files count as successful cleanup. False means
// these files were not removed at event time. Private transcript text and saved
// subtitle copies are always scheduled for asynchronous cleanup.
FilesDeleted bool `json:"files_deleted" api:"required"`
// Output contains the canonical typed output snapshot before removal.
Output AssetOutputUnion `json:"output" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
FilesDeleted respjson.Field
Output respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for asset.output.deleted. The output snapshot is preserved after removal.
func (NotificationPayloadAssetOutputDeletedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadAssetOutputDeletedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadAssetOutputDeletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadAssetOutputDeletedData) UnmarshalJSON(data []byte) error
type NotificationPayloadAssetOutputDeletedEvent ¶ added in v1.0.0
type NotificationPayloadAssetOutputDeletedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadAssetOutputDeletedEventAssetOutputDeleted NotificationPayloadAssetOutputDeletedEvent = "asset.output.deleted"
)
type NotificationPayloadAssetOutputEvent ¶ added in v1.0.0
type NotificationPayloadAssetOutputEvent string
Type of event that triggered the notification.
const ( NotificationPayloadAssetOutputEventAssetOutputCreated NotificationPayloadAssetOutputEvent = "asset.output.created" NotificationPayloadAssetOutputEventAssetOutputReady NotificationPayloadAssetOutputEvent = "asset.output.ready" NotificationPayloadAssetOutputEventAssetOutputFailed NotificationPayloadAssetOutputEvent = "asset.output.failed" )
type NotificationPayloadJobCompleted ¶ added in v1.0.0
type NotificationPayloadJobCompleted struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadJobCompletedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "job.completed".
Event NotificationPayloadJobCompletedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for job.completed.
func (NotificationPayloadJobCompleted) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadJobCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadJobCompleted) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadJobCompleted) UnmarshalJSON(data []byte) error
type NotificationPayloadJobCompletedData ¶
type NotificationPayloadJobCompletedData struct {
// List of files generated by the job
Files []JobFile `json:"files" api:"required"`
Job Job `json:"job" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Files respjson.Field
Job respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload data structure for job.completed events
func (NotificationPayloadJobCompletedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadJobCompletedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadJobCompletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadJobCompletedData) UnmarshalJSON(data []byte) error
type NotificationPayloadJobCompletedEvent ¶ added in v1.0.0
type NotificationPayloadJobCompletedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadJobCompletedEventJobCompleted NotificationPayloadJobCompletedEvent = "job.completed"
)
type NotificationPayloadJobCreated ¶ added in v1.0.0
type NotificationPayloadJobCreated struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadJobCreatedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "job.created".
Event NotificationPayloadJobCreatedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for job.created.
func (NotificationPayloadJobCreated) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadJobCreated) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadJobCreated) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadJobCreated) UnmarshalJSON(data []byte) error
type NotificationPayloadJobCreatedData ¶ added in v1.0.0
type NotificationPayloadJobCreatedData struct {
Job Job `json:"job" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Job respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for job.created. A standalone Job has been accepted for processing; execution may not have started.
func (NotificationPayloadJobCreatedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadJobCreatedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadJobCreatedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadJobCreatedData) UnmarshalJSON(data []byte) error
type NotificationPayloadJobCreatedEvent ¶ added in v1.0.0
type NotificationPayloadJobCreatedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadJobCreatedEventJobCreated NotificationPayloadJobCreatedEvent = "job.created"
)
type NotificationPayloadJobFailed ¶ added in v1.0.0
type NotificationPayloadJobFailed struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadJobFailedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "job.failed", "job.cancelled".
Event NotificationPayloadJobFailedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for job.failed and job.cancelled.
func (NotificationPayloadJobFailed) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadJobFailed) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadJobFailed) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadJobFailed) UnmarshalJSON(data []byte) error
type NotificationPayloadJobFailedData ¶ added in v1.0.0
type NotificationPayloadJobFailedData struct {
Job Job `json:"job" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Job respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload data structure for job.failed and job.cancelled events
func (NotificationPayloadJobFailedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadJobFailedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadJobFailedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadJobFailedData) UnmarshalJSON(data []byte) error
type NotificationPayloadJobFailedEvent ¶ added in v1.0.0
type NotificationPayloadJobFailedEvent string
Type of event that triggered the notification.
const ( NotificationPayloadJobFailedEventJobFailed NotificationPayloadJobFailedEvent = "job.failed" NotificationPayloadJobFailedEventJobCancelled NotificationPayloadJobFailedEvent = "job.cancelled" )
type NotificationPayloadSourceCreated ¶ added in v1.0.0
type NotificationPayloadSourceCreated struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadSourceCreatedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "source.created".
Event NotificationPayloadSourceCreatedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for source.created.
func (NotificationPayloadSourceCreated) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadSourceCreated) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadSourceCreated) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadSourceCreated) UnmarshalJSON(data []byte) error
type NotificationPayloadSourceCreatedData ¶ added in v1.0.0
type NotificationPayloadSourceCreatedData struct {
Source Source `json:"source" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for source.created. The Source has been validated and saved. Thumbnails may still be pending.
func (NotificationPayloadSourceCreatedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadSourceCreatedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadSourceCreatedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadSourceCreatedData) UnmarshalJSON(data []byte) error
type NotificationPayloadSourceCreatedEvent ¶ added in v1.0.0
type NotificationPayloadSourceCreatedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadSourceCreatedEventSourceCreated NotificationPayloadSourceCreatedEvent = "source.created"
)
type NotificationPayloadSourceDeleted ¶ added in v1.0.0
type NotificationPayloadSourceDeleted struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadSourceDeletedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "source.deleted".
Event NotificationPayloadSourceDeletedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for source.deleted.
func (NotificationPayloadSourceDeleted) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadSourceDeleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadSourceDeleted) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadSourceDeleted) UnmarshalJSON(data []byte) error
type NotificationPayloadSourceDeletedData ¶ added in v1.0.0
type NotificationPayloadSourceDeletedData struct {
// Source contains the last snapshot before deletion.
Source Source `json:"source" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for source.deleted. The Source was deleted on request or after the team's data retention period. Resources created from it are preserved and no longer report its source_id.
func (NotificationPayloadSourceDeletedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadSourceDeletedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadSourceDeletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadSourceDeletedData) UnmarshalJSON(data []byte) error
type NotificationPayloadSourceDeletedEvent ¶ added in v1.0.0
type NotificationPayloadSourceDeletedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadSourceDeletedEventSourceDeleted NotificationPayloadSourceDeletedEvent = "source.deleted"
)
type NotificationPayloadThumbnail ¶ added in v1.0.0
type NotificationPayloadThumbnail struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadThumbnailData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "thumbnail.created", "thumbnail.ready", "thumbnail.failed",
// "thumbnail.expired", "thumbnail.deleted".
Event NotificationPayloadThumbnailEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for thumbnail.created, thumbnail.ready, thumbnail.failed, thumbnail.expired and thumbnail.deleted.
func (NotificationPayloadThumbnail) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadThumbnail) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadThumbnail) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadThumbnail) UnmarshalJSON(data []byte) error
type NotificationPayloadThumbnailData ¶ added in v1.0.0
type NotificationPayloadThumbnailData struct {
// Thumbnail contains the resource at the event time.
Thumbnail Thumbnail `json:"thumbnail" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Thumbnail respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A canonical thumbnail snapshot for standalone thumbnail.\* events. Asset-owned thumbnails use the Asset output event payload.
func (NotificationPayloadThumbnailData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadThumbnailData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadThumbnailData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadThumbnailData) UnmarshalJSON(data []byte) error
type NotificationPayloadThumbnailEvent ¶ added in v1.0.0
type NotificationPayloadThumbnailEvent string
Type of event that triggered the notification.
const ( NotificationPayloadThumbnailEventThumbnailCreated NotificationPayloadThumbnailEvent = "thumbnail.created" NotificationPayloadThumbnailEventThumbnailReady NotificationPayloadThumbnailEvent = "thumbnail.ready" NotificationPayloadThumbnailEventThumbnailFailed NotificationPayloadThumbnailEvent = "thumbnail.failed" NotificationPayloadThumbnailEventThumbnailExpired NotificationPayloadThumbnailEvent = "thumbnail.expired" NotificationPayloadThumbnailEventThumbnailDeleted NotificationPayloadThumbnailEvent = "thumbnail.deleted" )
type NotificationPayloadTranscoding ¶ added in v1.0.0
type NotificationPayloadTranscoding struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadTranscodingData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "transcoding.created", "transcoding.ready", "transcoding.failed",
// "transcoding.cancelled", "transcoding.expired", "transcoding.deleted".
Event NotificationPayloadTranscodingEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for transcoding.created, transcoding.ready, transcoding.failed, transcoding.cancelled, transcoding.expired and transcoding.deleted.
func (NotificationPayloadTranscoding) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadTranscoding) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadTranscoding) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadTranscoding) UnmarshalJSON(data []byte) error
type NotificationPayloadTranscodingData ¶ added in v1.0.0
type NotificationPayloadTranscodingData struct {
// Transcoding contains the canonical resource snapshot at the event time.
Transcoding Transcoding `json:"transcoding" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Transcoding respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for transcoding.created, transcoding.ready, transcoding.failed, transcoding.cancelled, transcoding.expired and transcoding.deleted events.
func (NotificationPayloadTranscodingData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadTranscodingData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadTranscodingData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadTranscodingData) UnmarshalJSON(data []byte) error
type NotificationPayloadTranscodingEvent ¶ added in v1.0.0
type NotificationPayloadTranscodingEvent string
Type of event that triggered the notification.
const ( NotificationPayloadTranscodingEventTranscodingCreated NotificationPayloadTranscodingEvent = "transcoding.created" NotificationPayloadTranscodingEventTranscodingReady NotificationPayloadTranscodingEvent = "transcoding.ready" NotificationPayloadTranscodingEventTranscodingFailed NotificationPayloadTranscodingEvent = "transcoding.failed" NotificationPayloadTranscodingEventTranscodingCancelled NotificationPayloadTranscodingEvent = "transcoding.cancelled" NotificationPayloadTranscodingEventTranscodingExpired NotificationPayloadTranscodingEvent = "transcoding.expired" NotificationPayloadTranscodingEventTranscodingDeleted NotificationPayloadTranscodingEvent = "transcoding.deleted" )
type NotificationPayloadUploadCompleted ¶ added in v1.0.0
type NotificationPayloadUploadCompleted struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadUploadCompletedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "upload.completed".
Event NotificationPayloadUploadCompletedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for upload.completed.
func (NotificationPayloadUploadCompleted) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadUploadCompleted) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadUploadCompleted) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadUploadCompleted) UnmarshalJSON(data []byte) error
type NotificationPayloadUploadCompletedData ¶ added in v1.0.0
type NotificationPayloadUploadCompletedData struct {
Source Source `json:"source" api:"required"`
Upload Upload `json:"upload" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Source respjson.Field
Upload respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload data structure for upload.completed events
func (NotificationPayloadUploadCompletedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadUploadCompletedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadUploadCompletedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadUploadCompletedData) UnmarshalJSON(data []byte) error
type NotificationPayloadUploadCompletedEvent ¶ added in v1.0.0
type NotificationPayloadUploadCompletedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadUploadCompletedEventUploadCompleted NotificationPayloadUploadCompletedEvent = "upload.completed"
)
type NotificationPayloadUploadCreated ¶ added in v1.0.0
type NotificationPayloadUploadCreated struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadUploadCreatedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "upload.created".
Event NotificationPayloadUploadCreatedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for upload.created.
func (NotificationPayloadUploadCreated) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadUploadCreated) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadUploadCreated) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadUploadCreated) UnmarshalJSON(data []byte) error
type NotificationPayloadUploadCreatedData ¶ added in v1.0.0
type NotificationPayloadUploadCreatedData struct {
Upload Upload `json:"upload" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Upload respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for upload.created. A waiting upload session has been created; its Source is created only after successful completion. Transfer credentials are not included.
func (NotificationPayloadUploadCreatedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadUploadCreatedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadUploadCreatedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadUploadCreatedData) UnmarshalJSON(data []byte) error
type NotificationPayloadUploadCreatedEvent ¶ added in v1.0.0
type NotificationPayloadUploadCreatedEvent string
Type of event that triggered the notification.
const (
NotificationPayloadUploadCreatedEventUploadCreated NotificationPayloadUploadCreatedEvent = "upload.created"
)
type NotificationPayloadUploadFailed ¶ added in v1.0.0
type NotificationPayloadUploadFailed struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadUploadFailedData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "upload.failed", "upload.expired".
Event NotificationPayloadUploadFailedEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for upload.failed and upload.expired.
func (NotificationPayloadUploadFailed) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadUploadFailed) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadUploadFailed) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadUploadFailed) UnmarshalJSON(data []byte) error
type NotificationPayloadUploadFailedData ¶ added in v1.0.0
type NotificationPayloadUploadFailedData struct {
Upload Upload `json:"upload" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Upload respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload data structure for upload.failed and upload.expired events
func (NotificationPayloadUploadFailedData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadUploadFailedData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadUploadFailedData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadUploadFailedData) UnmarshalJSON(data []byte) error
type NotificationPayloadUploadFailedEvent ¶ added in v1.0.0
type NotificationPayloadUploadFailedEvent string
Type of event that triggered the notification.
const ( NotificationPayloadUploadFailedEventUploadFailed NotificationPayloadUploadFailedEvent = "upload.failed" NotificationPayloadUploadFailedEventUploadExpired NotificationPayloadUploadFailedEvent = "upload.expired" )
type NotificationPayloadWorkflowRun ¶ added in v1.0.0
type NotificationPayloadWorkflowRun struct {
// Unique identifier of the notification
ID string `json:"id" api:"required"`
// Payload for the event named in event. Replays preserve the original data;
// retrieve the resource for current state and fresh signed URLs.
Data NotificationPayloadWorkflowRunData `json:"data" api:"required"`
// Timestamp of the event payload.
Date time.Time `json:"date" api:"required" format:"date-time"`
// Type of event that triggered the notification.
//
// Any of "workflow_run.created", "workflow_run.completed", "workflow_run.failed",
// "workflow_run.cancelled".
Event NotificationPayloadWorkflowRunEvent `json:"event" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Notification for workflow_run.created, workflow_run.completed, workflow_run.failed and workflow_run.cancelled.
func (NotificationPayloadWorkflowRun) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadWorkflowRun) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadWorkflowRun) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadWorkflowRun) UnmarshalJSON(data []byte) error
type NotificationPayloadWorkflowRunData ¶ added in v1.0.0
type NotificationPayloadWorkflowRunData struct {
// ActionRuns specifies every action admitted by this run, including its rule and
// action IDs, type, input, status, output reference, and any skip or failure
// reason. Actions from other runs are excluded.
ActionRuns []AssetActionRun `json:"action_runs" api:"required"`
// Snapshot of the Workflow run when the event was recorded.
WorkflowRun WorkflowRun `json:"workflow_run" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActionRuns respjson.Field
WorkflowRun respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Payload for workflow_run.created, workflow_run.completed, workflow_run.failed, and workflow_run.cancelled. The run and its actions are snapshots taken when the event was recorded.
func (NotificationPayloadWorkflowRunData) RawJSON ¶ added in v1.0.0
func (r NotificationPayloadWorkflowRunData) RawJSON() string
Returns the unmodified JSON received from the API
func (*NotificationPayloadWorkflowRunData) UnmarshalJSON ¶ added in v1.0.0
func (r *NotificationPayloadWorkflowRunData) UnmarshalJSON(data []byte) error
type NotificationPayloadWorkflowRunEvent ¶ added in v1.0.0
type NotificationPayloadWorkflowRunEvent string
Type of event that triggered the notification.
const ( NotificationPayloadWorkflowRunEventWorkflowRunCreated NotificationPayloadWorkflowRunEvent = "workflow_run.created" NotificationPayloadWorkflowRunEventWorkflowRunCompleted NotificationPayloadWorkflowRunEvent = "workflow_run.completed" NotificationPayloadWorkflowRunEventWorkflowRunFailed NotificationPayloadWorkflowRunEvent = "workflow_run.failed" NotificationPayloadWorkflowRunEventWorkflowRunCancelled NotificationPayloadWorkflowRunEvent = "workflow_run.cancelled" )
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
func (r *NotificationService) List(ctx context.Context, query NotificationListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Notification], err error)
Retrieve a list of notifications with optional filtering and pagination
func (*NotificationService) ListAutoPaging ¶ added in v0.6.0
func (r *NotificationService) ListAutoPaging(ctx context.Context, query NotificationListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Notification]
Retrieve a list of notifications with optional filtering and pagination
func (*NotificationService) New ¶ added in v0.6.0
func (r *NotificationService) New(ctx context.Context, body NotificationNewParams, opts ...option.RequestOption) (res *Notification, err error)
Send an event notification to a webhook endpoint. Recorded events replay their original payload.
type Project ¶
type Project struct {
// Id is the unique identifier for the project.
ID string `json:"id" api:"required"`
// Defaults for new Assets, including Assets created from Uploads.
AssetDefaults AssetDefaults `json:"asset_defaults" api:"required"`
// Timestamp when the project was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Name of the project
Name string `json:"name" api:"required"`
// Slug is the slug for the project.
Slug string `json:"slug" api:"required"`
// StorageId identifier where project files are stored
StorageID string `json:"storage_id" api:"required"`
// DefaultWorkflowId specifies the default Workflow for new Assets. Set null to
// clear it.
DefaultWorkflowID string `json:"default_workflow_id" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetDefaults respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Slug respjson.Field
StorageID respjson.Field
DefaultWorkflowID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Project) UnmarshalJSON ¶ added in v0.6.0
type ProjectAnalyticsConnectionDeleteParams ¶ added in v1.0.0
type ProjectAnalyticsConnectionDeleteParams struct {
ProjectID string `path:"projectId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type ProjectAnalyticsConnectionGetParams ¶ added in v1.0.0
type ProjectAnalyticsConnectionGetParams struct {
ProjectID string `path:"projectId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type ProjectAnalyticsConnectionGetResponseEnvelope ¶ added in v0.17.0
type ProjectAnalyticsConnectionGetResponseEnvelope struct {
// A saved source for analytics reports. The dashboard player default is
// independent of the connection selected in reports. External players keep their
// own configuration. Only the public ingest key is included; read and management
// credentials stay private.
Data AnalyticsConnection `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionGetResponseEnvelope) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionKeyListParams ¶ added in v1.0.0
type ProjectAnalyticsConnectionKeyListParams struct {
ProjectID string `path:"projectId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type ProjectAnalyticsConnectionKeyListResponse ¶ added in v0.17.0
type ProjectAnalyticsConnectionKeyListResponse struct {
Data []AnalyticsKey `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionKeyListResponse) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionKeyListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionKeyListResponse) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyListResponse) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionKeyNewParams ¶ added in v0.17.0
type ProjectAnalyticsConnectionKeyNewParams struct {
ProjectID string `path:"projectId" api:"required" json:"-"`
// Purpose distinguishes player ingestion, read-only API access and a separate
// read-only MCP credential. Read and MCP keys have the same collector permissions.
//
// Any of "player", "read", "mcp".
Purpose ProjectAnalyticsConnectionKeyNewParamsPurpose `json:"purpose,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (ProjectAnalyticsConnectionKeyNewParams) MarshalJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionKeyNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectAnalyticsConnectionKeyNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyNewParams) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionKeyNewParamsPurpose ¶ added in v0.17.0
type ProjectAnalyticsConnectionKeyNewParamsPurpose string
Purpose distinguishes player ingestion, read-only API access and a separate read-only MCP credential. Read and MCP keys have the same collector permissions.
const ( ProjectAnalyticsConnectionKeyNewParamsPurposePlayer ProjectAnalyticsConnectionKeyNewParamsPurpose = "player" ProjectAnalyticsConnectionKeyNewParamsPurposeRead ProjectAnalyticsConnectionKeyNewParamsPurpose = "read" ProjectAnalyticsConnectionKeyNewParamsPurposeMcp ProjectAnalyticsConnectionKeyNewParamsPurpose = "mcp" )
type ProjectAnalyticsConnectionKeyNewResponse ¶ added in v0.17.0
type ProjectAnalyticsConnectionKeyNewResponse struct {
// One key per purpose. Public player values remain available; read and MCP values
// are returned only on creation or rotation.
Data AnalyticsKey `json:"data" api:"required"`
// Key is the new credential. Save read and MCP keys now; later reads omit their
// values. Public keys remain available.
Key string `json:"key" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Key respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionKeyNewResponse) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionKeyNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionKeyNewResponse) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyNewResponse) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionKeyRotateParams ¶ added in v1.0.0
type ProjectAnalyticsConnectionKeyRotateResponse ¶ added in v0.17.0
type ProjectAnalyticsConnectionKeyRotateResponse struct {
// One key per purpose. Public player values remain available; read and MCP values
// are returned only on creation or rotation.
Data AnalyticsKey `json:"data" api:"required"`
// Key is the new credential. Save read and MCP keys now; later reads omit their
// values. Public keys remain available.
Key string `json:"key" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Key respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionKeyRotateResponse) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionKeyRotateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionKeyRotateResponse) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyRotateResponse) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionKeyService ¶ added in v0.17.0
type ProjectAnalyticsConnectionKeyService struct {
Options []option.RequestOption
}
ProjectAnalyticsConnectionKeyService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectAnalyticsConnectionKeyService method instead.
func NewProjectAnalyticsConnectionKeyService ¶ added in v0.17.0
func NewProjectAnalyticsConnectionKeyService(opts ...option.RequestOption) (r ProjectAnalyticsConnectionKeyService)
NewProjectAnalyticsConnectionKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectAnalyticsConnectionKeyService) List ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyService) List(ctx context.Context, connectionID string, query ProjectAnalyticsConnectionKeyListParams, opts ...option.RequestOption) (res *ProjectAnalyticsConnectionKeyListResponse, err error)
List keys for a hosted Chunkify Analytics server: the public key used by players to send events, and read-only secret key records for dashboard and MCP access. Secret values are not returned. Requires a team owner and a Team Access Key.
func (*ProjectAnalyticsConnectionKeyService) New ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyService) New(ctx context.Context, connectionID string, params ProjectAnalyticsConnectionKeyNewParams, opts ...option.RequestOption) (res *ProjectAnalyticsConnectionKeyNewResponse, err error)
Generate a public key for players to send events, or a read-only secret key for a dashboard or MCP client to query a hosted Chunkify Analytics server. Save secret keys when returned. Requires a team owner and a Team Access Key.
func (*ProjectAnalyticsConnectionKeyService) Rotate ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionKeyService) Rotate(ctx context.Context, keyID string, body ProjectAnalyticsConnectionKeyRotateParams, opts ...option.RequestOption) (res *ProjectAnalyticsConnectionKeyRotateResponse, err error)
Rotate a public or read-only secret key for a hosted Chunkify Analytics server. Update the player, dashboard, or MCP client with the new key; the old key stops working immediately. Requires a team owner and a Team Access Key.
type ProjectAnalyticsConnectionListResponse ¶ added in v0.17.0
type ProjectAnalyticsConnectionListResponse struct {
// Saved connections in creation order.
Data []AnalyticsConnection `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionListResponse) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionListResponse) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionListResponse) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionNewParams ¶ added in v0.17.0
type ProjectAnalyticsConnectionNewParams struct {
// Name identifies this connection in the dashboard.
Name string `json:"name" api:"required"`
// Type specifies whether Chunkify manages the analytics project.
//
// Any of "hosted", "custom".
Type ProjectAnalyticsConnectionNewParamsType `json:"type,omitzero" api:"required"`
// Endpoint specifies the custom server base URL. Required for custom connections
// and omitted for hosted connections.
Endpoint param.Opt[string] `json:"endpoint,omitzero"`
// PublicIngestKey optionally enables preview tracking for a custom connection.
// Supply the public ingestion key for the same analytics project as read_key. It
// is returned in connection reads and used in browser code. Omit for hosted
// connections.
PublicIngestKey param.Opt[string] `json:"public_ingest_key,omitzero"`
// ReadKey supplies a read-only project credential for a custom connection.
// Required for custom connections and omitted for hosted connections. Stored
// encrypted and never returned.
ReadKey param.Opt[string] `json:"read_key,omitzero"`
// contains filtered or unexported fields
}
func (ProjectAnalyticsConnectionNewParams) MarshalJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectAnalyticsConnectionNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionNewParams) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionNewParamsType ¶ added in v0.17.0
type ProjectAnalyticsConnectionNewParamsType string
Type specifies whether Chunkify manages the analytics project.
const ( ProjectAnalyticsConnectionNewParamsTypeHosted ProjectAnalyticsConnectionNewParamsType = "hosted" ProjectAnalyticsConnectionNewParamsTypeCustom ProjectAnalyticsConnectionNewParamsType = "custom" )
type ProjectAnalyticsConnectionNewResponse ¶ added in v0.17.0
type ProjectAnalyticsConnectionNewResponse struct {
// A saved source for analytics reports. The dashboard player default is
// independent of the connection selected in reports. External players keep their
// own configuration. Only the public ingest key is included; read and management
// credentials stay private.
Data AnalyticsConnection `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// PublicKey is the hosted ingestion key. It remains available as public_ingest_key
// on the connection. Omitted for custom connections.
PublicKey string `json:"public_key"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
PublicKey respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionNewResponse) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionNewResponse) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionNewResponse) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionService ¶ added in v0.17.0
type ProjectAnalyticsConnectionService struct {
Options []option.RequestOption
Keys ProjectAnalyticsConnectionKeyService
}
ProjectAnalyticsConnectionService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectAnalyticsConnectionService method instead.
func NewProjectAnalyticsConnectionService ¶ added in v0.17.0
func NewProjectAnalyticsConnectionService(opts ...option.RequestOption) (r ProjectAnalyticsConnectionService)
NewProjectAnalyticsConnectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectAnalyticsConnectionService) Delete ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionService) Delete(ctx context.Context, connectionID string, body ProjectAnalyticsConnectionDeleteParams, opts ...option.RequestOption) (err error)
For hosted connections, delete the linked analytics project and invalidate its keys before removing the saved connection. Stored events expire under the collector retention policy. For custom connections, remove only the saved credentials and connection; the remote server, project and data remain unchanged. Only team owners can delete connections. An uncertain remote result preserves the connection for reconciliation.
func (*ProjectAnalyticsConnectionService) Get ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionService) Get(ctx context.Context, connectionID string, query ProjectAnalyticsConnectionGetParams, opts ...option.RequestOption) (res *AnalyticsConnection, err error)
Retrieve non-secret connection metadata within its owning project.
func (*ProjectAnalyticsConnectionService) List ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionService) List(ctx context.Context, projectID string, opts ...option.RequestOption) (res *ProjectAnalyticsConnectionListResponse, err error)
List the saved connections for this project. No connection is activated by this request.
func (*ProjectAnalyticsConnectionService) New ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionService) New(ctx context.Context, projectID string, body ProjectAnalyticsConnectionNewParams, opts ...option.RequestOption) (res *ProjectAnalyticsConnectionNewResponse, err error)
Add a hosted connection or validate and save a custom server. Only team owners can create connections. Retry a known failed hosted setup with the same name to resume its saved project; an unknown creation outcome requires operator reconciliation.
func (*ProjectAnalyticsConnectionService) Update ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionService) Update(ctx context.Context, connectionID string, params ProjectAnalyticsConnectionUpdateParams, opts ...option.RequestOption) (res *AnalyticsConnection, err error)
Rename a connection or validate replacement custom credentials. Only team owners can update connections. Existing settings remain unchanged if validation fails.
type ProjectAnalyticsConnectionUpdateParams ¶ added in v0.17.0
type ProjectAnalyticsConnectionUpdateParams struct {
ProjectID string `path:"projectId" api:"required" json:"-"`
// DefaultForDashboard selects this ready connection for Chunkify dashboard
// players, public previews, the playground and newly generated snippets. Requires
// a public ingest key. Setting true replaces the previous default atomically.
// Setting false disables dashboard tracking if no default remains; another
// connection is not selected automatically. Existing external players keep their
// own configuration.
DefaultForDashboard param.Opt[bool] `json:"default_for_dashboard,omitzero"`
// Endpoint specifies a replacement custom server base URL. Supply read_key
// together with it.
Endpoint param.Opt[string] `json:"endpoint,omitzero"`
// Name identifies this connection in the dashboard.
Name param.Opt[string] `json:"name,omitzero"`
// PublicIngestKey optionally enables preview tracking for a custom connection.
// Supply the public ingestion key for the same analytics project as read_key. It
// is returned in connection reads and used in browser code. Omit for hosted
// connections. An empty string disables preview tracking. A replacement endpoint
// clears the saved public key unless a replacement is supplied.
PublicIngestKey param.Opt[string] `json:"public_ingest_key,omitzero"`
// ReadKey replaces the custom connection credential after validation. Its value is
// never returned.
ReadKey param.Opt[string] `json:"read_key,omitzero"`
// AllowedOrigins lists additional website origins permitted to ingest events for a
// hosted connection. Shared installation origins remain allowed. An empty list
// clears project-specific origins. Custom servers manage origins on their own
// infrastructure.
AllowedOrigins []string `json:"allowed_origins,omitzero"`
// contains filtered or unexported fields
}
func (ProjectAnalyticsConnectionUpdateParams) MarshalJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProjectAnalyticsConnectionUpdateParams) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionUpdateParams) UnmarshalJSON(data []byte) error
type ProjectAnalyticsConnectionUpdateResponseEnvelope ¶ added in v0.17.0
type ProjectAnalyticsConnectionUpdateResponseEnvelope struct {
// A saved source for analytics reports. The dashboard player default is
// independent of the connection selected in reports. External players keep their
// own configuration. Only the public ingest key is included; read and management
// credentials stay private.
Data AnalyticsConnection `json:"data" api:"required"`
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectAnalyticsConnectionUpdateResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r ProjectAnalyticsConnectionUpdateResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectAnalyticsConnectionUpdateResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *ProjectAnalyticsConnectionUpdateResponseEnvelope) UnmarshalJSON(data []byte) error
type ProjectAnalyticsService ¶ added in v0.17.0
type ProjectAnalyticsService struct {
Options []option.RequestOption
Connections ProjectAnalyticsConnectionService
}
ProjectAnalyticsService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectAnalyticsService method instead.
func NewProjectAnalyticsService ¶ added in v0.17.0
func NewProjectAnalyticsService(opts ...option.RequestOption) (r ProjectAnalyticsService)
NewProjectAnalyticsService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type ProjectGetResponseEnvelope ¶ added in v0.6.0
type ProjectGetResponseEnvelope struct {
// Data contains the response object
Data Project `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r ProjectGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectGetResponseEnvelope) UnmarshalJSON(data []byte) error
type ProjectListResponse ¶ added in v0.6.0
type ProjectListResponse struct {
// Data contains the project items
Data []Project `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing the list of projects for a team
func (ProjectListResponse) RawJSON ¶ added in v0.6.0
func (r ProjectListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectListResponse) UnmarshalJSON(data []byte) error
type ProjectNewParams ¶ added in v0.6.0
type ProjectNewParams struct {
// Name is the name of the project, which must be between 4 and 32 characters.
Name string `json:"name" api:"required"`
// contains filtered or unexported fields
}
func (ProjectNewParams) MarshalJSON ¶ added in v0.6.0
func (r ProjectNewParams) MarshalJSON() (data []byte, err error)
func (*ProjectNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectNewParams) UnmarshalJSON(data []byte) error
type ProjectNewResponseEnvelope ¶ added in v0.6.0
type ProjectNewResponseEnvelope struct {
// Data contains the response object
Data Project `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ProjectNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r ProjectNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ProjectNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectNewResponseEnvelope) UnmarshalJSON(data []byte) error
type ProjectService ¶ added in v0.6.0
type ProjectService struct {
Options []option.RequestOption
Analytics ProjectAnalyticsService
}
ProjectService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProjectService method instead.
func NewProjectService ¶ added in v0.6.0
func NewProjectService(opts ...option.RequestOption) (r ProjectService)
NewProjectService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ProjectService) Delete ¶ added in v0.6.0
func (r *ProjectService) Delete(ctx context.Context, projectID string, opts ...option.RequestOption) (err error)
Delete a project and revoke all associated access tokens. Only team owners can delete projects. Customer output files remain in Storage; managed temporary files retain their original expiry.
func (*ProjectService) Get ¶ added in v0.6.0
func (r *ProjectService) Get(ctx context.Context, projectID string, opts ...option.RequestOption) (res *Project, err error)
Retrieve details of a specific project by its slug
func (*ProjectService) List ¶ added in v0.6.0
func (r *ProjectService) List(ctx context.Context, opts ...option.RequestOption) (res *ProjectListResponse, err error)
Retrieve a list of all projects for a team
func (*ProjectService) New ¶ added in v0.6.0
func (r *ProjectService) New(ctx context.Context, body ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)
Create a new project with the specified name. The project will be created with default Chunkify storage settings.
func (*ProjectService) Update ¶ added in v0.6.0
func (r *ProjectService) Update(ctx context.Context, projectID string, body ProjectUpdateParams, opts ...option.RequestOption) (err error)
Update a project's name or storage settings. Only team owners can update projects.
type ProjectUpdateParams ¶
type ProjectUpdateParams struct {
// DefaultWorkflowId specifies the default Workflow for new Assets. Set null to
// clear it.
DefaultWorkflowID param.Opt[string] `json:"default_workflow_id,omitzero"`
// Project name.
Name param.Opt[string] `json:"name,omitzero"`
// ID of this Project's default Storage.
StorageID param.Opt[string] `json:"storage_id,omitzero"`
// Defaults for new Assets and automatic Uploads. Replaces the whole object.
// Omitted fields reset to their defaults. Existing Assets are unchanged.
AssetDefaults AssetDefaultsParams `json:"asset_defaults,omitzero"`
// contains filtered or unexported fields
}
func (ProjectUpdateParams) MarshalJSON ¶ added in v0.6.0
func (r ProjectUpdateParams) MarshalJSON() (data []byte, err error)
func (*ProjectUpdateParams) UnmarshalJSON ¶ added in v0.6.0
func (r *ProjectUpdateParams) UnmarshalJSON(data []byte) error
type Source ¶
type Source struct {
// Unique identifier of the source
ID string `json:"id" api:"required"`
// Audio bitrate in bits per second
AudioBitrate int64 `json:"audio_bitrate" api:"required"`
// Audio codec used
AudioCodec string `json:"audio_codec" api:"required"`
// Timestamp when the source was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Device used to record the video
Device string `json:"device" api:"required"`
// Duration of the video in seconds
Duration int64 `json:"duration" api:"required"`
// Height of the video in pixels
Height int64 `json:"height" api:"required"`
// Additional metadata for the source
Metadata map[string]string `json:"metadata" api:"required"`
// Size of the source file in bytes
Size int64 `json:"size" api:"required"`
// Video bitrate in bits per second
VideoBitrate int64 `json:"video_bitrate" api:"required"`
// Video codec used
VideoCodec string `json:"video_codec" api:"required"`
// Video framerate in frames per second
VideoFramerate float64 `json:"video_framerate" api:"required"`
// Width of the video in pixels
Width int64 `json:"width" api:"required"`
// Exact object key in the configured bucket, 1 to 1024 UTF-8 bytes. The output
// base_prefix is not added.
Path string `json:"path"`
// Connected Storage belonging to this Project.
StorageID string `json:"storage_id"`
// URL where the source video can be accessed
URL string `json:"url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
AudioCodec respjson.Field
CreatedAt respjson.Field
Device respjson.Field
Duration respjson.Field
Height respjson.Field
Metadata respjson.Field
Size respjson.Field
VideoBitrate respjson.Field
VideoCodec respjson.Field
VideoFramerate respjson.Field
Width respjson.Field
Path respjson.Field
StorageID respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Source) UnmarshalJSON ¶ added in v0.6.0
type SourceCreateStorageParams ¶ added in v1.0.0
type SourceCreateStorageParams struct {
// Exact object key in the configured bucket, 1 to 1024 UTF-8 bytes. The output
// base_prefix is not added.
Path string `json:"path" api:"required"`
// Connected external storage belonging to this project. If omitted, uses the
// project default storage, which must be external. The resolved storage ID is
// saved on the source.
ID param.Opt[string] `json:"id,omitzero"`
// contains filtered or unexported fields
}
The property Path is required.
func (SourceCreateStorageParams) MarshalJSON ¶ added in v1.0.0
func (r SourceCreateStorageParams) MarshalJSON() (data []byte, err error)
func (*SourceCreateStorageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *SourceCreateStorageParams) UnmarshalJSON(data []byte) error
type SourceGetResponseEnvelope ¶ added in v0.6.0
type SourceGetResponseEnvelope struct {
// Data contains the response object
Data Source `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SourceGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r SourceGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*SourceGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *SourceGetResponseEnvelope) UnmarshalJSON(data []byte) error
type SourceListParams ¶
type SourceListParams struct {
// Filter by source ID
ID param.Opt[string] `query:"id,omitzero" json:"-"`
// Filter by audio codec
AudioCodec param.Opt[string] `query:"audio_codec,omitzero" json:"-"`
// Pagination limit (max 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Pagination offset
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter by input 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 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. Repeat key:value pairs to match all supplied metadata
// conditions.
Metadata []string `query:"metadata,omitzero" json:"-"`
Size SourceListParamsSize `query:"size,omitzero" json:"-"`
Width SourceListParamsWidth `query:"width,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SourceListParams) URLQuery ¶ added in v0.6.0
func (r SourceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SourceListParams's query parameters as `url.Values`.
type SourceListParamsCreated ¶ added in v0.6.0
type SourceListParamsCreated struct {
// Filter by creation date greater than or equal (UNIX epoch time)
Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
// Filter by creation date less than or equal (UNIX epoch time)
Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
// Sort by creation date (asc/desc)
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SourceListParamsCreated) URLQuery ¶ added in v0.6.0
func (r SourceListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes SourceListParamsCreated's query parameters as `url.Values`.
type SourceListParamsDevice ¶ added in v0.6.0
type SourceListParamsDevice string
Filter by device (apple/android)
const ( SourceListParamsDeviceApple SourceListParamsDevice = "apple" SourceListParamsDeviceAndroid SourceListParamsDevice = "android" SourceListParamsDeviceUnknown SourceListParamsDevice = "unknown" )
type SourceListParamsDuration ¶ added in v0.6.0
type SourceListParamsDuration struct {
// Filter by exact duration
Eq param.Opt[float64] `query:"eq,omitzero" json:"-"`
// Filter by duration greater than
Gt param.Opt[float64] `query:"gt,omitzero" json:"-"`
// Filter by duration greater than or equal
Gte param.Opt[float64] `query:"gte,omitzero" json:"-"`
// Filter by duration less than
Lt param.Opt[float64] `query:"lt,omitzero" json:"-"`
// Filter by duration less than or equal
Lte param.Opt[float64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SourceListParamsDuration) URLQuery ¶ added in v0.6.0
func (r SourceListParamsDuration) URLQuery() (v url.Values, err error)
URLQuery serializes SourceListParamsDuration's query parameters as `url.Values`.
type SourceListParamsHeight ¶ added in v0.6.0
type SourceListParamsHeight struct {
// Filter by exact height
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by height greater than
Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
// Filter by height greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by height less than
Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
// Filter by height less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SourceListParamsHeight) URLQuery ¶ added in v0.6.0
func (r SourceListParamsHeight) URLQuery() (v url.Values, err error)
URLQuery serializes SourceListParamsHeight's query parameters as `url.Values`.
type SourceListParamsSize ¶ added in v0.6.0
type SourceListParamsSize struct {
// Filter by exact file size
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by file size greater than
Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
// Filter by file size greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by file size less than
Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
// Filter by file size less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SourceListParamsSize) URLQuery ¶ added in v0.6.0
func (r SourceListParamsSize) URLQuery() (v url.Values, err error)
URLQuery serializes SourceListParamsSize's query parameters as `url.Values`.
type SourceListParamsWidth ¶ added in v0.6.0
type SourceListParamsWidth struct {
// Filter by exact width
Eq param.Opt[int64] `query:"eq,omitzero" json:"-"`
// Filter by width greater than
Gt param.Opt[int64] `query:"gt,omitzero" json:"-"`
// Filter by width greater than or equal
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Filter by width less than
Lt param.Opt[int64] `query:"lt,omitzero" json:"-"`
// Filter by width less than or equal
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (SourceListParamsWidth) URLQuery ¶ added in v0.6.0
func (r SourceListParamsWidth) URLQuery() (v url.Values, err error)
URLQuery serializes SourceListParamsWidth's query parameters as `url.Values`.
type SourceNewParams ¶ added in v0.6.0
type SourceNewParams struct {
// Url is the URL of the source, which must be a valid HTTP URL.
URL param.Opt[string] `json:"url,omitzero" format:"http-url"`
// Metadata allows for additional information to be attached to the source, with a
// maximum size of 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Storage input configuration. Provide this or url, never both.
Storage SourceCreateStorageParams `json:"storage,omitzero"`
// contains filtered or unexported fields
}
func (SourceNewParams) MarshalJSON ¶ added in v0.6.0
func (r SourceNewParams) MarshalJSON() (data []byte, err error)
func (*SourceNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *SourceNewParams) UnmarshalJSON(data []byte) error
type SourceNewResponseEnvelope ¶ added in v0.6.0
type SourceNewResponseEnvelope struct {
// Data contains the response object
Data Source `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SourceNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r SourceNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*SourceNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *SourceNewResponseEnvelope) UnmarshalJSON(data []byte) error
type SourceService ¶ added in v0.6.0
type SourceService struct {
Options []option.RequestOption
}
SourceService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSourceService method instead.
func NewSourceService ¶ added in v0.6.0
func NewSourceService(opts ...option.RequestOption) (r SourceService)
NewSourceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SourceService) Delete ¶ added in v0.6.0
func (r *SourceService) Delete(ctx context.Context, sourceID string, opts ...option.RequestOption) (err error)
Delete a source. It will fail if there are processing jobs using this source.
func (*SourceService) Get ¶ added in v0.6.0
func (r *SourceService) Get(ctx context.Context, sourceID string, opts ...option.RequestOption) (res *Source, err error)
Retrieve details of a specific source by its ID, including metadata, media properties, and associated jobs.
func (*SourceService) List ¶ added in v0.6.0
func (r *SourceService) List(ctx context.Context, query SourceListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Source], err error)
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
func (r *SourceService) ListAutoPaging(ctx context.Context, query SourceListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Source]
Retrieve a list of all sources with optional filtering and pagination. Supports filtering by various media properties like duration, dimensions, codecs, etc.
func (*SourceService) New ¶ added in v0.6.0
func (r *SourceService) New(ctx context.Context, body SourceNewParams, opts ...option.RequestOption) (res *Source, err error)
Create a new source from a media URL. The source will be analyzed to extract metadata and generate a thumbnail. The source will be automatically deleted after the data retention period.
type StorageAws ¶ added in v0.6.0
type StorageAws struct {
// Unique identifier of the storage configuration
ID string `json:"id" api:"required"`
// Canonical object-key prefix prepended to every final job output in this
// customer-owned storage. An empty string means the bucket root.
BasePrefix string `json:"base_prefix" api:"required"`
// Bucket is the name of the storage bucket.
Bucket string `json:"bucket" api:"required"`
// Created at timestamp
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Provider specifies the storage provider.
Provider constant.Aws `json:"provider" default:"aws"`
// Public indicates whether the storage is publicly accessible.
Public bool `json:"public" api:"required"`
// Region specifies the region of the storage provider.
//
// Any of "us-east-1", "us-east-2", "us-central-1", "us-west-1", "us-west-2",
// "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "eu-north-1",
// "ap-east-1", "ap-east-2", "ap-northeast-1", "ap-northeast-2", "ap-south-1",
// "ap-southeast-1", "ap-southeast-2".
Region AwsRegion `json:"region" api:"required"`
// Unique identifier of the storage configuration
Slug string `json:"slug" api:"required"`
// Optional customer-managed HTTPS delivery base URL used to build stable CDN URLs
// for objects in this storage.
CdnBaseURL string `json:"cdn_base_url" api:"nullable" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BasePrefix respjson.Field
Bucket respjson.Field
CreatedAt respjson.Field
Provider respjson.Field
Public respjson.Field
Region respjson.Field
Slug respjson.Field
CdnBaseURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StorageAws) RawJSON ¶ added in v0.6.0
func (r StorageAws) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageAws) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageAws) UnmarshalJSON(data []byte) error
type StorageAwsCreateParams ¶ added in v1.0.0
type StorageAwsCreateParams struct {
// AccessKeyId is the access key for the storage provider. Required if not using
// Chunkify storage.
AccessKeyID string `json:"access_key_id" api:"required"`
// Bucket is the name of the storage bucket.
Bucket string `json:"bucket" api:"required"`
// Region specifies the region of the storage provider.
//
// Any of "us-east-1", "us-east-2", "us-central-1", "us-west-1", "us-west-2",
// "eu-west-1", "eu-west-2", "eu-west-3", "eu-central-1", "eu-north-1",
// "ap-east-1", "ap-east-2", "ap-northeast-1", "ap-northeast-2", "ap-south-1",
// "ap-southeast-1", "ap-southeast-2".
Region AwsRegion `json:"region,omitzero" api:"required"`
// SecretAccessKey is the secret key for the storage provider. Required if not
// using Chunkify storage.
SecretAccessKey string `json:"secret_access_key" api:"required"`
// Optional customer-managed HTTPS delivery base URL. Object keys are appended to
// it. It may include a path prefix, but must not contain credentials, a query
// string, or a fragment.
CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
// Object-key prefix for final job outputs. The API normalizes it without a leading
// slash and with one trailing slash. Omit it or send an empty string to use the
// bucket root.
BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
// Public indicates whether the storage is publicly accessible.
Public param.Opt[bool] `json:"public,omitzero"`
// Provider specifies the storage provider.
//
// This field can be elided, and will marshal its zero value as "aws".
Provider constant.Aws `json:"provider" default:"aws"`
// contains filtered or unexported fields
}
Storage parameters for AWS S3 storage.
The properties AccessKeyID, Bucket, Provider, Region, SecretAccessKey are required.
func (StorageAwsCreateParams) MarshalJSON ¶ added in v1.0.0
func (r StorageAwsCreateParams) MarshalJSON() (data []byte, err error)
func (*StorageAwsCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *StorageAwsCreateParams) UnmarshalJSON(data []byte) error
type StorageChunkify ¶ added in v0.6.0
type StorageChunkify struct {
// Unique identifier of the storage configuration
ID string `json:"id" api:"required"`
// Created at timestamp
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Provider specifies the storage provider.
Provider constant.Chunkify `json:"provider" default:"chunkify"`
// Region specifies the region of the storage provider.
//
// Any of "us-east-1", "us-east-2", "us-west-1", "us-west-2", "eu-west-1",
// "eu-west-2", "ap-northeast-1", "ap-southeast-1".
Region ChunkifyRegion `json:"region" api:"required"`
// Unique identifier of the storage configuration
Slug string `json:"slug" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Provider respjson.Field
Region respjson.Field
Slug respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StorageChunkify) RawJSON ¶ added in v0.6.0
func (r StorageChunkify) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageChunkify) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageChunkify) UnmarshalJSON(data []byte) error
type StorageChunkifyCreateParams ¶ added in v1.0.0
type StorageChunkifyCreateParams 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 ChunkifyRegion `json:"region,omitzero" api:"required"`
// Unsupported for Chunkify-managed temporary storage. Requests that provide this
// field are rejected.
CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
// Provider specifies the storage provider.
//
// This field can be elided, and will marshal its zero value as "chunkify".
Provider constant.Chunkify `json:"provider" default:"chunkify"`
// contains filtered or unexported fields
}
Storage parameters for Chunkify ephemeral storage.
The properties Provider, Region are required.
func (StorageChunkifyCreateParams) MarshalJSON ¶ added in v1.0.0
func (r StorageChunkifyCreateParams) MarshalJSON() (data []byte, err error)
func (*StorageChunkifyCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *StorageChunkifyCreateParams) UnmarshalJSON(data []byte) error
type StorageCloudflare ¶ added in v0.6.0
type StorageCloudflare struct {
// Unique identifier of the storage configuration
ID string `json:"id" api:"required"`
// Canonical object-key prefix prepended to every final job output in this
// customer-owned storage. An empty string means the bucket root.
BasePrefix string `json:"base_prefix" api:"required"`
// Bucket is the name of the storage bucket.
Bucket string `json:"bucket" api:"required"`
// Created at timestamp
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Endpoint is the endpoint of the storage provider.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Location specifies the location of the storage provider.
//
// Any of "US", "EU", "ASIA".
Location StorageLocation `json:"location" api:"required"`
// Provider specifies the storage provider.
Provider constant.Cloudflare `json:"provider" default:"cloudflare"`
// Public indicates whether the storage is publicly accessible.
Public bool `json:"public" api:"required"`
// Region specifies the region of the storage provider.
Region constant.Auto `json:"region" default:"auto"`
// Unique identifier of the storage configuration
Slug string `json:"slug" api:"required"`
// Optional customer-managed HTTPS delivery base URL used to build stable CDN URLs
// for objects in this storage.
CdnBaseURL string `json:"cdn_base_url" api:"nullable" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
BasePrefix respjson.Field
Bucket respjson.Field
CreatedAt respjson.Field
Endpoint respjson.Field
Location respjson.Field
Provider respjson.Field
Public respjson.Field
Region respjson.Field
Slug respjson.Field
CdnBaseURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StorageCloudflare) RawJSON ¶ added in v0.6.0
func (r StorageCloudflare) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageCloudflare) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageCloudflare) UnmarshalJSON(data []byte) error
type StorageCloudflareCreateParams ¶ added in v1.0.0
type StorageCloudflareCreateParams struct {
// AccessKeyId is the access key for the storage provider.
AccessKeyID string `json:"access_key_id" api:"required"`
// Bucket is the name of the storage bucket.
Bucket string `json:"bucket" api:"required"`
// Endpoint is the endpoint of the storage provider.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Location specifies the location of the storage provider.
//
// Any of "US", "EU", "ASIA".
Location StorageCloudflareCreateParamsLocation `json:"location,omitzero" api:"required"`
// SecretAccessKey is the secret key for the storage provider.
SecretAccessKey string `json:"secret_access_key" api:"required"`
// Optional customer-managed HTTPS delivery base URL. Object keys are appended to
// it. It may include a path prefix, but must not contain credentials, a query
// string, or a fragment.
CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
// Object-key prefix for final job outputs. The API normalizes it without a leading
// slash and with one trailing slash. Omit it or send an empty string to use the
// bucket root.
BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
// Public indicates whether the storage is publicly accessible.
Public param.Opt[bool] `json:"public,omitzero"`
// Provider specifies the storage provider.
//
// This field can be elided, and will marshal its zero value as "cloudflare".
Provider constant.Cloudflare `json:"provider" default:"cloudflare"`
// Region must be set to 'auto'.
//
// This field can be elided, and will marshal its zero value as "auto".
Region constant.Auto `json:"region" default:"auto"`
// contains filtered or unexported fields
}
Storage parameters for Cloudflare R2 storage.
The properties AccessKeyID, Bucket, Endpoint, Location, Provider, Region, SecretAccessKey are required.
func (StorageCloudflareCreateParams) MarshalJSON ¶ added in v1.0.0
func (r StorageCloudflareCreateParams) MarshalJSON() (data []byte, err error)
func (*StorageCloudflareCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *StorageCloudflareCreateParams) UnmarshalJSON(data []byte) error
type StorageCloudflareCreateParamsLocation ¶ added in v1.0.0
type StorageCloudflareCreateParamsLocation string
Location specifies the location of the storage provider.
const ( StorageCloudflareCreateParamsLocationUs StorageCloudflareCreateParamsLocation = "US" StorageCloudflareCreateParamsLocationEu StorageCloudflareCreateParamsLocation = "EU" StorageCloudflareCreateParamsLocationAsia StorageCloudflareCreateParamsLocation = "ASIA" )
type StorageGetResponseEnvelope ¶ added in v0.6.0
type StorageGetResponseEnvelope struct {
// Data contains the response object
Data StorageUnion `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StorageGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r StorageGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageGetResponseEnvelope) UnmarshalJSON(data []byte) error
type StorageListResponse ¶ added in v0.6.0
type StorageListResponse struct {
// Data contains the storage items
Data []StorageUnion `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing the list of storages configurations for a project
func (StorageListResponse) RawJSON ¶ added in v0.6.0
func (r StorageListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageListResponse) UnmarshalJSON(data []byte) error
type StorageLocation ¶ added in v1.0.0
type StorageLocation string
Location specifies the location of the storage provider.
const ( StorageLocationUs StorageLocation = "US" StorageLocationEu StorageLocation = "EU" StorageLocationAsia StorageLocation = "ASIA" )
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 *StorageAwsCreateParams `json:",inline"`
// This field is a request body variant, only one variant field can be set. Storage
// parameters for Chunkify ephemeral storage.
OfChunkify *StorageChunkifyCreateParams `json:",inline"`
// This field is a request body variant, only one variant field can be set. Storage
// parameters for Cloudflare R2 storage.
OfCloudflare *StorageCloudflareCreateParams `json:",inline"`
// This field is a request body variant, only one variant field can be set. Storage
// parameters for a public S3-compatible service such as MinIO, Wasabi, or
// Backblaze B2.
OfS3Compatible *StorageS3CompatibleCreateParams `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 StorageNewResponseEnvelope ¶ added in v0.6.0
type StorageNewResponseEnvelope struct {
// Data contains the response object
Data StorageUnion `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (StorageNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r StorageNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageNewResponseEnvelope) UnmarshalJSON(data []byte) error
type StorageS3Compatible ¶ added in v0.16.3
type StorageS3Compatible struct {
// Unique identifier of the storage configuration
ID string `json:"id" api:"required"`
// Addressing style detected during connection validation and used for later S3
// operations.
//
// Any of "virtual", "path".
AddressingStyle StorageS3CompatibleAddressingStyle `json:"addressing_style" api:"required"`
// Canonical object-key prefix prepended to every final job output in this
// customer-owned storage. An empty string means the bucket root.
BasePrefix string `json:"base_prefix" api:"required"`
// Bucket is the name of the storage bucket.
Bucket string `json:"bucket" api:"required"`
// Created at timestamp
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Public HTTPS URL of the S3-compatible service, including any fixed path prefix
// the service requires. Credentials, queries, fragments, and non-public
// destinations are rejected.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Chunkify workload location. This is independent from the provider signing
// region.
//
// Any of "US", "EU", "ASIA".
Location StorageLocation `json:"location" api:"required"`
// Stable provider identifier for generic S3-compatible storage.
Provider constant.S3Compatible `json:"provider" default:"s3_compatible"`
// Public indicates whether the storage is publicly accessible.
Public bool `json:"public" api:"required"`
// Provider region used for S3 request signing. This is independent from the
// Chunkify workload location.
Region string `json:"region" api:"required"`
// Unique identifier of the storage configuration
Slug string `json:"slug" api:"required"`
// Optional customer-managed HTTPS delivery base URL used to build stable CDN URLs
// for objects in this storage.
CdnBaseURL string `json:"cdn_base_url" api:"nullable" format:"uri"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AddressingStyle respjson.Field
BasePrefix respjson.Field
Bucket respjson.Field
CreatedAt respjson.Field
Endpoint respjson.Field
Location respjson.Field
Provider respjson.Field
Public respjson.Field
Region respjson.Field
Slug respjson.Field
CdnBaseURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A customer-owned storage connection using the standard S3 API.
func (StorageS3Compatible) RawJSON ¶ added in v0.16.3
func (r StorageS3Compatible) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageS3Compatible) UnmarshalJSON ¶ added in v0.16.3
func (r *StorageS3Compatible) UnmarshalJSON(data []byte) error
type StorageS3CompatibleAddressingStyle ¶ added in v1.0.0
type StorageS3CompatibleAddressingStyle string
Addressing style detected during connection validation and used for later S3 operations.
const ( StorageS3CompatibleAddressingStyleVirtual StorageS3CompatibleAddressingStyle = "virtual" StorageS3CompatibleAddressingStylePath StorageS3CompatibleAddressingStyle = "path" )
type StorageS3CompatibleCreateParams ¶ added in v1.0.0
type StorageS3CompatibleCreateParams struct {
// Access key for the storage provider.
AccessKeyID string `json:"access_key_id" api:"required"`
// Bucket is the name of the storage bucket.
Bucket string `json:"bucket" api:"required"`
// Public HTTPS URL of the S3-compatible service, including any fixed path prefix
// the service requires. Credentials, queries, fragments, and non-public
// destinations are rejected.
Endpoint string `json:"endpoint" api:"required" format:"uri"`
// Chunkify workload location. It controls where Chunkify processes the workload
// and is independent from the provider region.
//
// Any of "US", "EU", "ASIA".
Location StorageLocation `json:"location,omitzero" api:"required"`
// Explicit provider region used for S3 request signing. Vendor-specific
// identifiers are accepted.
Region string `json:"region" api:"required"`
// Secret key for the storage provider.
SecretAccessKey string `json:"secret_access_key" api:"required"`
// Optional customer-managed HTTPS delivery base URL. Object keys are appended to
// it. It may include a path prefix, but must not contain credentials, a query
// string, or a fragment.
CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
// Object-key prefix for final job outputs. The API normalizes it without a leading
// slash and with one trailing slash. Omit it or send an empty string to use the
// bucket root.
BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
// Whether the bucket is publicly readable.
Public param.Opt[bool] `json:"public,omitzero"`
// Stable provider identifier for generic S3-compatible storage.
//
// This field can be elided, and will marshal its zero value as "s3_compatible".
Provider constant.S3Compatible `json:"provider" default:"s3_compatible"`
// contains filtered or unexported fields
}
Storage parameters for a public S3-compatible service such as MinIO, Wasabi, or Backblaze B2.
The properties AccessKeyID, Bucket, Endpoint, Location, Provider, Region, SecretAccessKey are required.
func (StorageS3CompatibleCreateParams) MarshalJSON ¶ added in v1.0.0
func (r StorageS3CompatibleCreateParams) MarshalJSON() (data []byte, err error)
func (*StorageS3CompatibleCreateParams) UnmarshalJSON ¶ added in v1.0.0
func (r *StorageS3CompatibleCreateParams) 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 attached to the project or used by an upload, source, asset, transcoding or thumbnail; otherwise the request returns 403.
func (*StorageService) Get ¶ added in v0.6.0
func (r *StorageService) Get(ctx context.Context, storageID string, opts ...option.RequestOption) (res *StorageUnion, err error)
Retrieve details of a specific storage configuration by its id.
func (*StorageService) List ¶ added in v0.6.0
func (r *StorageService) List(ctx context.Context, opts ...option.RequestOption) (res *StorageListResponse, err error)
Retrieve a list of all storage configurations for the current project.
func (*StorageService) New ¶ added in v0.6.0
func (r *StorageService) New(ctx context.Context, body StorageNewParams, opts ...option.RequestOption) (res *StorageUnion, err error)
Create a new storage configuration for cloud storage providers like AWS S3, Cloudflare R2, etc. The storage credentials will be validated before saving.
func (*StorageService) Update ¶ added in v0.16.2
func (r *StorageService) Update(ctx context.Context, storageID string, body StorageUpdateParams, opts ...option.RequestOption) (err error)
Update customer-owned storage settings. Send access_key_id and secret_access_key together to rotate credentials for AWS S3, Cloudflare R2, or S3-compatible storage. Both values must be non-empty and non-null. Omitting both preserves the saved pair and skips connection validation. Replacement credentials are checked against the saved bucket, endpoint, region, and addressing style using the creation upload, metadata, and download checks with best-effort probe cleanup. A prefix changed in the same request is used for validation. Both credentials are encrypted and saved atomically with other settings; a failed update preserves the previous values. Credential-only updates keep the Storage ID, resource associations, object paths, and Project default. Subsequent storage lookups use the new pair; running work may retain an existing client or signed URL. Rotation does not renew issued URLs, and revoking old keys can invalidate them. Prefix changes apply to final outputs that have not been uploaded yet. Existing files keep their stored object keys.
type StorageUnion ¶ added in v0.6.0
type StorageUnion struct {
ID string `json:"id"`
CreatedAt time.Time `json:"created_at"`
// Any of "chunkify", "cloudflare", "aws", "s3_compatible".
Provider string `json:"provider"`
Region string `json:"region"`
Slug string `json:"slug"`
BasePrefix string `json:"base_prefix"`
Bucket string `json:"bucket"`
Endpoint string `json:"endpoint"`
// This field is from variant [StorageCloudflare].
Location StorageLocation `json:"location"`
Public bool `json:"public"`
CdnBaseURL string `json:"cdn_base_url"`
// This field is from variant [StorageS3Compatible].
AddressingStyle StorageS3CompatibleAddressingStyle `json:"addressing_style"`
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Provider respjson.Field
Region respjson.Field
Slug respjson.Field
BasePrefix respjson.Field
Bucket respjson.Field
Endpoint respjson.Field
Location respjson.Field
Public respjson.Field
CdnBaseURL respjson.Field
AddressingStyle respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
StorageUnion contains all possible properties and values from StorageChunkify, StorageCloudflare, StorageAws, StorageS3Compatible.
Use the StorageUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (StorageUnion) AsAny ¶ added in v0.6.0
func (u StorageUnion) AsAny() anyStorage
Use the following switch statement to find the correct variant
switch variant := StorageUnion.AsAny().(type) {
case chunkify.StorageChunkify:
case chunkify.StorageCloudflare:
case chunkify.StorageAws:
case chunkify.StorageS3Compatible:
default:
fmt.Errorf("no variant present")
}
func (StorageUnion) AsAws ¶ added in v0.6.0
func (u StorageUnion) AsAws() (v StorageAws)
func (StorageUnion) AsChunkify ¶ added in v0.6.0
func (u StorageUnion) AsChunkify() (v StorageChunkify)
func (StorageUnion) AsCloudflare ¶ added in v0.6.0
func (u StorageUnion) AsCloudflare() (v StorageCloudflare)
func (StorageUnion) AsS3Compatible ¶ added in v0.16.3
func (u StorageUnion) AsS3Compatible() (v StorageS3Compatible)
func (StorageUnion) RawJSON ¶ added in v0.6.0
func (u StorageUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*StorageUnion) UnmarshalJSON ¶ added in v0.6.0
func (r *StorageUnion) UnmarshalJSON(data []byte) error
type StorageUpdateParams ¶ added in v0.16.2
type StorageUpdateParams struct {
// Customer-managed HTTPS delivery base URL, or null to remove the current value.
CdnBaseURL param.Opt[string] `json:"cdn_base_url,omitzero" format:"uri"`
// Replacement access key ID for customer-managed storage. Send with a non-empty
// secret_access_key. Omit both credential fields to keep the saved pair. Null and
// empty values are rejected. Credentials are validated before either value is
// saved and are never returned.
AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
// Object-key prefix for future final job outputs. Existing files keep their stored
// object keys. Send an empty string to use the bucket root.
BasePrefix param.Opt[string] `json:"base_prefix,omitzero"`
// Replacement secret access key. Required with access_key_id; cannot be null or
// empty. The pair is encrypted and saved atomically only after validation
// succeeds.
SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
// contains filtered or unexported fields
}
func (StorageUpdateParams) MarshalJSON ¶ added in v0.16.2
func (r StorageUpdateParams) MarshalJSON() (data []byte, err error)
func (*StorageUpdateParams) UnmarshalJSON ¶ added in v0.16.2
func (r *StorageUpdateParams) UnmarshalJSON(data []byte) error
type Thumbnail ¶ added in v0.17.0
type Thumbnail struct {
// Id identifies this thumbnail request. Standalone requests use thm* IDs;
// Asset-owned outputs use aop* IDs.
ID string `json:"id" api:"required"`
// AssetId identifies the owning Asset for Workflow outputs, or null for standalone
// requests.
AssetID string `json:"asset_id" api:"required"`
// CreatedAt records when the request was accepted.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Files contains all published images or sheets and the WebVTT index. Empty while
// preparing.
Files []ThumbnailFile `json:"files" api:"required"`
// Metadata contains the accepted string metadata.
Metadata map[string]string `json:"metadata" api:"required"`
// Samples contains published thumbnails ordered by timestamp. Empty while
// preparing. A ready resource may contain fewer samples than requested.
Samples []ThumbnailSample `json:"samples" api:"required"`
// Settings contains the accepted sampling and output settings.
Settings ThumbnailSettings `json:"settings" api:"required"`
// SourceId identifies the input Source, or null if it has been deleted.
SourceID string `json:"source_id" api:"required"`
// Status reports processing or output expiry.
//
// Any of "preparing", "ready", "failed", "expired".
Status ThumbnailStatus `json:"status" api:"required"`
// StorageId identifies the accepted output Storage.
StorageID string `json:"storage_id" api:"required"`
// StoragePath specifies the accepted filename template relative to the Storage
// base_prefix, or null when Chunkify generated the file names.
StoragePath string `json:"storage_path" api:"required"`
// StoragePrefix specifies the complete output folder saved at creation. File and
// sample paths are relative to this folder.
StoragePrefix string `json:"storage_prefix" api:"required"`
// UpdatedAt records the last lifecycle update.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// CreatedByTokenId specifies the Project token used to create the resource. It
// remains set after the token is revoked. Omitted for dashboard requests, MCP
// OAuth connections, Workflow actions, and unknown creators.
CreatedByTokenID string `json:"created_by_token_id"`
// CreatedByUserId specifies the team member who created the resource. Omitted for
// Workflow actions, unknown creators, and deleted accounts.
CreatedByUserID string `json:"created_by_user_id"`
// CreatedVia specifies how the resource was created: api for API requests,
// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
// Workflow actions. Omitted when the creator is unknown.
//
// Any of "api", "dashboard", "mcp", "workflow".
CreatedVia shared.CreatedVia `json:"created_via"`
// DeleteAt specifies when this standalone request is deleted: three days after its
// temporary output expires, otherwise when the team's data retention period ends,
// counted from when the request was accepted, and no sooner than three days after
// it finished. It does not delete files in customer-owned Storage. Omitted while
// preparing and for Asset-owned thumbnails, which follow their Asset.
DeleteAt time.Time `json:"delete_at" format:"date-time"`
// Error explains a failed request. Omitted otherwise.
Error ThumbnailError `json:"error"`
// ExpiresAt specifies when temporary output files expire. Omitted for customer
// output Storage.
ExpiresAt time.Time `json:"expires_at" format:"date-time"`
// ReadyAt records when the complete available set was published. Omitted before
// publication.
ReadyAt time.Time `json:"ready_at" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AssetID respjson.Field
CreatedAt respjson.Field
Files respjson.Field
Metadata respjson.Field
Samples respjson.Field
Settings respjson.Field
SourceID respjson.Field
Status respjson.Field
StorageID respjson.Field
StoragePath respjson.Field
StoragePrefix respjson.Field
UpdatedAt respjson.Field
CreatedByTokenID respjson.Field
CreatedByUserID respjson.Field
CreatedVia respjson.Field
DeleteAt respjson.Field
Error respjson.Field
ExpiresAt respjson.Field
ReadyAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One thumbnail generation request. At least one sample and its companion files must be published before the resource is ready.
func (*Thumbnail) UnmarshalJSON ¶ added in v0.17.0
type ThumbnailCreateStorageParams ¶ added in v1.0.0
type ThumbnailCreateStorageParams struct {
// Id identifies output Storage in this Project. Omit to use the Project default.
ID param.Opt[string] `json:"id,omitzero"`
// Path specifies the output filename template relative to the selected Storage
// base_prefix. Required for customer storage; generated for Chunkify temporary
// storage. The filename must contain one %05d placeholder, replaced by the image
// or sprite sheet number starting at 1, and end in .jpg for jpeg or .webp for
// webp. The WebVTT file uses the filename without the placeholder and its adjacent
// separator, such as thumb.vtt for thumb-%05d.jpg. The combined path may contain
// at most 1024 bytes.
Path param.Opt[string] `json:"path,omitzero"`
// contains filtered or unexported fields
}
Output Storage selection, independent of Source storage.
func (ThumbnailCreateStorageParams) MarshalJSON ¶ added in v1.0.0
func (r ThumbnailCreateStorageParams) MarshalJSON() (data []byte, err error)
func (*ThumbnailCreateStorageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *ThumbnailCreateStorageParams) UnmarshalJSON(data []byte) error
type ThumbnailCrop ¶ added in v1.0.0
type ThumbnailCrop struct {
// X specifies the left edge in pixels.
X int64 `json:"x" api:"required"`
// Y specifies the top edge in pixels.
Y int64 `json:"y" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
X respjson.Field
Y respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The image rectangle within a sprite sheet.
func (ThumbnailCrop) RawJSON ¶ added in v1.0.0
func (r ThumbnailCrop) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailCrop) UnmarshalJSON ¶ added in v1.0.0
func (r *ThumbnailCrop) UnmarshalJSON(data []byte) error
type ThumbnailDeleteParams ¶ added in v0.17.0
type ThumbnailDeleteParams struct {
// DeleteFiles specifies whether to permanently delete this Thumbnail's owned
// images, sprite sheets, VTT and partial outputs at their saved storage prefix.
// Defaults to false. The Source and unrelated files are preserved. If deletion
// fails, records remain for retry, but some files may already be deleted.
// Temporary outputs still expire when this option is false.
DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ThumbnailDeleteParams) URLQuery ¶ added in v0.17.0
func (r ThumbnailDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes ThumbnailDeleteParams's query parameters as `url.Values`.
type ThumbnailError ¶ added in v0.17.0
type ThumbnailError struct {
// Code identifies the processing failure.
Code string `json:"code" api:"required"`
// Message explains the processing failure.
Message string `json:"message" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A customer-facing processing failure.
func (ThumbnailError) RawJSON ¶ added in v0.17.0
func (r ThumbnailError) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailError) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailError) UnmarshalJSON(data []byte) error
type ThumbnailFile ¶ added in v0.17.0
type ThumbnailFile struct {
// Kind identifies an individual image, sprite sheet, or WebVTT index.
//
// Any of "image", "sprite", "vtt".
Kind ThumbnailFileKind `json:"kind" api:"required"`
// Path specifies the file relative to storage_prefix.
Path string `json:"path" api:"required"`
// Size specifies the measured encoded file size in bytes.
Size int64 `json:"size" api:"required"`
// CdnUrl provides delivery through the configured CDN. Omitted without a CDN or
// after expiry.
CdnURL string `json:"cdn_url"`
// Height specifies the measured image or complete sprite canvas height. Omitted
// for WebVTT.
Height int64 `json:"height"`
// Url provides temporary authorized delivery. Omitted after expiry or when
// unavailable.
URL string `json:"url"`
// Width specifies the measured image or complete sprite canvas width. Omitted for
// WebVTT.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Kind respjson.Field
Path respjson.Field
Size respjson.Field
CdnURL respjson.Field
Height respjson.Field
URL respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One published image, sprite sheet, or WebVTT file.
func (ThumbnailFile) RawJSON ¶ added in v0.17.0
func (r ThumbnailFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailFile) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailFile) UnmarshalJSON(data []byte) error
type ThumbnailFileKind ¶ added in v1.0.0
type ThumbnailFileKind string
Kind identifies an individual image, sprite sheet, or WebVTT index.
const ( ThumbnailFileKindImage ThumbnailFileKind = "image" ThumbnailFileKindSprite ThumbnailFileKind = "sprite" ThumbnailFileKindVtt ThumbnailFileKind = "vtt" )
type ThumbnailFormat ¶ added in v1.0.0
type ThumbnailFormat string
Format specifies the image encoding.
const ( ThumbnailFormatJpeg ThumbnailFormat = "jpeg" ThumbnailFormatWebp ThumbnailFormat = "webp" )
type ThumbnailGetResponseEnvelope ¶ added in v0.17.0
type ThumbnailGetResponseEnvelope struct {
// Data contains the thumbnail resource.
Data Thumbnail `json:"data" api:"required"`
// Status is success for a successful request.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A thumbnail resource response.
func (ThumbnailGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r ThumbnailGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailGetResponseEnvelope) UnmarshalJSON(data []byte) error
type ThumbnailListParams ¶ added in v0.17.0
type ThumbnailListParams struct {
// Id filters by an exact Thumbnail ID. Omit to include all matching resources.
ID param.Opt[string] `query:"id,omitzero" json:"-"`
// Maximum number of Thumbnails to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of Thumbnails to skip.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter Thumbnails linked to this Source. Omit to include Thumbnails from all
// Sources in the Project.
SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
// Filter by output Storage ID.
StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
Created ThumbnailListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by metadata. Repeat key:value pairs to match all supplied metadata
// conditions.
Metadata []string `query:"metadata,omitzero" json:"-"`
// Filter by Thumbnail status.
//
// Any of "preparing", "ready", "failed", "expired".
Status ThumbnailStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ThumbnailListParams) URLQuery ¶ added in v0.17.0
func (r ThumbnailListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ThumbnailListParams's query parameters as `url.Values`.
type ThumbnailListParamsCreated ¶ added in v0.17.0
type ThumbnailListParamsCreated struct {
// Created at or after this Unix timestamp in seconds.
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Created at or before this Unix timestamp in seconds.
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// Creation-time ordering. Defaults to newest first.
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ThumbnailListParamsCreated) URLQuery ¶ added in v0.17.0
func (r ThumbnailListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes ThumbnailListParamsCreated's query parameters as `url.Values`.
type ThumbnailNewParams ¶ added in v0.17.0
type ThumbnailNewParams struct {
// SourceId identifies a video Source in this Project.
SourceID string `json:"source_id" api:"required"`
// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
// selected range.
Count param.Opt[int64] `json:"count,omitzero"`
// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
// cropping or upscaling.
Size param.Opt[int64] `json:"size,omitzero"`
// Format selects JPEG or WebP. Defaults to JPEG.
//
// Any of "jpeg", "webp".
Format ThumbnailFormat `json:"format,omitzero"`
// Metadata attaches string values to this request. The serialized object may
// contain at most 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Output selects images or sprites. Defaults to images.
//
// Any of "images", "sprites".
Output ThumbnailOutput `json:"output,omitzero"`
// Range limits sampling to part of the Source. Defaults to the whole Source
// duration.
Range ThumbnailRangeParams `json:"range,omitzero"`
// Storage overrides the Project output destination and names the output files.
// Source storage remains independent.
Storage ThumbnailCreateStorageParams `json:"storage,omitzero"`
// Timestamps specifies 1 to 100 Source-relative target times in seconds. Every
// time must be within the selected range. Repeated targets produce separate
// outputs.
Timestamps []float64 `json:"timestamps,omitzero"`
// contains filtered or unexported fields
}
func (ThumbnailNewParams) MarshalJSON ¶ added in v0.17.0
func (r ThumbnailNewParams) MarshalJSON() (data []byte, err error)
func (*ThumbnailNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailNewParams) UnmarshalJSON(data []byte) error
type ThumbnailNewResponseEnvelope ¶ added in v0.17.0
type ThumbnailNewResponseEnvelope struct {
// Data contains the thumbnail resource.
Data Thumbnail `json:"data" api:"required"`
// Status is success for a successful request.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A thumbnail resource response.
func (ThumbnailNewResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r ThumbnailNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailNewResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailNewResponseEnvelope) UnmarshalJSON(data []byte) error
type ThumbnailOutput ¶ added in v1.0.0
type ThumbnailOutput string
Output specifies individual images or automatically arranged sprite sheets.
const ( ThumbnailOutputImages ThumbnailOutput = "images" ThumbnailOutputSprites ThumbnailOutput = "sprites" )
type ThumbnailRange ¶ added in v1.0.0
type ThumbnailRange struct {
// End specifies the exclusive upper bound in seconds.
End float64 `json:"end" api:"required"`
// Start specifies the inclusive lower bound in seconds.
Start float64 `json:"start" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
End respjson.Field
Start respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The resolved Source-relative sampling range.
func (ThumbnailRange) RawJSON ¶ added in v1.0.0
func (r ThumbnailRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailRange) UnmarshalJSON ¶ added in v1.0.0
func (r *ThumbnailRange) UnmarshalJSON(data []byte) error
type ThumbnailRangeParams ¶ added in v1.0.0
type ThumbnailRangeParams struct {
// End specifies the exclusive upper bound in seconds. Defaults to the Source
// duration.
End param.Opt[float64] `json:"end,omitzero"`
// Start specifies the inclusive lower bound in seconds. Defaults to zero.
Start param.Opt[float64] `json:"start,omitzero"`
// contains filtered or unexported fields
}
Optional Source-relative sampling boundaries.
func (ThumbnailRangeParams) MarshalJSON ¶ added in v1.0.0
func (r ThumbnailRangeParams) MarshalJSON() (data []byte, err error)
func (*ThumbnailRangeParams) UnmarshalJSON ¶ added in v1.0.0
func (r *ThumbnailRangeParams) UnmarshalJSON(data []byte) error
type ThumbnailSample ¶ added in v0.17.0
type ThumbnailSample struct {
// Height specifies this image or tile height in pixels.
Height int64 `json:"height" api:"required"`
// Path identifies the image or sprite sheet in files.
Path string `json:"path" api:"required"`
// Timestamp specifies the measured Source-relative presentation time of the
// selected frame in seconds. Compatible cached inputs use millisecond timestamps,
// which can select a neighboring frame compared with the original Source.
Timestamp float64 `json:"timestamp" api:"required"`
// Width specifies this image or tile width in pixels.
Width int64 `json:"width" api:"required"`
// Crop specifies the tile origin in its sprite sheet. Omitted for individual
// images; width and height give the tile dimensions.
Crop ThumbnailCrop `json:"crop"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Height respjson.Field
Path respjson.Field
Timestamp respjson.Field
Width respjson.Field
Crop respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One successfully published requested sample. Repeated samples remain separate entries.
func (ThumbnailSample) RawJSON ¶ added in v0.17.0
func (r ThumbnailSample) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailSample) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailSample) UnmarshalJSON(data []byte) error
type ThumbnailService ¶ added in v0.17.0
type ThumbnailService struct {
Options []option.RequestOption
}
ThumbnailService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewThumbnailService method instead.
func NewThumbnailService ¶ added in v0.17.0
func NewThumbnailService(opts ...option.RequestOption) (r ThumbnailService)
NewThumbnailService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ThumbnailService) Delete ¶ added in v0.17.0
func (r *ThumbnailService) Delete(ctx context.Context, thumbnailID string, body ThumbnailDeleteParams, opts ...option.RequestOption) (err error)
Delete a ready, failed or expired Thumbnail after all workers have stopped. The Source and settled usage are preserved. Files remain unless delete_files is true; temporary files retain their original 24-hour expiry. Deletion remains available for inactive teams.
func (*ThumbnailService) Get ¶ added in v0.17.0
func (r *ThumbnailService) Get(ctx context.Context, thumbnailID string, opts ...option.RequestOption) (res *Thumbnail, err error)
Retrieve the accepted settings, published files and current state of one Thumbnail.
func (*ThumbnailService) List ¶ added in v0.17.0
func (r *ThumbnailService) List(ctx context.Context, query ThumbnailListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Thumbnail], err error)
List Thumbnails in the authenticated Project, newest first by default.
func (*ThumbnailService) ListAutoPaging ¶ added in v0.17.0
func (r *ThumbnailService) ListAutoPaging(ctx context.Context, query ThumbnailListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Thumbnail]
List Thumbnails in the authenticated Project, newest first by default.
func (*ThumbnailService) New ¶ added in v0.17.0
func (r *ThumbnailService) New(ctx context.Context, body ThumbnailNewParams, opts ...option.RequestOption) (res *Thumbnail, err error)
Generate individual images or sprite sheets from a Source. Each accepted request creates a new resource. Processing continues after the response.
type ThumbnailSettings ¶ added in v0.17.0
type ThumbnailSettings struct {
// Format specifies the accepted image encoding.
//
// Any of "jpeg", "webp".
Format ThumbnailFormat `json:"format" api:"required"`
// Output specifies the accepted output mode.
//
// Any of "images", "sprites".
Output ThumbnailOutput `json:"output" api:"required"`
// Range contains the accepted sampling boundaries.
Range ThumbnailRange `json:"range" api:"required"`
// Size specifies the accepted maximum image or tile edge in pixels.
Size int64 `json:"size" api:"required"`
// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
// selected range.
Count int64 `json:"count"`
// Timestamps specifies 1 to 100 Source-relative target times in seconds. Every
// time must be within the selected range. Repeated targets produce separate
// outputs.
Timestamps []float64 `json:"timestamps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Format respjson.Field
Output respjson.Field
Range respjson.Field
Size respjson.Field
Count respjson.Field
Timestamps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Accepted sampling and output settings, with defaults resolved.
func (ThumbnailSettings) RawJSON ¶ added in v0.17.0
func (r ThumbnailSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*ThumbnailSettings) UnmarshalJSON ¶ added in v0.17.0
func (r *ThumbnailSettings) UnmarshalJSON(data []byte) error
type ThumbnailStatus ¶ added in v0.17.0
type ThumbnailStatus string
Status is ready only after processing and publication finish. Temporary outputs become expired after their retention period.
const ( ThumbnailStatusPreparing ThumbnailStatus = "preparing" ThumbnailStatusReady ThumbnailStatus = "ready" ThumbnailStatusFailed ThumbnailStatus = "failed" ThumbnailStatusExpired ThumbnailStatus = "expired" )
type Token ¶
type Token struct {
// Unique identifier of the token
ID string `json:"id" api:"required"`
// The actual token value (only returned on creation)
Token string `json:"token" api:"required"`
// Timestamp when the token was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Name given to the token
Name string `json:"name" api:"required"`
// ID of the project this token belongs to
ProjectID string `json:"project_id" api:"required"`
// Access scope of the token
//
// Any of "project", "team".
Scope TokenScope `json:"scope" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Token respjson.Field
CreatedAt respjson.Field
Name respjson.Field
ProjectID respjson.Field
Scope respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Token) UnmarshalJSON ¶ added in v0.6.0
type TokenListResponse ¶ added in v0.6.0
type TokenListResponse struct {
// Data contains the token items
Data []Token `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing the list of all tokens for a team. Including project and team tokens.
func (TokenListResponse) RawJSON ¶ added in v0.6.0
func (r TokenListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*TokenListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *TokenListResponse) UnmarshalJSON(data []byte) error
type TokenNewParams ¶ added in v0.6.0
type TokenNewParams struct {
// Scope specifies the scope of the token, which must be either "team" or
// "project".
//
// Any of "project", "team".
Scope TokenScope `json:"scope,omitzero" api:"required"`
// Name is the name of the token, which can be up to 64 characters long.
Name param.Opt[string] `json:"name,omitzero"`
// ProjectId is required if the scope is set to "project".
ProjectID param.Opt[string] `json:"project_id,omitzero"`
// contains filtered or unexported fields
}
func (TokenNewParams) MarshalJSON ¶ added in v0.6.0
func (r TokenNewParams) MarshalJSON() (data []byte, err error)
func (*TokenNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *TokenNewParams) UnmarshalJSON(data []byte) error
type TokenNewResponseEnvelope ¶ added in v0.6.0
type TokenNewResponseEnvelope struct {
// Data contains the response object
Data Token `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (TokenNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r TokenNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*TokenNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *TokenNewResponseEnvelope) UnmarshalJSON(data []byte) error
type TokenScope ¶ added in v0.6.0
type TokenScope string
const ( TokenScopeProject TokenScope = "project" TokenScopeTeam TokenScope = "team" )
type TokenService ¶ added in v0.6.0
type TokenService struct {
Options []option.RequestOption
}
TokenService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTokenService method instead.
func NewTokenService ¶ added in v0.6.0
func NewTokenService(opts ...option.RequestOption) (r TokenService)
NewTokenService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TokenService) List ¶ added in v0.6.0
func (r *TokenService) List(ctx context.Context, opts ...option.RequestOption) (res *TokenListResponse, err error)
Retrieve a list of all API tokens for your account, including both team-scoped and project-scoped tokens. For each token, the response includes its name, scope, creation date, and usage statistics. The token values are not included in the response for security reasons.
func (*TokenService) New ¶ added in v0.6.0
func (r *TokenService) New(ctx context.Context, body TokenNewParams, opts ...option.RequestOption) (res *Token, err error)
Create a new access token for either account-wide or project-specific access. Project tokens require a valid project slug.
func (*TokenService) Revoke ¶ added in v0.6.0
func (r *TokenService) Revoke(ctx context.Context, tokenID string, opts ...option.RequestOption) (err error)
Revoke an access token by its ID. This action is irreversible and will immediately invalidate the token.
type TranscoderStatus ¶ added in v1.0.0
type TranscoderStatus = shared.TranscoderStatus
This is an alias to an internal type.
type TranscoderStatusStatus ¶ added in v1.0.0
type TranscoderStatusStatus = shared.TranscoderStatusStatus
Current status of the transcoder (starting, transcoding, finished, failed)
This is an alias to an internal type.
type Transcoding ¶ added in v0.17.0
type Transcoding struct {
// Id uniquely identifies the Transcoding.
ID string `json:"id" api:"required"`
// CreatedAt specifies when the request was accepted.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Files contains the published output files and their measured properties, ordered
// by creation time. Empty until publication. Presigned URLs are refreshed on each
// read and included in lifecycle webhooks when available.
Files []TranscodingFile `json:"files" api:"required"`
// Format contains the resolved encoding settings accepted at creation, including
// defaults, dimensions, frame rate and normalized seek and duration. Per-title
// rate control is resolved during processing. Measured media properties are
// available in Files.
Format TranscodingFormat `json:"format" api:"required"`
// Metadata contains the string values attached to the Transcoding.
Metadata map[string]string `json:"metadata" api:"required"`
// Status reports processing or output expiry.
//
// Any of "preparing", "ready", "failed", "cancelled", "expired".
Status TranscodingStatus `json:"status" api:"required"`
// Storage contains the resolved output destination.
Storage TranscodingStorage `json:"storage" api:"required"`
// UpdatedAt specifies when the request was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// CreatedByTokenId specifies the Project token used to create the resource. It
// remains set after the token is revoked. Omitted for dashboard requests, MCP
// OAuth connections, Workflow actions, and unknown creators.
CreatedByTokenID string `json:"created_by_token_id"`
// CreatedByUserId specifies the team member who created the resource. Omitted for
// Workflow actions, unknown creators, and deleted accounts.
CreatedByUserID string `json:"created_by_user_id"`
// CreatedVia specifies how the resource was created: api for API requests,
// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
// Workflow actions. Omitted when the creator is unknown.
//
// Any of "api", "dashboard", "mcp", "workflow".
CreatedVia shared.CreatedVia `json:"created_via"`
// DeleteAt specifies when this record is deleted: three days after its temporary
// output expires, otherwise when the team's data retention period ends, counted
// from when the request was accepted, and no sooner than three days after it
// finished. It does not delete files in customer-owned Storage. Omitted while the
// Transcoding is preparing.
DeleteAt time.Time `json:"delete_at" format:"date-time"`
// Error describes why processing failed. Omitted when no processing error exists.
Error TranscodingError `json:"error"`
// ExpiresAt specifies when temporary output files expire. Omitted for customer
// output Storage and before the Transcoding is ready.
ExpiresAt time.Time `json:"expires_at" format:"date-time"`
// ProcessingStage specifies the current activity while the status is preparing.
// Omitted otherwise.
//
// Any of "queued", "starting", "encoding", "finalizing", "uploading".
ProcessingStage TranscodingProcessingStage `json:"processing_stage"`
// Progress specifies the video encoding percentage. Available once processing
// starts and after the output is ready. Omitted for audio-only output; 100
// requires published output.
Progress float64 `json:"progress"`
// ReadyAt specifies when the output was published. Omitted before the Transcoding
// is ready.
ReadyAt time.Time `json:"ready_at" format:"date-time"`
// SourceId identifies the original Source. Omitted after Source deletion.
SourceID string `json:"source_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Files respjson.Field
Format respjson.Field
Metadata respjson.Field
Status respjson.Field
Storage respjson.Field
UpdatedAt respjson.Field
CreatedByTokenID respjson.Field
CreatedByUserID respjson.Field
CreatedVia respjson.Field
DeleteAt respjson.Field
Error respjson.Field
ExpiresAt respjson.Field
ProcessingStage respjson.Field
Progress respjson.Field
ReadyAt respjson.Field
SourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A standalone file-encoding request with its accepted settings and published files.
func (Transcoding) RawJSON ¶ added in v0.17.0
func (r Transcoding) RawJSON() string
Returns the unmodified JSON received from the API
func (*Transcoding) UnmarshalJSON ¶ added in v0.17.0
func (r *Transcoding) UnmarshalJSON(data []byte) error
type TranscodingCreateFormatParamsUnion ¶ added in v1.0.0
type TranscodingCreateFormatParamsUnion struct {
OfMP4H264 *TranscodingMP4H264Param `json:",omitzero,inline"`
OfMP4H265 *TranscodingMP4H265Param `json:",omitzero,inline"`
OfMP4Av1 *TranscodingMP4Av1Param `json:",omitzero,inline"`
OfWebmVp9 *TranscodingWebmVp9Param `json:",omitzero,inline"`
OfM4aAac *TranscodingM4aAacParam `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (TranscodingCreateFormatParamsUnion) GetAudioBitrate ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetAudioBitrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetAudioSamplerate ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetAudioSamplerate() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetBufsize ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetBufsize() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetCPUUsed ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetCPUUsed() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetChannels ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetChannels() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetCrf ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetCrf() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetDisableAudio ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetDisableAudio() *bool
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetDisableVideo ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetDisableVideo() *bool
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetDuration ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetDuration() *float64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetFramerate ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetFramerate() *float64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetGop ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetGop() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetHeight ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetHeight() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetID ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetLevel ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetLevel() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetMaxrate ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetMaxrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetMinrate ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetMinrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetMovflags ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetMovflags() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetPerTitle ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetPerTitle() *bool
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetPixfmt ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetPixfmt() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetPreset ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetPreset() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetProfilev ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetProfilev() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetQuality ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetQuality() *string
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetSeek ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetSeek() *float64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetVideoBitrate ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetVideoBitrate() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetWidth ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetWidth() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetX264Keyint ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetX264Keyint() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) GetX265Keyint ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) GetX265Keyint() *int64
Returns a pointer to the underlying variant's property, if present.
func (TranscodingCreateFormatParamsUnion) MarshalJSON ¶ added in v1.0.0
func (u TranscodingCreateFormatParamsUnion) MarshalJSON() ([]byte, error)
func (*TranscodingCreateFormatParamsUnion) UnmarshalJSON ¶ added in v1.0.0
func (u *TranscodingCreateFormatParamsUnion) UnmarshalJSON(data []byte) error
type TranscodingCreateStorageParams ¶ added in v1.0.0
type TranscodingCreateStorageParams struct {
// Id specifies a Storage in this Project. Defaults to the Project output storage.
ID param.Opt[string] `json:"id,omitzero"`
// Path specifies the output object path relative to the selected Storage
// base_prefix. Required for customer storage; generated for Chunkify temporary
// storage. The extension must match the resolved output format. The combined path
// may contain at most 1024 bytes.
Path param.Opt[string] `json:"path,omitzero"`
// contains filtered or unexported fields
}
Output storage selection, independent of the Source storage.
func (TranscodingCreateStorageParams) MarshalJSON ¶ added in v1.0.0
func (r TranscodingCreateStorageParams) MarshalJSON() (data []byte, err error)
func (*TranscodingCreateStorageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *TranscodingCreateStorageParams) UnmarshalJSON(data []byte) error
type TranscodingDeleteParams ¶ added in v0.17.0
type TranscodingDeleteParams struct {
// DeleteFiles specifies whether to permanently delete this Transcoding's output
// files at their saved storage paths. Defaults to false. The original Source and
// unrelated files are preserved. If deletion fails, records remain for retry, but
// some files may already be deleted. Managed dashboard images are removed with the
// resource; temporary outputs still expire after 24 hours when this option is
// false.
DeleteFiles param.Opt[bool] `query:"delete_files,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TranscodingDeleteParams) URLQuery ¶ added in v0.17.0
func (r TranscodingDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes TranscodingDeleteParams's query parameters as `url.Values`.
type TranscodingError ¶ added in v0.17.0
type TranscodingError struct {
// Code identifies the processing failure.
Code string `json:"code" api:"required"`
// Message describes the failure without internal worker or provider diagnostics.
Message string `json:"message" api:"required"`
// Stage identifies where processing failed.
//
// Any of "queued", "starting", "encoding", "finalizing", "uploading".
Stage TranscodingProcessingStage `json:"stage" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Message respjson.Field
Stage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A customer-facing Transcoding processing failure.
func (TranscodingError) RawJSON ¶ added in v0.17.0
func (r TranscodingError) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingError) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingError) UnmarshalJSON(data []byte) error
type TranscodingFile ¶ added in v0.17.0
type TranscodingFile struct {
// Id identifies this published Transcoding file.
ID string `json:"id" api:"required"`
// CreatedAt records when the validated file was published.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Duration specifies the measured output duration in seconds.
Duration float64 `json:"duration" api:"required"`
// MimeType specifies the media content type.
MimeType string `json:"mime_type" api:"required"`
// Path specifies the output path relative to the Storage base_prefix saved when
// the Transcoding was created. Later Storage prefix changes do not move this file.
Path string `json:"path" api:"required"`
// Size specifies the measured file size in bytes.
Size int64 `json:"size" api:"required"`
// StorageId identifies the output Storage.
StorageID string `json:"storage_id" api:"required"`
// Thumbnails contains available dashboard preview images. Empty for audio-only
// files, failed previews or expired files.
Thumbnails []TranscodingFileThumbnail `json:"thumbnails" api:"required"`
// TranscodingId identifies the Transcoding that produced this file.
TranscodingID string `json:"transcoding_id" api:"required"`
// AudioBitrate specifies measured audio bits per second, or zero when unavailable.
// Omitted without audio.
AudioBitrate int64 `json:"audio_bitrate"`
// AudioCodec specifies the measured audio codec. Omitted without audio.
AudioCodec string `json:"audio_codec"`
// AudioSamplerate specifies measured audio samples per second. Omitted without
// audio.
AudioSamplerate int64 `json:"audio_samplerate"`
// CdnUrl provides the URL from the Storage CDN configuration. Omitted without a
// configured CDN or after file expiry.
CdnURL string `json:"cdn_url"`
// ExpiresAt specifies when a temporary output expires. Omitted for customer-owned
// output storage.
ExpiresAt time.Time `json:"expires_at" format:"date-time"`
// Height specifies the measured video height in pixels. Omitted for audio-only
// files.
Height int64 `json:"height"`
// ThumbnailStatus reports the optional dashboard preview result. Failure does not
// affect the media file. Omitted for audio-only files.
//
// Any of "ready", "failed".
ThumbnailStatus TranscodingFileThumbnailStatus `json:"thumbnail_status"`
// Url provides a signed download valid for at most ten minutes. Omitted when the
// file has expired or signing is unavailable.
URL string `json:"url"`
// VideoBitrate specifies measured video bits per second, or zero when unavailable.
// Omitted without video.
VideoBitrate int64 `json:"video_bitrate"`
// VideoCodec specifies the measured video codec. Omitted for audio-only files.
VideoCodec string `json:"video_codec"`
// VideoFramerate specifies measured video frames per second. Omitted without
// video.
VideoFramerate float64 `json:"video_framerate"`
// Width specifies the measured video width in pixels. Omitted for audio-only
// files.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreatedAt respjson.Field
Duration respjson.Field
MimeType respjson.Field
Path respjson.Field
Size respjson.Field
StorageID respjson.Field
Thumbnails respjson.Field
TranscodingID respjson.Field
AudioBitrate respjson.Field
AudioCodec respjson.Field
AudioSamplerate respjson.Field
CdnURL respjson.Field
ExpiresAt respjson.Field
Height respjson.Field
ThumbnailStatus respjson.Field
URL respjson.Field
VideoBitrate respjson.Field
VideoCodec respjson.Field
VideoFramerate respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A validated media file published by a Transcoding.
func (TranscodingFile) RawJSON ¶ added in v0.17.0
func (r TranscodingFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingFile) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingFile) UnmarshalJSON(data []byte) error
type TranscodingFileThumbnail ¶ added in v0.17.0
type TranscodingFileThumbnail struct {
// Format specifies the image encoding.
//
// Any of "jpeg", "webp".
Format TranscodingFileThumbnailFormat `json:"format" api:"required"`
// Height specifies the measured image height in pixels.
Height int64 `json:"height" api:"required"`
// Size specifies the measured image size in bytes.
Size int64 `json:"size" api:"required"`
// Url provides a signed image URL valid for at most ten minutes.
URL string `json:"url" api:"required"`
// Width specifies the measured image width in pixels.
Width int64 `json:"width" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Format respjson.Field
Height respjson.Field
Size respjson.Field
URL respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An optional dashboard preview of the completed output.
func (TranscodingFileThumbnail) RawJSON ¶ added in v0.17.0
func (r TranscodingFileThumbnail) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingFileThumbnail) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingFileThumbnail) UnmarshalJSON(data []byte) error
type TranscodingFileThumbnailFormat ¶ added in v1.0.0
type TranscodingFileThumbnailFormat string
Format specifies the image encoding.
const ( TranscodingFileThumbnailFormatJpeg TranscodingFileThumbnailFormat = "jpeg" TranscodingFileThumbnailFormatWebp TranscodingFileThumbnailFormat = "webp" )
type TranscodingFileThumbnailStatus ¶ added in v1.0.0
type TranscodingFileThumbnailStatus string
ThumbnailStatus reports the optional dashboard preview result. Failure does not affect the media file. Omitted for audio-only files.
const ( TranscodingFileThumbnailStatusReady TranscodingFileThumbnailStatus = "ready" TranscodingFileThumbnailStatusFailed TranscodingFileThumbnailStatus = "failed" )
type TranscodingFormat ¶ added in v0.17.0
type TranscodingFormat struct {
// Id specifies the resolved container and codec selection.
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "m4a_aac".
ID TranscodingFormatID `json:"id" api:"required"`
// Duration specifies the accepted output duration in seconds, including normalized
// trims.
Duration float64 `json:"duration" api:"required"`
// Seek specifies the accepted start position in source seconds, normalized to the
// output timeline.
Seek float64 `json:"seek" api:"required"`
// AudioBitrate specifies the resolved audio bitrate in bits per second. Omitted
// for video-only output.
AudioBitrate int64 `json:"audio_bitrate"`
// AudioSamplerate specifies the resolved audio samples per second. Omitted for
// video-only output.
AudioSamplerate int64 `json:"audio_samplerate"`
// Bufsize specifies the resolved video buffer size in bits, including codec-level
// defaults. Omitted when no buffer applies.
Bufsize int64 `json:"bufsize"`
// Channels specifies the resolved audio channel count: 1, 2, 6 or 8. Omitted for
// video-only output.
Channels int64 `json:"channels"`
// CpuUsed specifies the accepted VP9 encoder speed setting from 0 through 8.
// Omitted for other codecs.
CPUUsed string `json:"cpu_used"`
// Crf specifies the accepted constant quality. Omitted for bitrate-controlled,
// per-title and audio-only encoding.
Crf int64 `json:"crf"`
// DisableAudio is true for video-only output. Omitted when audio is selected.
DisableAudio bool `json:"disable_audio"`
// Framerate specifies the resolved video frames per second. Omitted for audio-only
// output.
Framerate float64 `json:"framerate"`
// Gop specifies the resolved maximum keyframe interval in frames. Omitted for
// audio-only output.
Gop int64 `json:"gop"`
// Height specifies the resolved video height in pixels. Omitted for audio-only
// output.
Height int64 `json:"height"`
// Level specifies the accepted codec level when explicitly selected.
Level int64 `json:"level"`
// Maxrate specifies the resolved maximum video bitrate in bits per second,
// including codec-level defaults. Omitted when no maximum applies.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the accepted minimum video bitrate in bits per second, when
// configured.
Minrate int64 `json:"minrate"`
// Movflags specifies MP4 packaging. MP4 video exports use faststart.
Movflags string `json:"movflags"`
// PerTitle specifies whether video rate control is selected during content
// analysis. Omitted for audio-only output.
PerTitle bool `json:"per_title"`
// Pixfmt specifies the accepted video pixel format. Omitted for audio-only output.
Pixfmt string `json:"pixfmt"`
// Preset specifies the accepted codec preset. Omitted when the codec does not use
// presets.
Preset string `json:"preset"`
// Profilev specifies the accepted codec profile when explicitly selected.
Profilev string `json:"profilev"`
// Quality specifies the accepted VP9 deadline policy: good, best or realtime.
// Omitted for other codecs.
Quality string `json:"quality"`
// VideoBitrate specifies the accepted video bitrate in bits per second. Omitted
// for CRF and per-title encoding.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the resolved video width in pixels. Omitted for audio-only
// output.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Duration respjson.Field
Seek respjson.Field
AudioBitrate respjson.Field
AudioSamplerate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
CPUUsed respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
Level respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
Movflags respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Preset respjson.Field
Profilev respjson.Field
Quality respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Resolved encoding settings accepted at creation. Only settings applicable to the selected streams and codec are included.
func (TranscodingFormat) RawJSON ¶ added in v0.17.0
func (r TranscodingFormat) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingFormat) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingFormat) UnmarshalJSON(data []byte) error
type TranscodingFormatID ¶ added in v1.0.0
type TranscodingFormatID string
Id specifies the resolved container and codec selection.
const ( TranscodingFormatIDMP4H264 TranscodingFormatID = "mp4_h264" TranscodingFormatIDMP4H265 TranscodingFormatID = "mp4_h265" TranscodingFormatIDMP4Av1 TranscodingFormatID = "mp4_av1" TranscodingFormatIDWebmVp9 TranscodingFormatID = "webm_vp9" TranscodingFormatIDM4aAac TranscodingFormatID = "m4a_aac" )
type TranscodingGetResponseEnvelope ¶ added in v0.17.0
type TranscodingGetResponseEnvelope struct {
// Data contains the Transcoding.
Data Transcoding `json:"data" api:"required"`
// Status is success for a successful request.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A Project-scoped Transcoding response.
func (TranscodingGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r TranscodingGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingGetResponseEnvelope) UnmarshalJSON(data []byte) error
type TranscodingListParams ¶ added in v0.17.0
type TranscodingListParams struct {
// Id filters by an exact Transcoding ID. Omit to include all matching resources.
ID param.Opt[string] `query:"id,omitzero" json:"-"`
// Maximum number of Transcodings to return.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of Transcodings to skip.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter Transcodings linked to this Source. Omit to include Transcodings from all
// Sources in the Project.
SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
// Filter by output Storage ID.
StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
Created TranscodingListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by Transcoding format ID.
//
// Any of "mp4_h264", "mp4_h265", "mp4_av1", "webm_vp9", "m4a_aac".
Format TranscodingListParamsFormat `query:"format,omitzero" json:"-"`
// Filter by metadata. Repeat key:value pairs to match all supplied metadata
// conditions.
Metadata []string `query:"metadata,omitzero" json:"-"`
// Filter by Transcoding status.
//
// Any of "preparing", "ready", "failed", "cancelled", "expired".
Status TranscodingStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TranscodingListParams) URLQuery ¶ added in v0.17.0
func (r TranscodingListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TranscodingListParams's query parameters as `url.Values`.
type TranscodingListParamsCreated ¶ added in v0.17.0
type TranscodingListParamsCreated struct {
// Created at or after this Unix timestamp in seconds.
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Created at or before this Unix timestamp in seconds.
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// Creation-time ordering. Defaults to newest first.
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TranscodingListParamsCreated) URLQuery ¶ added in v0.17.0
func (r TranscodingListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes TranscodingListParamsCreated's query parameters as `url.Values`.
type TranscodingListParamsFormat ¶ added in v1.0.1
type TranscodingListParamsFormat string
Filter by Transcoding format ID.
const ( TranscodingListParamsFormatMP4H264 TranscodingListParamsFormat = "mp4_h264" TranscodingListParamsFormatMP4H265 TranscodingListParamsFormat = "mp4_h265" TranscodingListParamsFormatMP4Av1 TranscodingListParamsFormat = "mp4_av1" TranscodingListParamsFormatWebmVp9 TranscodingListParamsFormat = "webm_vp9" TranscodingListParamsFormatM4aAac TranscodingListParamsFormat = "m4a_aac" )
type TranscodingM4aAacParam ¶ added in v0.17.0
type TranscodingM4aAacParam struct {
// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
// to 128000.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Duration specifies the requested output length in seconds. Defaults to the
// remaining source duration and is capped at the source end. Audio-only output
// must resolve to at least 0.001 seconds after trimming and sample rounding. The
// accepted interval determines the fixed price.
Duration param.Opt[float64] `json:"duration,omitzero"`
// Seek specifies the start in source seconds. Defaults to zero and must precede
// the source end. The accepted interval uses the output frame or sample timeline.
// Audio-only output must retain at least 0.001 seconds after sample rounding.
Seek param.Opt[float64] `json:"seek,omitzero"`
// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
// Opus audio uses 48000.
//
// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
// 88200, 96000.
AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
// Channels specifies the output channel count. Defaults to stereo. Six channels
// means 5.1; eight means 7.1.
//
// Any of 1, 2, 6, 8.
Channels int64 `json:"channels,omitzero"`
// Id specifies an AAC M4A export.
//
// This field can be elided, and will marshal its zero value as "m4a_aac".
ID constant.M4aAac `json:"id" default:"m4a_aac"`
// contains filtered or unexported fields
}
The property ID is required.
func (TranscodingM4aAacParam) MarshalJSON ¶ added in v0.17.0
func (r TranscodingM4aAacParam) MarshalJSON() (data []byte, err error)
func (*TranscodingM4aAacParam) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingM4aAacParam) UnmarshalJSON(data []byte) error
type TranscodingMP4Av1Movflags ¶ added in v0.17.0
type TranscodingMP4Av1Movflags string
Movflags specifies MP4 packaging. Defaults to faststart, which places playback metadata before the media.
const (
TranscodingMP4Av1MovflagsFaststart TranscodingMP4Av1Movflags = "faststart"
)
type TranscodingMP4Av1Param ¶ added in v0.17.0
type TranscodingMP4Av1Param struct {
// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
// to 128000.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 63. Recommended
// values: 16-35 for high quality, 35-45 for good quality, 45-63 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio omits the audio stream. Defaults to false. A source without audio
// produces video only.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
// must contain audio.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the requested output length in seconds. Defaults to the
// remaining source duration and is capped at the source end. Audio-only output
// must resolve to at least 0.001 seconds after trimming and sample rounding. The
// accepted interval determines the fixed price.
Duration param.Opt[float64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Defaults to the source rate and
// must be between 0.001 and 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
// at the accepted frame rate, capped at 960 frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
// AV1 requires CRF mode.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// PerTitle enables independent content-based bitrate prediction for each part of
// the video. Analysis uses only the selected trim interval. Defaults to false.
// Explicit rate-control settings cannot be combined with it.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the start in source seconds. Defaults to zero and must precede
// the source end. The accepted interval uses the output frame or sample timeline.
// Audio-only output must retain at least 0.001 seconds after sample rounding.
Seek param.Opt[float64] `json:"seek,omitzero"`
// VideoBitrate specifies the target video bitrate in bits per second, from 1000
// through 100000000. Omit it for CRF or per-title encoding.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Width param.Opt[int64] `json:"width,omitzero"`
// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
// Opus audio uses 48000.
//
// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
// 88200, 96000.
AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
// Channels specifies the output channel count. Defaults to stereo. Six channels
// means 5.1; eight means 7.1.
//
// Any of 1, 2, 6, 8.
Channels int64 `json:"channels,omitzero"`
// Level specifies the AV1 level using its two-digit representation, such as 31 for
// level 3.1. The dimensions, frame rate and rate controls must fit this level.
// Omitted rate limits resolve to level-compatible defaults.
//
// Any of 30, 31, 41.
Level int64 `json:"level,omitzero"`
// Movflags specifies MP4 packaging. Defaults to faststart, which places playback
// metadata before the media.
//
// Any of "faststart".
Movflags TranscodingMP4Av1Movflags `json:"movflags,omitzero"`
// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
// profile must support it.
//
// Any of "yuv420p", "yuv420p10le".
Pixfmt TranscodingMP4Av1Pixfmt `json:"pixfmt,omitzero"`
// Preset controls the encoding efficiency and processing intensity. Lower presets
// use more optimization features, creating smaller files with better quality but
// requiring more compute time. Higher presets encode faster but produce larger
// files.
//
// Preset ranges:
//
// - 6-7: Fast encoding for real-time applications (smaller files)
// - 8-10: Balanced efficiency and speed for general use
// - 11-13: Fastest encoding for real-time applications (larger files)
//
// Any of "6", "7", "8", "9", "10", "11", "12", "13".
Preset TranscodingMP4Av1Preset `json:"preset,omitzero"`
// Profilev selects the AV1 Main profile. Use pixfmt to select 8-bit or 10-bit
// output.
//
// Any of "main".
Profilev TranscodingMP4Av1Profilev `json:"profilev,omitzero"`
// Id specifies the output format.
//
// This field can be elided, and will marshal its zero value as "mp4_av1".
ID constant.MP4Av1 `json:"id" default:"mp4_av1"`
// contains filtered or unexported fields
}
The property ID is required.
func (TranscodingMP4Av1Param) MarshalJSON ¶ added in v0.17.0
func (r TranscodingMP4Av1Param) MarshalJSON() (data []byte, err error)
func (*TranscodingMP4Av1Param) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingMP4Av1Param) UnmarshalJSON(data []byte) error
type TranscodingMP4Av1Pixfmt ¶ added in v0.17.0
type TranscodingMP4Av1Pixfmt string
Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.
const ( TranscodingMP4Av1PixfmtYuv420p TranscodingMP4Av1Pixfmt = "yuv420p" TranscodingMP4Av1PixfmtYuv420p10le TranscodingMP4Av1Pixfmt = "yuv420p10le" )
type TranscodingMP4Av1Preset ¶ added in v0.17.0
type TranscodingMP4Av1Preset string
Preset controls the encoding efficiency and processing intensity. Lower presets use more optimization features, creating smaller files with better quality but requiring more compute time. Higher presets encode faster but produce larger files.
Preset ranges:
- 6-7: Fast encoding for real-time applications (smaller files) - 8-10: Balanced efficiency and speed for general use - 11-13: Fastest encoding for real-time applications (larger files)
const ( TranscodingMP4Av1Preset6 TranscodingMP4Av1Preset = "6" TranscodingMP4Av1Preset7 TranscodingMP4Av1Preset = "7" TranscodingMP4Av1Preset8 TranscodingMP4Av1Preset = "8" TranscodingMP4Av1Preset9 TranscodingMP4Av1Preset = "9" TranscodingMP4Av1Preset10 TranscodingMP4Av1Preset = "10" TranscodingMP4Av1Preset11 TranscodingMP4Av1Preset = "11" TranscodingMP4Av1Preset12 TranscodingMP4Av1Preset = "12" TranscodingMP4Av1Preset13 TranscodingMP4Av1Preset = "13" )
type TranscodingMP4Av1Profilev ¶ added in v0.17.0
type TranscodingMP4Av1Profilev string
Profilev selects the AV1 Main profile. Use pixfmt to select 8-bit or 10-bit output.
const (
TranscodingMP4Av1ProfilevMain TranscodingMP4Av1Profilev = "main"
)
type TranscodingMP4H264Movflags ¶ added in v0.17.0
type TranscodingMP4H264Movflags string
Movflags specifies MP4 packaging. Defaults to faststart, which places playback metadata before the media.
const (
TranscodingMP4H264MovflagsFaststart TranscodingMP4H264Movflags = "faststart"
)
type TranscodingMP4H264Param ¶ added in v0.17.0
type TranscodingMP4H264Param struct {
// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
// to 128000.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio omits the audio stream. Defaults to false. A source without audio
// produces video only.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
// must contain audio.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the requested output length in seconds. Defaults to the
// remaining source duration and is capped at the source end. Audio-only output
// must resolve to at least 0.001 seconds after trimming and sample rounding. The
// accepted interval determines the fixed price.
Duration param.Opt[float64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Defaults to the source rate and
// must be between 0.001 and 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
// at the accepted frame rate, capped at 960 frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
// AV1 requires CRF mode.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// PerTitle enables independent content-based bitrate prediction for each part of
// the video. Analysis uses only the selected trim interval. Defaults to false.
// Explicit rate-control settings cannot be combined with it.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the start in source seconds. Defaults to zero and must precede
// the source end. The accepted interval uses the output frame or sample timeline.
// Audio-only output must retain at least 0.001 seconds after sample rounding.
Seek param.Opt[float64] `json:"seek,omitzero"`
// VideoBitrate specifies the target video bitrate in bits per second, from 1000
// through 100000000. Omit it for CRF or per-title encoding.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Width param.Opt[int64] `json:"width,omitzero"`
// X264KeyInt specifies the maximum number of frames between keyframes for H.264
// encoding. Range: 1 to 960. Higher values can improve compression but may affect
// seeking.
X264Keyint param.Opt[int64] `json:"x264_keyint,omitzero"`
// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
// Opus audio uses 48000.
//
// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
// 88200, 96000.
AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
// Channels specifies the output channel count. Defaults to stereo. Six channels
// means 5.1; eight means 7.1.
//
// Any of 1, 2, 6, 8.
Channels int64 `json:"channels,omitzero"`
// Level specifies the H.264 decoder level using its two-digit representation, such
// as 41 for level 4.1. The dimensions, frame rate and rate controls must fit this
// level and the effective profile. Omitted rate limits resolve to level-compatible
// defaults.
//
// Any of 10, 11, 12, 13, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51.
Level int64 `json:"level,omitzero"`
// Movflags specifies MP4 packaging. Defaults to faststart, which places playback
// metadata before the media.
//
// Any of "faststart".
Movflags TranscodingMP4H264Movflags `json:"movflags,omitzero"`
// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
// profile must support it.
//
// Any of "yuv420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le",
// "yuv444p10le".
Pixfmt TranscodingMP4H264Pixfmt `json:"pixfmt,omitzero"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset TranscodingMP4H264Preset `json:"preset,omitzero"`
// Profilev specifies the H.264 profile. Valid values:
//
// - baseline: Basic profile, good for mobile devices
// - main: Main profile, good for most applications
// - high: High profile, best quality but requires more processing
// - high10: High 10-bit profile, supports 10-bit color
// - high422: High 4:2:2 profile, supports 4:2:2 color sampling
// - high444: High 4:4:4 profile, supports 4:4:4 color sampling
//
// Any of "baseline", "main", "high", "high10", "high422", "high444".
Profilev TranscodingMP4H264Profilev `json:"profilev,omitzero"`
// Id specifies the output format.
//
// This field can be elided, and will marshal its zero value as "mp4_h264".
ID constant.MP4H264 `json:"id" default:"mp4_h264"`
// contains filtered or unexported fields
}
The property ID is required.
func (TranscodingMP4H264Param) MarshalJSON ¶ added in v0.17.0
func (r TranscodingMP4H264Param) MarshalJSON() (data []byte, err error)
func (*TranscodingMP4H264Param) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingMP4H264Param) UnmarshalJSON(data []byte) error
type TranscodingMP4H264Pixfmt ¶ added in v0.17.0
type TranscodingMP4H264Pixfmt string
Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.
const ( TranscodingMP4H264PixfmtYuv420p TranscodingMP4H264Pixfmt = "yuv420p" TranscodingMP4H264PixfmtYuv422p TranscodingMP4H264Pixfmt = "yuv422p" TranscodingMP4H264PixfmtYuv444p TranscodingMP4H264Pixfmt = "yuv444p" TranscodingMP4H264PixfmtYuv420p10le TranscodingMP4H264Pixfmt = "yuv420p10le" TranscodingMP4H264PixfmtYuv422p10le TranscodingMP4H264Pixfmt = "yuv422p10le" TranscodingMP4H264PixfmtYuv444p10le TranscodingMP4H264Pixfmt = "yuv444p10le" )
type TranscodingMP4H264Preset ¶ added in v0.17.0
type TranscodingMP4H264Preset string
Preset specifies the encoding speed preset. Valid values (from fastest to slowest):
- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality
const ( TranscodingMP4H264PresetUltrafast TranscodingMP4H264Preset = "ultrafast" TranscodingMP4H264PresetSuperfast TranscodingMP4H264Preset = "superfast" TranscodingMP4H264PresetVeryfast TranscodingMP4H264Preset = "veryfast" TranscodingMP4H264PresetFaster TranscodingMP4H264Preset = "faster" TranscodingMP4H264PresetFast TranscodingMP4H264Preset = "fast" TranscodingMP4H264PresetMedium TranscodingMP4H264Preset = "medium" )
type TranscodingMP4H264Profilev ¶ added in v0.17.0
type TranscodingMP4H264Profilev string
Profilev specifies the H.264 profile. Valid values:
- baseline: Basic profile, good for mobile devices - main: Main profile, good for most applications - high: High profile, best quality but requires more processing - high10: High 10-bit profile, supports 10-bit color - high422: High 4:2:2 profile, supports 4:2:2 color sampling - high444: High 4:4:4 profile, supports 4:4:4 color sampling
const ( TranscodingMP4H264ProfilevBaseline TranscodingMP4H264Profilev = "baseline" TranscodingMP4H264ProfilevMain TranscodingMP4H264Profilev = "main" TranscodingMP4H264ProfilevHigh TranscodingMP4H264Profilev = "high" TranscodingMP4H264ProfilevHigh10 TranscodingMP4H264Profilev = "high10" TranscodingMP4H264ProfilevHigh422 TranscodingMP4H264Profilev = "high422" TranscodingMP4H264ProfilevHigh444 TranscodingMP4H264Profilev = "high444" )
type TranscodingMP4H265Movflags ¶ added in v0.17.0
type TranscodingMP4H265Movflags string
Movflags specifies MP4 packaging. Defaults to faststart, which places playback metadata before the media.
const (
TranscodingMP4H265MovflagsFaststart TranscodingMP4H265Movflags = "faststart"
)
type TranscodingMP4H265Param ¶ added in v0.17.0
type TranscodingMP4H265Param struct {
// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
// to 128000.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 16 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio omits the audio stream. Defaults to false. A source without audio
// produces video only.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
// must contain audio.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the requested output length in seconds. Defaults to the
// remaining source duration and is capped at the source end. Audio-only output
// must resolve to at least 0.001 seconds after trimming and sample rounding. The
// accepted interval determines the fixed price.
Duration param.Opt[float64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Defaults to the source rate and
// must be between 0.001 and 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
// at the accepted frame rate, capped at 960 frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
// AV1 requires CRF mode.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// PerTitle enables independent content-based bitrate prediction for each part of
// the video. Analysis uses only the selected trim interval. Defaults to false.
// Explicit rate-control settings cannot be combined with it.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the start in source seconds. Defaults to zero and must precede
// the source end. The accepted interval uses the output frame or sample timeline.
// Audio-only output must retain at least 0.001 seconds after sample rounding.
Seek param.Opt[float64] `json:"seek,omitzero"`
// VideoBitrate specifies the target video bitrate in bits per second, from 1000
// through 100000000. Omit it for CRF or per-title encoding.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Width param.Opt[int64] `json:"width,omitzero"`
// X265KeyInt specifies the maximum number of frames between keyframes for H.265
// encoding. Range: 1 to 300. Higher values can improve compression but may affect
// seeking.
X265Keyint param.Opt[int64] `json:"x265_keyint,omitzero"`
// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
// Opus audio uses 48000.
//
// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
// 88200, 96000.
AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
// Channels specifies the output channel count. Defaults to stereo. Six channels
// means 5.1; eight means 7.1.
//
// Any of 1, 2, 6, 8.
Channels int64 `json:"channels,omitzero"`
// Level specifies the HEVC level using its two-digit representation, such as 31
// for level 3.1. The dimensions, frame rate and rate controls must fit this level.
// Omitted rate limits resolve to level-compatible defaults.
//
// Any of 30, 31, 41.
Level int64 `json:"level,omitzero"`
// Movflags specifies MP4 packaging. Defaults to faststart, which places playback
// metadata before the media.
//
// Any of "faststart".
Movflags TranscodingMP4H265Movflags `json:"movflags,omitzero"`
// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
// profile must support it.
//
// Any of "yuv420p", "yuv422p", "yuv444p", "yuv420p10le", "yuv422p10le",
// "yuv444p10le", "yuv420p12le", "yuv422p12le", "yuv444p12le".
Pixfmt TranscodingMP4H265Pixfmt `json:"pixfmt,omitzero"`
// Preset specifies the encoding speed preset. Valid values (from fastest to
// slowest):
//
// - ultrafast: Fastest encoding, lowest quality
// - superfast: Very fast encoding, lower quality
// - veryfast: Fast encoding, moderate quality
// - faster: Faster encoding, good quality
// - fast: Fast encoding, better quality
// - medium: Balanced preset, best quality
//
// Any of "ultrafast", "superfast", "veryfast", "faster", "fast", "medium".
Preset TranscodingMP4H265Preset `json:"preset,omitzero"`
// Profilev selects the HEVC profile. It must support the requested pixel format.
//
// Any of "main", "main10", "main12", "main422-10", "main422-12", "main444-8",
// "main444-10", "main444-12".
Profilev TranscodingMP4H265Profilev `json:"profilev,omitzero"`
// Id specifies the output format.
//
// This field can be elided, and will marshal its zero value as "mp4_h265".
ID constant.MP4H265 `json:"id" default:"mp4_h265"`
// contains filtered or unexported fields
}
The property ID is required.
func (TranscodingMP4H265Param) MarshalJSON ¶ added in v0.17.0
func (r TranscodingMP4H265Param) MarshalJSON() (data []byte, err error)
func (*TranscodingMP4H265Param) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingMP4H265Param) UnmarshalJSON(data []byte) error
type TranscodingMP4H265Pixfmt ¶ added in v0.17.0
type TranscodingMP4H265Pixfmt string
Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.
const ( TranscodingMP4H265PixfmtYuv420p TranscodingMP4H265Pixfmt = "yuv420p" TranscodingMP4H265PixfmtYuv422p TranscodingMP4H265Pixfmt = "yuv422p" TranscodingMP4H265PixfmtYuv444p TranscodingMP4H265Pixfmt = "yuv444p" TranscodingMP4H265PixfmtYuv420p10le TranscodingMP4H265Pixfmt = "yuv420p10le" TranscodingMP4H265PixfmtYuv422p10le TranscodingMP4H265Pixfmt = "yuv422p10le" TranscodingMP4H265PixfmtYuv444p10le TranscodingMP4H265Pixfmt = "yuv444p10le" TranscodingMP4H265PixfmtYuv420p12le TranscodingMP4H265Pixfmt = "yuv420p12le" TranscodingMP4H265PixfmtYuv422p12le TranscodingMP4H265Pixfmt = "yuv422p12le" TranscodingMP4H265PixfmtYuv444p12le TranscodingMP4H265Pixfmt = "yuv444p12le" )
type TranscodingMP4H265Preset ¶ added in v0.17.0
type TranscodingMP4H265Preset string
Preset specifies the encoding speed preset. Valid values (from fastest to slowest):
- ultrafast: Fastest encoding, lowest quality - superfast: Very fast encoding, lower quality - veryfast: Fast encoding, moderate quality - faster: Faster encoding, good quality - fast: Fast encoding, better quality - medium: Balanced preset, best quality
const ( TranscodingMP4H265PresetUltrafast TranscodingMP4H265Preset = "ultrafast" TranscodingMP4H265PresetSuperfast TranscodingMP4H265Preset = "superfast" TranscodingMP4H265PresetVeryfast TranscodingMP4H265Preset = "veryfast" TranscodingMP4H265PresetFaster TranscodingMP4H265Preset = "faster" TranscodingMP4H265PresetFast TranscodingMP4H265Preset = "fast" TranscodingMP4H265PresetMedium TranscodingMP4H265Preset = "medium" )
type TranscodingMP4H265Profilev ¶ added in v0.17.0
type TranscodingMP4H265Profilev string
Profilev selects the HEVC profile. It must support the requested pixel format.
const ( TranscodingMP4H265ProfilevMain TranscodingMP4H265Profilev = "main" TranscodingMP4H265ProfilevMain10 TranscodingMP4H265Profilev = "main10" TranscodingMP4H265ProfilevMain12 TranscodingMP4H265Profilev = "main12" TranscodingMP4H265ProfilevMain422_10 TranscodingMP4H265Profilev = "main422-10" TranscodingMP4H265ProfilevMain422_12 TranscodingMP4H265Profilev = "main422-12" TranscodingMP4H265ProfilevMain444_8 TranscodingMP4H265Profilev = "main444-8" TranscodingMP4H265ProfilevMain444_10 TranscodingMP4H265Profilev = "main444-10" TranscodingMP4H265ProfilevMain444_12 TranscodingMP4H265Profilev = "main444-12" )
type TranscodingNewParams ¶ added in v0.17.0
type TranscodingNewParams struct {
// Format specifies the requested encoding settings.
Format TranscodingCreateFormatParamsUnion `json:"format,omitzero" api:"required"`
// SourceId identifies a Source in this Project.
SourceID string `json:"source_id" api:"required"`
// Metadata attaches string values to the Transcoding. The serialized object may
// contain at most 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Storage overrides the Project output destination. Source storage remains
// independent.
Storage TranscodingCreateStorageParams `json:"storage,omitzero"`
// contains filtered or unexported fields
}
func (TranscodingNewParams) MarshalJSON ¶ added in v0.17.0
func (r TranscodingNewParams) MarshalJSON() (data []byte, err error)
func (*TranscodingNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingNewParams) UnmarshalJSON(data []byte) error
type TranscodingNewResponseEnvelope ¶ added in v0.17.0
type TranscodingNewResponseEnvelope struct {
// Data contains the Transcoding.
Data Transcoding `json:"data" api:"required"`
// Status is success for a successful request.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A Project-scoped Transcoding response.
func (TranscodingNewResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r TranscodingNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingNewResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingNewResponseEnvelope) UnmarshalJSON(data []byte) error
type TranscodingProcessingStage ¶ added in v0.17.0
type TranscodingProcessingStage string
ProcessingStage specifies the current preparation activity. queued means the request is waiting for processing capacity.
const ( TranscodingProcessingStageQueued TranscodingProcessingStage = "queued" TranscodingProcessingStageStarting TranscodingProcessingStage = "starting" TranscodingProcessingStageEncoding TranscodingProcessingStage = "encoding" TranscodingProcessingStageFinalizing TranscodingProcessingStage = "finalizing" TranscodingProcessingStageUploading TranscodingProcessingStage = "uploading" )
type TranscodingService ¶ added in v0.17.0
type TranscodingService struct {
Options []option.RequestOption
}
TranscodingService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTranscodingService method instead.
func NewTranscodingService ¶ added in v0.17.0
func NewTranscodingService(opts ...option.RequestOption) (r TranscodingService)
NewTranscodingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TranscodingService) Cancel ¶ added in v0.17.0
func (r *TranscodingService) Cancel(ctx context.Context, transcodingID string, opts ...option.RequestOption) (err error)
Cancel a preparing Transcoding and release its unpaid reservation. Repeating an accepted cancellation succeeds.
func (*TranscodingService) Delete ¶ added in v0.17.0
func (r *TranscodingService) Delete(ctx context.Context, transcodingID string, body TranscodingDeleteParams, opts ...option.RequestOption) (err error)
Delete a ready, failed, cancelled or expired Transcoding and its file records. The Source and settled usage are preserved. Customer output files remain unless delete_files is true; temporary files retain their original 24-hour expiry. Deletion remains available for inactive teams.
func (*TranscodingService) Get ¶ added in v0.17.0
func (r *TranscodingService) Get(ctx context.Context, transcodingID string, opts ...option.RequestOption) (res *Transcoding, err error)
Retrieve the accepted settings, published files and current state of one Transcoding.
func (*TranscodingService) List ¶ added in v0.17.0
func (r *TranscodingService) List(ctx context.Context, query TranscodingListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Transcoding], err error)
List Transcodings in the authenticated Project, newest first by default.
func (*TranscodingService) ListAutoPaging ¶ added in v0.17.0
func (r *TranscodingService) ListAutoPaging(ctx context.Context, query TranscodingListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Transcoding]
List Transcodings in the authenticated Project, newest first by default.
func (*TranscodingService) New ¶ added in v0.17.0
func (r *TranscodingService) New(ctx context.Context, body TranscodingNewParams, opts ...option.RequestOption) (res *Transcoding, err error)
Create a standalone file export with resolved encoding settings.
type TranscodingStatus ¶ added in v0.17.0
type TranscodingStatus string
Status is ready only after the output is validated and published. Temporary output becomes expired when its files are no longer available.
const ( TranscodingStatusPreparing TranscodingStatus = "preparing" TranscodingStatusReady TranscodingStatus = "ready" TranscodingStatusFailed TranscodingStatus = "failed" TranscodingStatusCancelled TranscodingStatus = "cancelled" TranscodingStatusExpired TranscodingStatus = "expired" )
type TranscodingStorage ¶ added in v0.17.0
type TranscodingStorage struct {
// Id identifies the output Storage.
ID string `json:"id" api:"required"`
// Path specifies the output file path relative to the Storage base_prefix saved at
// creation.
Path string `json:"path" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Path respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The resolved output destination for a Transcoding.
func (TranscodingStorage) RawJSON ¶ added in v0.17.0
func (r TranscodingStorage) RawJSON() string
Returns the unmodified JSON received from the API
func (*TranscodingStorage) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingStorage) UnmarshalJSON(data []byte) error
type TranscodingWebmVp9CPUUsed ¶ added in v0.17.0
type TranscodingWebmVp9CPUUsed string
CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower values mean better quality but slower encoding, higher values mean faster encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for good quality, 4-6 for balanced, 6-8 for speed
const ( TranscodingWebmVp9CPUUsed0 TranscodingWebmVp9CPUUsed = "0" TranscodingWebmVp9CPUUsed1 TranscodingWebmVp9CPUUsed = "1" TranscodingWebmVp9CPUUsed2 TranscodingWebmVp9CPUUsed = "2" TranscodingWebmVp9CPUUsed3 TranscodingWebmVp9CPUUsed = "3" TranscodingWebmVp9CPUUsed4 TranscodingWebmVp9CPUUsed = "4" TranscodingWebmVp9CPUUsed5 TranscodingWebmVp9CPUUsed = "5" TranscodingWebmVp9CPUUsed6 TranscodingWebmVp9CPUUsed = "6" TranscodingWebmVp9CPUUsed7 TranscodingWebmVp9CPUUsed = "7" TranscodingWebmVp9CPUUsed8 TranscodingWebmVp9CPUUsed = "8" )
type TranscodingWebmVp9Param ¶ added in v0.17.0
type TranscodingWebmVp9Param struct {
// AudioBitrate specifies the output audio bitrate in bits per second. Defaults
// to 128000.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits, from 100000 through 50000000.
// H.264 and H.265 require maxrate. AV1 and VP9 require a bitrate-controlled mode.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 15 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio omits the audio stream. Defaults to false. A source without audio
// produces video only.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo selects an audio-only AAC M4A export. Defaults to false. The source
// must contain audio.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the requested output length in seconds. Defaults to the
// remaining source duration and is capped at the source end. Audio-only output
// must resolve to at least 0.001 seconds after trimming and sample rounding. The
// accepted interval determines the fixed price.
Duration param.Opt[float64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Defaults to the source rate and
// must be between 0.001 and 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the maximum keyframe interval in frames. Defaults to four seconds
// at the accepted frame rate, capped at 960 frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the video buffer maximum rate in bits per second, from 100000
// through 50000000. H.264 and H.265 require bufsize. VP9 requires video_bitrate;
// AV1 requires CRF mode.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate selects VP9 constant bitrate when equal to video_bitrate and maxrate.
// Other minimum-rate combinations are unsupported.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
// PerTitle enables independent content-based bitrate prediction for each part of
// the video. Analysis uses only the selected trim interval. Defaults to false.
// Explicit rate-control settings cannot be combined with it.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the start in source seconds. Defaults to zero and must precede
// the source end. The accepted interval uses the output frame or sample timeline.
// Audio-only output must retain at least 0.001 seconds after sample rounding.
Seek param.Opt[float64] `json:"seek,omitzero"`
// VideoBitrate specifies the target video bitrate in bits per second, from 1000
// through 100000000. Omit it for CRF or per-title encoding.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output dimension in pixels. Use -2 or omit one dimension to
// preserve the source aspect ratio. Explicit dimensions must be 2 to 7680 and
// even. Omitting both preserves the source dimensions rounded down to even pixels.
Width param.Opt[int64] `json:"width,omitzero"`
// AudioSamplerate specifies the output sample rate in Hz. Defaults to 48000. WebM
// Opus audio uses 48000.
//
// Any of 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000,
// 88200, 96000.
AudioSamplerate int64 `json:"audio_samplerate,omitzero"`
// Channels specifies the output channel count. Defaults to stereo. Six channels
// means 5.1; eight means 7.1.
//
// Any of 1, 2, 6, 8.
Channels int64 `json:"channels,omitzero"`
// CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower
// values mean better quality but slower encoding, higher values mean faster
// encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for
// good quality, 4-6 for balanced, 6-8 for speed
//
// Any of "0", "1", "2", "3", "4", "5", "6", "7", "8".
CPUUsed TranscodingWebmVp9CPUUsed `json:"cpu_used,omitzero"`
// Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected
// profile must support it.
//
// Any of "yuv420p", "yuv422p", "yuv440p", "yuv444p", "yuv420p10le", "yuv422p10le",
// "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le", "yuv440p12le",
// "yuv444p12le".
Pixfmt TranscodingWebmVp9Pixfmt `json:"pixfmt,omitzero"`
// Quality specifies the VP9 encoding quality preset. Valid values:
//
// - good: Balanced quality preset, good for most applications
// - best: Best quality preset, slower encoding
// - realtime: Fast encoding preset, suitable for live streaming
//
// Any of "good", "best", "realtime".
Quality TranscodingWebmVp9Quality `json:"quality,omitzero"`
// Id specifies the output format.
//
// This field can be elided, and will marshal its zero value as "webm_vp9".
ID constant.WebmVp9 `json:"id" default:"webm_vp9"`
// contains filtered or unexported fields
}
The property ID is required.
func (TranscodingWebmVp9Param) MarshalJSON ¶ added in v0.17.0
func (r TranscodingWebmVp9Param) MarshalJSON() (data []byte, err error)
func (*TranscodingWebmVp9Param) UnmarshalJSON ¶ added in v0.17.0
func (r *TranscodingWebmVp9Param) UnmarshalJSON(data []byte) error
type TranscodingWebmVp9Pixfmt ¶ added in v0.17.0
type TranscodingWebmVp9Pixfmt string
Pixfmt specifies the output pixel format. Defaults to yuv420p. The selected profile must support it.
const ( TranscodingWebmVp9PixfmtYuv420p TranscodingWebmVp9Pixfmt = "yuv420p" TranscodingWebmVp9PixfmtYuv422p TranscodingWebmVp9Pixfmt = "yuv422p" TranscodingWebmVp9PixfmtYuv440p TranscodingWebmVp9Pixfmt = "yuv440p" TranscodingWebmVp9PixfmtYuv444p TranscodingWebmVp9Pixfmt = "yuv444p" TranscodingWebmVp9PixfmtYuv420p10le TranscodingWebmVp9Pixfmt = "yuv420p10le" TranscodingWebmVp9PixfmtYuv422p10le TranscodingWebmVp9Pixfmt = "yuv422p10le" TranscodingWebmVp9PixfmtYuv440p10le TranscodingWebmVp9Pixfmt = "yuv440p10le" TranscodingWebmVp9PixfmtYuv444p10le TranscodingWebmVp9Pixfmt = "yuv444p10le" TranscodingWebmVp9PixfmtYuv420p12le TranscodingWebmVp9Pixfmt = "yuv420p12le" TranscodingWebmVp9PixfmtYuv422p12le TranscodingWebmVp9Pixfmt = "yuv422p12le" TranscodingWebmVp9PixfmtYuv440p12le TranscodingWebmVp9Pixfmt = "yuv440p12le" TranscodingWebmVp9PixfmtYuv444p12le TranscodingWebmVp9Pixfmt = "yuv444p12le" )
type TranscodingWebmVp9Quality ¶ added in v0.17.0
type TranscodingWebmVp9Quality string
Quality specifies the VP9 encoding quality preset. Valid values:
- good: Balanced quality preset, good for most applications - best: Best quality preset, slower encoding - realtime: Fast encoding preset, suitable for live streaming
const ( TranscodingWebmVp9QualityGood TranscodingWebmVp9Quality = "good" TranscodingWebmVp9QualityBest TranscodingWebmVp9Quality = "best" TranscodingWebmVp9QualityRealtime TranscodingWebmVp9Quality = "realtime" )
type UnwrapWebhookEventUnion ¶ added in v1.0.0
type UnwrapWebhookEventUnion struct {
ID string `json:"id"`
// This field is a union of [NotificationPayloadJobCompletedData],
// [NotificationPayloadJobFailedData], [NotificationPayloadJobCreatedData],
// [NotificationPayloadSourceCreatedData], [NotificationPayloadSourceDeletedData],
// [NotificationPayloadUploadCreatedData],
// [NotificationPayloadUploadCompletedData], [NotificationPayloadUploadFailedData],
// [NotificationPayloadAssetData], [NotificationPayloadAssetOutputData],
// [NotificationPayloadAssetOutputDeletedData],
// [NotificationPayloadAssetDeletedData], [NotificationPayloadWorkflowRunData],
// [NotificationPayloadTranscodingData], [NotificationPayloadThumbnailData]
Data UnwrapWebhookEventUnionData `json:"data"`
Date time.Time `json:"date"`
// Any of "job.completed", nil, "job.created", "source.created", "source.deleted",
// "upload.created", "upload.completed", nil, nil, nil, "asset.output.deleted",
// "asset.deleted", nil, nil, nil.
Event string `json:"event"`
JSON struct {
ID respjson.Field
Data respjson.Field
Date respjson.Field
Event respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnion contains all possible properties and values from NotificationPayloadJobCompleted, NotificationPayloadJobFailed, NotificationPayloadJobCreated, NotificationPayloadSourceCreated, NotificationPayloadSourceDeleted, NotificationPayloadUploadCreated, NotificationPayloadUploadCompleted, NotificationPayloadUploadFailed, NotificationPayloadAsset, NotificationPayloadAssetOutput, NotificationPayloadAssetOutputDeleted, NotificationPayloadAssetDeleted, NotificationPayloadWorkflowRun, NotificationPayloadTranscoding, NotificationPayloadThumbnail.
Use the [UnwrapWebhookEventUnion.AsAny] method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (UnwrapWebhookEventUnion) AsAssetDeleted ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsAssetDeleted() (v NotificationPayloadAssetDeleted)
func (UnwrapWebhookEventUnion) AsAssetOutputDeleted ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsAssetOutputDeleted() (v NotificationPayloadAssetOutputDeleted)
func (UnwrapWebhookEventUnion) AsJobCompleted ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsJobCompleted() (v NotificationPayloadJobCompleted)
func (UnwrapWebhookEventUnion) AsJobCreated ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsJobCreated() (v NotificationPayloadJobCreated)
func (UnwrapWebhookEventUnion) AsNotificationPayloadAsset ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadAsset() (v NotificationPayloadAsset)
func (UnwrapWebhookEventUnion) AsNotificationPayloadAssetOutput ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadAssetOutput() (v NotificationPayloadAssetOutput)
func (UnwrapWebhookEventUnion) AsNotificationPayloadJobFailed ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadJobFailed() (v NotificationPayloadJobFailed)
func (UnwrapWebhookEventUnion) AsNotificationPayloadThumbnail ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadThumbnail() (v NotificationPayloadThumbnail)
func (UnwrapWebhookEventUnion) AsNotificationPayloadTranscoding ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadTranscoding() (v NotificationPayloadTranscoding)
func (UnwrapWebhookEventUnion) AsNotificationPayloadUploadFailed ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadUploadFailed() (v NotificationPayloadUploadFailed)
func (UnwrapWebhookEventUnion) AsNotificationPayloadWorkflowRun ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsNotificationPayloadWorkflowRun() (v NotificationPayloadWorkflowRun)
func (UnwrapWebhookEventUnion) AsSourceCreated ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsSourceCreated() (v NotificationPayloadSourceCreated)
func (UnwrapWebhookEventUnion) AsSourceDeleted ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsSourceDeleted() (v NotificationPayloadSourceDeleted)
func (UnwrapWebhookEventUnion) AsUploadCompleted ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsUploadCompleted() (v NotificationPayloadUploadCompleted)
func (UnwrapWebhookEventUnion) AsUploadCreated ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) AsUploadCreated() (v NotificationPayloadUploadCreated)
func (UnwrapWebhookEventUnion) RawJSON ¶ added in v1.0.0
func (u UnwrapWebhookEventUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*UnwrapWebhookEventUnion) UnmarshalJSON ¶ added in v1.0.0
func (r *UnwrapWebhookEventUnion) UnmarshalJSON(data []byte) error
type UnwrapWebhookEventUnionData ¶ added in v1.0.0
type UnwrapWebhookEventUnionData struct {
// This field is from variant [NotificationPayloadJobCompletedData].
Files []JobFile `json:"files"`
// This field is from variant [NotificationPayloadJobCompletedData].
Job Job `json:"job"`
// This field is from variant [NotificationPayloadSourceCreatedData].
Source Source `json:"source"`
// This field is from variant [NotificationPayloadUploadCreatedData].
Upload Upload `json:"upload"`
// This field is from variant [NotificationPayloadAssetData].
Asset Asset `json:"asset"`
// This field is from variant [NotificationPayloadAssetOutputData].
Output AssetOutputUnion `json:"output"`
FilesDeleted bool `json:"files_deleted"`
// This field is from variant [NotificationPayloadAssetDeletedData].
DeletedSize int64 `json:"deleted_size"`
// This field is from variant [NotificationPayloadWorkflowRunData].
ActionRuns []AssetActionRun `json:"action_runs"`
// This field is from variant [NotificationPayloadWorkflowRunData].
WorkflowRun WorkflowRun `json:"workflow_run"`
// This field is from variant [NotificationPayloadTranscodingData].
Transcoding Transcoding `json:"transcoding"`
// This field is from variant [NotificationPayloadThumbnailData].
Thumbnail Thumbnail `json:"thumbnail"`
JSON struct {
Files respjson.Field
Job respjson.Field
Source respjson.Field
Upload respjson.Field
Asset respjson.Field
Output respjson.Field
FilesDeleted respjson.Field
DeletedSize respjson.Field
ActionRuns respjson.Field
WorkflowRun respjson.Field
Transcoding respjson.Field
Thumbnail respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
UnwrapWebhookEventUnionData is an implicit subunion of UnwrapWebhookEventUnion. UnwrapWebhookEventUnionData provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the UnwrapWebhookEventUnion.
func (*UnwrapWebhookEventUnionData) UnmarshalJSON ¶ added in v1.0.0
func (r *UnwrapWebhookEventUnionData) UnmarshalJSON(data []byte) error
type Upload ¶ added in v0.6.0
type Upload struct {
// Unique identifier of the upload
ID string `json:"id" api:"required"`
// Whether this Upload creates an Asset on completion.
CreateAsset bool `json:"create_asset" api:"required"`
// Timestamp when the upload was created
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Timestamp when the upload will expire
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
// Additional metadata for the upload
Metadata map[string]string `json:"metadata" api:"required"`
// Current status of the upload
//
// Any of "waiting", "completed", "failed", "expired".
Status UploadStatus `json:"status" api:"required"`
// Timestamp when the upload was updated
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// Resolved transfer mode for this Upload.
//
// Any of "single", "multipart".
UploadMode UploadUploadMode `json:"upload_mode" api:"required"`
// Selected Workflow ID, or null.
WorkflowID string `json:"workflow_id" api:"required"`
// Pinned Workflow revision, or null.
WorkflowRevision int64 `json:"workflow_revision" api:"required"`
// Automatically created Asset. May be absent before completion or after record
// deletion.
AssetID string `json:"asset_id"`
// Completion capability, returned only on creation. POST after a successful single
// PUT or with all multipart ETags before expires_at. Requires no API key. Repeated
// valid calls are idempotent.
CompletionURL string `json:"completion_url"`
// CreatedByTokenId specifies the Project token used to create the resource. It
// remains set after the token is revoked. Omitted for dashboard requests, MCP
// OAuth connections, Workflow actions, and unknown creators.
CreatedByTokenID string `json:"created_by_token_id"`
// CreatedByUserId specifies the team member who created the resource. Omitted for
// Workflow actions, unknown creators, and deleted accounts.
CreatedByUserID string `json:"created_by_user_id"`
// CreatedVia specifies how the resource was created: api for API requests,
// dashboard for the Chunkify dashboard, mcp for MCP clients, and workflow for
// Workflow actions. Omitted when the creator is unknown.
//
// Any of "api", "dashboard", "mcp", "workflow".
CreatedVia shared.CreatedVia `json:"created_via"`
// Error message of the upload
Error shared.ChunkifyError `json:"error"`
// Declared file size in bytes, when supplied at creation.
FileSizeBytes int64 `json:"file_size_bytes"`
// Multipart transfer details, returned only on creation for multipart Uploads.
Multipart UploadMultipartSession `json:"multipart"`
// SourceId is the id of the source that was created from the upload
SourceID string `json:"source_id"`
// Resolved Storage selected when the Upload was created. Absent for historical
// uploads.
StorageID string `json:"storage_id"`
// Presigned PUT URL, returned only when creating a single-PUT Upload session. Call
// completion_url after the PUT succeeds.
UploadURL string `json:"upload_url"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CreateAsset respjson.Field
CreatedAt respjson.Field
ExpiresAt respjson.Field
Metadata respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
UploadMode respjson.Field
WorkflowID respjson.Field
WorkflowRevision respjson.Field
AssetID respjson.Field
CompletionURL respjson.Field
CreatedByTokenID respjson.Field
CreatedByUserID respjson.Field
CreatedVia respjson.Field
Error respjson.Field
FileSizeBytes respjson.Field
Multipart respjson.Field
SourceID respjson.Field
StorageID respjson.Field
UploadURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Upload) UnmarshalJSON ¶ added in v0.6.0
type UploadCompleteParams ¶ added in v0.17.0
type UploadCompleteParams struct {
// All uploaded parts in ascending part_number order, with the ETags returned by
// storage.
Parts []UploadMultipartPartParams `json:"parts,omitzero"`
// contains filtered or unexported fields
}
func (UploadCompleteParams) MarshalJSON ¶ added in v0.17.0
func (r UploadCompleteParams) MarshalJSON() (data []byte, err error)
func (*UploadCompleteParams) UnmarshalJSON ¶ added in v0.17.0
func (r *UploadCompleteParams) UnmarshalJSON(data []byte) error
type UploadCreateStorageParams ¶ added in v1.0.0
type UploadCreateStorageParams struct {
// Storage belonging to this Project. Omit to use the Project default.
ID param.Opt[string] `json:"id,omitzero"`
// Exact object key including filename, required for customer Storage and forbidden
// for Chunkify Storage. The output base_prefix is not added. Existing keys may be
// overwritten.
Path param.Opt[string] `json:"path,omitzero"`
// contains filtered or unexported fields
}
func (UploadCreateStorageParams) MarshalJSON ¶ added in v1.0.0
func (r UploadCreateStorageParams) MarshalJSON() (data []byte, err error)
func (*UploadCreateStorageParams) UnmarshalJSON ¶ added in v1.0.0
func (r *UploadCreateStorageParams) UnmarshalJSON(data []byte) error
type UploadGetResponseEnvelope ¶ added in v0.6.0
type UploadGetResponseEnvelope struct {
// Data contains the response object
Data Upload `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r UploadGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *UploadGetResponseEnvelope) UnmarshalJSON(data []byte) error
type UploadListParams ¶ added in v0.6.0
type UploadListParams struct {
// Filter by upload ID
ID param.Opt[string] `query:"id,omitzero" json:"-"`
// Pagination limit (max 100)
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Pagination offset
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Filter by source ID
SourceID param.Opt[string] `query:"source_id,omitzero" json:"-"`
// Filter by input Storage ID.
StorageID param.Opt[string] `query:"storage_id,omitzero" json:"-"`
Created UploadListParamsCreated `query:"created,omitzero" json:"-"`
// Filter by metadata. Repeat key:value pairs to match all supplied metadata
// conditions.
Metadata []string `query:"metadata,omitzero" json:"-"`
// Filter by status (pending, completed, error)
//
// Any of "waiting", "completed", "failed", "expired".
Status UploadListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (UploadListParams) URLQuery ¶ added in v0.6.0
func (r UploadListParams) URLQuery() (v url.Values, err error)
URLQuery serializes UploadListParams's query parameters as `url.Values`.
type UploadListParamsCreated ¶ added in v0.6.0
type UploadListParamsCreated struct {
// Filter by creation date greater than or equal (UNIX epoch time)
Gte param.Opt[int64] `query:"gte,omitzero" format:"epoch" json:"-"`
// Filter by creation date less than or equal (UNIX epoch time)
Lte param.Opt[int64] `query:"lte,omitzero" format:"epoch" json:"-"`
// Sort by creation date (asc/desc)
//
// Any of "asc", "desc".
Sort string `query:"sort,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (UploadListParamsCreated) URLQuery ¶ added in v0.6.0
func (r UploadListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes UploadListParamsCreated's query parameters as `url.Values`.
type UploadListParamsStatus ¶ added in v0.6.0
type UploadListParamsStatus string
Filter by status (pending, completed, error)
const ( UploadListParamsStatusWaiting UploadListParamsStatus = "waiting" UploadListParamsStatusCompleted UploadListParamsStatus = "completed" UploadListParamsStatusFailed UploadListParamsStatus = "failed" UploadListParamsStatusExpired UploadListParamsStatus = "expired" )
type UploadMultipartPartParams ¶ added in v1.0.0
type UploadMultipartPartParams struct {
// ETag returned by storage for this part, including its quotation marks when
// present.
Etag string `json:"etag" api:"required"`
// One-based part number.
PartNumber int64 `json:"part_number" api:"required"`
// contains filtered or unexported fields
}
The properties Etag, PartNumber are required.
func (UploadMultipartPartParams) MarshalJSON ¶ added in v1.0.0
func (r UploadMultipartPartParams) MarshalJSON() (data []byte, err error)
func (*UploadMultipartPartParams) UnmarshalJSON ¶ added in v1.0.0
func (r *UploadMultipartPartParams) UnmarshalJSON(data []byte) error
type UploadMultipartSession ¶ added in v1.0.0
type UploadMultipartSession struct {
// ExpiresAt specifies when the signed part URLs expire. URLs cannot be refreshed;
// create a new Upload after expiry.
ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
// PartSizeBytes specifies the size of each part except the final part, in bytes.
PartSizeBytes int64 `json:"part_size_bytes" api:"required"`
// Parts contains every signed upload URL in ascending part_number order. Upload
// file slices directly to these URLs.
Parts []UploadMultipartSignedPart `json:"parts" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExpiresAt respjson.Field
PartSizeBytes respjson.Field
Parts respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadMultipartSession) RawJSON ¶ added in v1.0.0
func (r UploadMultipartSession) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadMultipartSession) UnmarshalJSON ¶ added in v1.0.0
func (r *UploadMultipartSession) UnmarshalJSON(data []byte) error
type UploadMultipartSignedPart ¶ added in v1.0.0
type UploadMultipartSignedPart struct {
// PartNumber specifies the one-based part number for this URL.
PartNumber int64 `json:"part_number" api:"required"`
// UploadUrl specifies the signed PUT URL for this part. Retry the same file slice
// with this URL before multipart.expires_at.
UploadURL string `json:"upload_url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
PartNumber respjson.Field
UploadURL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadMultipartSignedPart) RawJSON ¶ added in v1.0.0
func (r UploadMultipartSignedPart) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadMultipartSignedPart) UnmarshalJSON ¶ added in v1.0.0
func (r *UploadMultipartSignedPart) UnmarshalJSON(data []byte) error
type UploadNewParams ¶ added in v0.6.0
type UploadNewParams struct {
// WorkflowId specifies the Workflow to select. Omit to use the Project default.
// Set null to disable automatic actions. The current revision is pinned when
// creation is accepted.
WorkflowID param.Opt[string] `json:"workflow_id,omitzero"`
// CreateAsset specifies whether to create an Asset after Upload completion.
// Defaults to false. Snapshots the Project output settings, including the path
// template. Referenced metadata must be non-empty in this request. Asset
// processing is billed separately.
CreateAsset param.Opt[bool] `json:"create_asset,omitzero"`
// FileSizeBytes specifies the exact file size in bytes. Required when UploadMode
// is omitted, auto, or multipart. Optional for explicit single mode. Must fit the
// team's Source size limit. Single PUT supports up to 5 GiB, subject to the
// provider's limit; multipart supports up to 5 TiB.
FileSizeBytes param.Opt[int64] `json:"file_size_bytes,omitzero"`
// ValidityTimeout specifies the session and signed URL lifetime in seconds. Single
// PUT defaults to 7200 and allows 300–36000. Multipart defaults to twice the
// transfer time at 5 Mbps plus 1800 seconds, bounded to 7200–172800; an explicit
// value allows 300–172800. Complete before expiry. Storage credentials and
// policies can shorten URL validity. Expired URLs cannot be refreshed.
ValidityTimeout param.Opt[int64] `json:"validity_timeout,omitzero"`
// Metadata allows for additional information to be attached to the upload, with a
// maximum size of 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Optional Storage override. Omit id to use the Project default.
// Customer-connected Storage requires path; Chunkify Storage generates its own
// path.
Storage UploadCreateStorageParams `json:"storage,omitzero"`
// UploadMode specifies the transfer method. Defaults to auto. Auto chooses
// multipart above 100 MiB and single PUT at or below 100 MiB for every Storage
// provider. Multipart requires a provider that supports the required multipart
// operations and signed part URLs. Provider failures return an error without
// falling back to single PUT.
//
// Any of "single", "multipart", "auto".
UploadMode UploadNewParamsUploadMode `json:"upload_mode,omitzero"`
// contains filtered or unexported fields
}
func (UploadNewParams) MarshalJSON ¶ added in v0.6.0
func (r UploadNewParams) MarshalJSON() (data []byte, err error)
func (*UploadNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *UploadNewParams) UnmarshalJSON(data []byte) error
type UploadNewParamsUploadMode ¶ added in v0.17.0
type UploadNewParamsUploadMode string
UploadMode specifies the transfer method. Defaults to auto. Auto chooses multipart above 100 MiB and single PUT at or below 100 MiB for every Storage provider. Multipart requires a provider that supports the required multipart operations and signed part URLs. Provider failures return an error without falling back to single PUT.
const ( UploadNewParamsUploadModeSingle UploadNewParamsUploadMode = "single" UploadNewParamsUploadModeMultipart UploadNewParamsUploadMode = "multipart" UploadNewParamsUploadModeAuto UploadNewParamsUploadMode = "auto" )
type UploadNewResponseEnvelope ¶ added in v0.6.0
type UploadNewResponseEnvelope struct {
// Data contains the response object
Data Upload `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UploadNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r UploadNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*UploadNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *UploadNewResponseEnvelope) UnmarshalJSON(data []byte) error
type UploadService ¶ added in v0.6.0
type UploadService struct {
Options []option.RequestOption
}
UploadService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUploadService method instead.
func NewUploadService ¶ added in v0.6.0
func NewUploadService(opts ...option.RequestOption) (r UploadService)
NewUploadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*UploadService) Complete ¶ added in v0.16.3
func (r *UploadService) Complete(ctx context.Context, token string, body UploadCompleteParams, opts ...option.RequestOption) (err error)
POST the returned completion_url before expires_at. Single-PUT Uploads send no body; multipart Uploads send every part number and storage ETag. Chunkify verifies the assembled object and atomically creates the Source and optional Asset. An Asset destination conflict returns 409 and fails the Upload without committing Source, Asset, or usage changes. Valid retries return 204 without duplicate side effects. Retry network errors, 429, and 5xx responses with bounded backoff.
func (*UploadService) Delete ¶ added in v0.6.0
func (r *UploadService) Delete(ctx context.Context, uploadID string, opts ...option.RequestOption) (err error)
Delete an upload.
func (*UploadService) Get ¶ added in v0.6.0
func (r *UploadService) Get(ctx context.Context, uploadID string, opts ...option.RequestOption) (res *Upload, err error)
Retrieve details of a specific upload by its ID, including metadata, status, and associated source.
func (*UploadService) List ¶ added in v0.6.0
func (r *UploadService) List(ctx context.Context, query UploadListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Upload], err error)
Retrieve a list of all uploads with optional filtering and pagination.
func (*UploadService) ListAutoPaging ¶ added in v0.6.0
func (r *UploadService) ListAutoPaging(ctx context.Context, query UploadListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Upload]
Retrieve a list of all uploads with optional filtering and pagination.
func (*UploadService) New ¶ added in v0.6.0
func (r *UploadService) New(ctx context.Context, body UploadNewParams, opts ...option.RequestOption) (res *Upload, err error)
Create an Upload session for a direct transfer to storage. Multipart creation returns every signed part URL. Retry parts with their original URLs and complete before expiry. Customer storage requires long-lived credentials and an incomplete-multipart lifecycle rule. Start a new Upload after abandoning a session.
type UploadStatus ¶ added in v0.6.0
type UploadStatus string
Current status of the upload
const ( UploadStatusWaiting UploadStatus = "waiting" UploadStatusCompleted UploadStatus = "completed" UploadStatusFailed UploadStatus = "failed" UploadStatusExpired UploadStatus = "expired" )
type UploadUploadMode ¶ added in v0.17.0
type UploadUploadMode string
Resolved transfer mode for this Upload.
const ( UploadUploadModeSingle UploadUploadMode = "single" UploadUploadModeMultipart UploadUploadMode = "multipart" )
type Webhook ¶
type Webhook struct {
// Unique identifier of the webhook
ID string `json:"id" api:"required"`
// Whether the webhook is currently enabled
Enabled bool `json:"enabled" api:"required"`
// Array of event types this webhook subscribes to
Events []WebhookEvent `json:"events" api:"required"`
// ID of the project this webhook belongs to
ProjectID string `json:"project_id" api:"required"`
// URL where webhook events will be sent
URL string `json:"url" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Enabled respjson.Field
Events respjson.Field
ProjectID respjson.Field
URL respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*Webhook) UnmarshalJSON ¶ added in v0.6.0
type WebhookEvent ¶ added in v1.0.0
type WebhookEvent string
const ( WebhookEventJobCreated WebhookEvent = "job.created" WebhookEventJobCompleted WebhookEvent = "job.completed" WebhookEventJobFailed WebhookEvent = "job.failed" WebhookEventJobCancelled WebhookEvent = "job.cancelled" WebhookEventSourceCreated WebhookEvent = "source.created" WebhookEventSourceDeleted WebhookEvent = "source.deleted" WebhookEventUploadCreated WebhookEvent = "upload.created" WebhookEventUploadCompleted WebhookEvent = "upload.completed" WebhookEventUploadFailed WebhookEvent = "upload.failed" WebhookEventUploadExpired WebhookEvent = "upload.expired" WebhookEventAssetCreated WebhookEvent = "asset.created" WebhookEventAssetReady WebhookEvent = "asset.ready" WebhookEventAssetPlaybackReady WebhookEvent = "asset.playback_ready" WebhookEventAssetFailed WebhookEvent = "asset.failed" WebhookEventAssetExpired WebhookEvent = "asset.expired" WebhookEventAssetDeleted WebhookEvent = "asset.deleted" WebhookEventAssetOutputCreated WebhookEvent = "asset.output.created" WebhookEventAssetOutputReady WebhookEvent = "asset.output.ready" WebhookEventAssetOutputFailed WebhookEvent = "asset.output.failed" WebhookEventAssetOutputDeleted WebhookEvent = "asset.output.deleted" WebhookEventWorkflowRunCreated WebhookEvent = "workflow_run.created" WebhookEventWorkflowRunCompleted WebhookEvent = "workflow_run.completed" WebhookEventWorkflowRunFailed WebhookEvent = "workflow_run.failed" WebhookEventWorkflowRunCancelled WebhookEvent = "workflow_run.cancelled" WebhookEventTranscodingCreated WebhookEvent = "transcoding.created" WebhookEventTranscodingReady WebhookEvent = "transcoding.ready" WebhookEventTranscodingFailed WebhookEvent = "transcoding.failed" WebhookEventTranscodingCancelled WebhookEvent = "transcoding.cancelled" WebhookEventTranscodingExpired WebhookEvent = "transcoding.expired" WebhookEventTranscodingDeleted WebhookEvent = "transcoding.deleted" WebhookEventThumbnailCreated WebhookEvent = "thumbnail.created" WebhookEventThumbnailReady WebhookEvent = "thumbnail.ready" WebhookEventThumbnailFailed WebhookEvent = "thumbnail.failed" WebhookEventThumbnailExpired WebhookEvent = "thumbnail.expired" WebhookEventThumbnailDeleted WebhookEvent = "thumbnail.deleted" )
type WebhookGetResponseEnvelope ¶ added in v0.6.0
type WebhookGetResponseEnvelope struct {
// Data contains the response object
Data Webhook `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookGetResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r WebhookGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookGetResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *WebhookGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WebhookListResponse ¶ added in v0.6.0
type WebhookListResponse struct {
// Data contains the webhook items
Data []Webhook `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing the list of all webhooks for a project
func (WebhookListResponse) RawJSON ¶ added in v0.6.0
func (r WebhookListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookListResponse) UnmarshalJSON ¶ added in v0.6.0
func (r *WebhookListResponse) UnmarshalJSON(data []byte) error
type WebhookNewParams ¶ added in v0.6.0
type WebhookNewParams struct {
// Url is the endpoint that will receive webhook notifications, which must be a
// valid HTTP URL.
URL string `json:"url" api:"required"`
// Enabled indicates whether the webhook is active.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Events specifies the types of events that will trigger the webhook.
Events []WebhookEvent `json:"events,omitzero"`
// contains filtered or unexported fields
}
func (WebhookNewParams) MarshalJSON ¶ added in v0.6.0
func (r WebhookNewParams) MarshalJSON() (data []byte, err error)
func (*WebhookNewParams) UnmarshalJSON ¶ added in v0.6.0
func (r *WebhookNewParams) UnmarshalJSON(data []byte) error
type WebhookNewResponseEnvelope ¶ added in v0.6.0
type WebhookNewResponseEnvelope struct {
// Data contains the response object
Data Webhook `json:"data" api:"required"`
// Status indicates the response status "success"
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebhookNewResponseEnvelope) RawJSON ¶ added in v0.6.0
func (r WebhookNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WebhookNewResponseEnvelope) UnmarshalJSON ¶ added in v0.6.0
func (r *WebhookNewResponseEnvelope) UnmarshalJSON(data []byte) error
type WebhookService ¶ added in v0.6.0
type WebhookService struct {
Options []option.RequestOption
}
WebhookService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶ added in v0.6.0
func NewWebhookService(opts ...option.RequestOption) (r WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Delete ¶ added in v0.6.0
func (r *WebhookService) Delete(ctx context.Context, webhookID string, opts ...option.RequestOption) (err error)
Permanently delete a webhook configuration. The webhook must belong to the current project. This action cannot be undone.
func (*WebhookService) Get ¶ added in v0.6.0
func (r *WebhookService) Get(ctx context.Context, webhookID string, opts ...option.RequestOption) (res *Webhook, err error)
Retrieve details of a specific webhook configuration by its ID. The webhook must belong to the current project.
func (*WebhookService) List ¶ added in v0.6.0
func (r *WebhookService) List(ctx context.Context, opts ...option.RequestOption) (res *WebhookListResponse, err error)
Retrieve a list of all webhooks configured for the current project. Each webhook includes its URL, enabled status, and subscribed events.
func (*WebhookService) New ¶ added in v0.6.0
func (r *WebhookService) New(ctx context.Context, body WebhookNewParams, opts ...option.RequestOption) (res *Webhook, err error)
Create a new webhook for a project. The webhook will receive notifications for specified events.
func (*WebhookService) Unwrap ¶ added in v0.6.0
func (r *WebhookService) Unwrap(payload []byte, headers http.Header, opts ...option.RequestOption) (*UnwrapWebhookEventUnion, 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.
Events []WebhookEvent `json:"events,omitzero"`
// contains filtered or unexported fields
}
func (WebhookUpdateParams) MarshalJSON ¶ added in v0.6.0
func (r WebhookUpdateParams) MarshalJSON() (data []byte, err error)
func (*WebhookUpdateParams) UnmarshalJSON ¶ added in v0.6.0
func (r *WebhookUpdateParams) UnmarshalJSON(data []byte) error
type WebmVp9 ¶ added in v0.6.0
type WebmVp9 struct {
ID constant.WebmVp9 `json:"id" default:"webm_vp9"`
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate int64 `json:"audio_bitrate"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize int64 `json:"bufsize"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels"`
// CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower
// values mean better quality but slower encoding, higher values mean faster
// encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for
// good quality, 4-6 for balanced, 6-8 for speed
//
// Any of "0", "1", "2", "3", "4", "5", "6", "7", "8".
CPUUsed WebmVp9CPUUsed `json:"cpu_used"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 15 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf int64 `json:"crf"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio bool `json:"disable_audio"`
// DisableVideo indicates whether to disable video processing.
DisableVideo bool `json:"disable_video"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration int64 `json:"duration"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate float64 `json:"framerate"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop int64 `json:"gop"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height int64 `json:"height"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate int64 `json:"maxrate"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate int64 `json:"minrate"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle bool `json:"per_title"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt WebmVp9Pixfmt `json:"pixfmt"`
// Quality specifies the VP9 encoding quality preset. Valid values:
//
// - good: Balanced quality preset, good for most applications
// - best: Best quality preset, slower encoding
// - realtime: Fast encoding preset, suitable for live streaming
//
// Any of "good", "best", "realtime".
Quality WebmVp9Quality `json:"quality"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek int64 `json:"seek"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate int64 `json:"video_bitrate"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width int64 `json:"width"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AudioBitrate respjson.Field
Bufsize respjson.Field
Channels respjson.Field
CPUUsed respjson.Field
Crf respjson.Field
DisableAudio respjson.Field
DisableVideo respjson.Field
Duration respjson.Field
Framerate respjson.Field
Gop respjson.Field
Height respjson.Field
Maxrate respjson.Field
Minrate respjson.Field
PerTitle respjson.Field
Pixfmt respjson.Field
Quality respjson.Field
Seek respjson.Field
VideoBitrate respjson.Field
Width respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (WebmVp9) 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
type WebmVp9CPUUsed ¶ added in v0.6.0
type WebmVp9CPUUsed string
CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower values mean better quality but slower encoding, higher values mean faster encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for good quality, 4-6 for balanced, 6-8 for speed
const ( WebmVp9CPUUsed0 WebmVp9CPUUsed = "0" WebmVp9CPUUsed1 WebmVp9CPUUsed = "1" WebmVp9CPUUsed2 WebmVp9CPUUsed = "2" WebmVp9CPUUsed3 WebmVp9CPUUsed = "3" WebmVp9CPUUsed4 WebmVp9CPUUsed = "4" WebmVp9CPUUsed5 WebmVp9CPUUsed = "5" WebmVp9CPUUsed6 WebmVp9CPUUsed = "6" WebmVp9CPUUsed7 WebmVp9CPUUsed = "7" WebmVp9CPUUsed8 WebmVp9CPUUsed = "8" )
type WebmVp9Param ¶ added in v0.6.0
type WebmVp9Param struct {
// AudioBitrate specifies the audio bitrate in bits per second. Must be between
// 32Kbps and 512Kbps.
AudioBitrate param.Opt[int64] `json:"audio_bitrate,omitzero"`
// Bufsize specifies the video buffer size in bits. Must be between 100Kbps and
// 50Mbps.
Bufsize param.Opt[int64] `json:"bufsize,omitzero"`
// Crf (Constant Rate Factor) controls the quality of the output video. Lower
// values mean better quality but larger file size. Range: 15 to 35. Recommended
// values: 18-28 for high quality, 23-28 for good quality, 28-35 for acceptable
// quality.
Crf param.Opt[int64] `json:"crf,omitzero"`
// DisableAudio indicates whether to disable audio processing.
DisableAudio param.Opt[bool] `json:"disable_audio,omitzero"`
// DisableVideo indicates whether to disable video processing.
DisableVideo param.Opt[bool] `json:"disable_video,omitzero"`
// Duration specifies the duration to process in seconds. Must be a positive value.
Duration param.Opt[int64] `json:"duration,omitzero"`
// Framerate specifies the output video frame rate. Must be greater than zero and
// at most 240 fps.
Framerate param.Opt[float64] `json:"framerate,omitzero"`
// Gop specifies the Group of Pictures (GOP) size. Must be between 1 and 960
// frames.
Gop param.Opt[int64] `json:"gop,omitzero"`
// Height specifies the output video height in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Height param.Opt[int64] `json:"height,omitzero"`
// Maxrate specifies the maximum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Maxrate param.Opt[int64] `json:"maxrate,omitzero"`
// Minrate specifies the minimum video bitrate in bits per second. Must be between
// 100Kbps and 50Mbps.
Minrate param.Opt[int64] `json:"minrate,omitzero"`
// Enables per-title optimization. Disabled by default. Set it to true to let
// Chunkify select rate control automatically. When enabled, explicit rate-control
// fields cannot be provided. For HLS outputs, either audio_bitrate or
// video_bitrate is required when per-title optimization is disabled or omitted.
PerTitle param.Opt[bool] `json:"per_title,omitzero"`
// Seek specifies the timestamp to start processing from (in seconds). Must be a
// positive value.
Seek param.Opt[int64] `json:"seek,omitzero"`
// VideoBitrate specifies the video bitrate in bits per second. Must be between 1
// bps and 100 Mbps.
VideoBitrate param.Opt[int64] `json:"video_bitrate,omitzero"`
// Width specifies the output video width in pixels. Must be between -2 and 7680.
// Use -2 for automatic calculation while maintaining aspect ratio.
Width param.Opt[int64] `json:"width,omitzero"`
// Channels specifies the number of audio channels. Valid values: 1 (mono), 2
// (stereo), 5 (5.1), 7 (7.1)
//
// Any of 1, 2, 5, 7.
Channels int64 `json:"channels,omitzero"`
// CpuUsed specifies the CPU usage level for VP9 encoding. Range: 0 to 8. Lower
// values mean better quality but slower encoding, higher values mean faster
// encoding but lower quality. Recommended values: 0-2 for high quality, 2-4 for
// good quality, 4-6 for balanced, 6-8 for speed
//
// Any of "0", "1", "2", "3", "4", "5", "6", "7", "8".
CPUUsed WebmVp9CPUUsed `json:"cpu_used,omitzero"`
// PixFmt specifies the pixel format. Valid value: yuv420p
//
// Any of "yuv410p", "yuv411p", "yuv420p", "yuv422p", "yuv440p", "yuv444p",
// "yuvJ411p", "yuvJ420p", "yuvJ422p", "yuvJ440p", "yuvJ444p", "yuv420p10le",
// "yuv422p10le", "yuv440p10le", "yuv444p10le", "yuv420p12le", "yuv422p12le",
// "yuv440p12le", "yuv444p12le", "yuv420p10be", "yuv422p10be", "yuv440p10be",
// "yuv444p10be", "yuv420p12be", "yuv422p12be", "yuv440p12be", "yuv444p12be".
Pixfmt WebmVp9Pixfmt `json:"pixfmt,omitzero"`
// Quality specifies the VP9 encoding quality preset. Valid values:
//
// - good: Balanced quality preset, good for most applications
// - best: Best quality preset, slower encoding
// - realtime: Fast encoding preset, suitable for live streaming
//
// Any of "good", "best", "realtime".
Quality WebmVp9Quality `json:"quality,omitzero"`
// This field can be elided, and will marshal its zero value as "webm_vp9".
ID constant.WebmVp9 `json:"id" default:"webm_vp9"`
// contains filtered or unexported fields
}
The property ID is required.
func (WebmVp9Param) MarshalJSON ¶ added in v0.6.0
func (r WebmVp9Param) MarshalJSON() (data []byte, err error)
func (*WebmVp9Param) UnmarshalJSON ¶ added in v0.6.0
func (r *WebmVp9Param) UnmarshalJSON(data []byte) error
type WebmVp9Pixfmt ¶ added in v0.6.0
type WebmVp9Pixfmt string
PixFmt specifies the pixel format. Valid value: yuv420p
const ( WebmVp9PixfmtYuv410p WebmVp9Pixfmt = "yuv410p" WebmVp9PixfmtYuv411p WebmVp9Pixfmt = "yuv411p" WebmVp9PixfmtYuv420p WebmVp9Pixfmt = "yuv420p" WebmVp9PixfmtYuv422p WebmVp9Pixfmt = "yuv422p" WebmVp9PixfmtYuv440p WebmVp9Pixfmt = "yuv440p" WebmVp9PixfmtYuv444p WebmVp9Pixfmt = "yuv444p" WebmVp9PixfmtYuvJ411p WebmVp9Pixfmt = "yuvJ411p" WebmVp9PixfmtYuvJ420p WebmVp9Pixfmt = "yuvJ420p" WebmVp9PixfmtYuvJ422p WebmVp9Pixfmt = "yuvJ422p" WebmVp9PixfmtYuvJ440p WebmVp9Pixfmt = "yuvJ440p" WebmVp9PixfmtYuvJ444p WebmVp9Pixfmt = "yuvJ444p" WebmVp9PixfmtYuv420p10le WebmVp9Pixfmt = "yuv420p10le" WebmVp9PixfmtYuv422p10le WebmVp9Pixfmt = "yuv422p10le" WebmVp9PixfmtYuv440p10le WebmVp9Pixfmt = "yuv440p10le" WebmVp9PixfmtYuv444p10le WebmVp9Pixfmt = "yuv444p10le" WebmVp9PixfmtYuv420p12le WebmVp9Pixfmt = "yuv420p12le" WebmVp9PixfmtYuv422p12le WebmVp9Pixfmt = "yuv422p12le" WebmVp9PixfmtYuv440p12le WebmVp9Pixfmt = "yuv440p12le" WebmVp9PixfmtYuv444p12le WebmVp9Pixfmt = "yuv444p12le" WebmVp9PixfmtYuv420p10be WebmVp9Pixfmt = "yuv420p10be" WebmVp9PixfmtYuv422p10be WebmVp9Pixfmt = "yuv422p10be" WebmVp9PixfmtYuv440p10be WebmVp9Pixfmt = "yuv440p10be" WebmVp9PixfmtYuv444p10be WebmVp9Pixfmt = "yuv444p10be" WebmVp9PixfmtYuv420p12be WebmVp9Pixfmt = "yuv420p12be" WebmVp9PixfmtYuv422p12be WebmVp9Pixfmt = "yuv422p12be" WebmVp9PixfmtYuv440p12be WebmVp9Pixfmt = "yuv440p12be" WebmVp9PixfmtYuv444p12be WebmVp9Pixfmt = "yuv444p12be" )
type WebmVp9Quality ¶ added in v0.6.0
type WebmVp9Quality string
Quality specifies the VP9 encoding quality preset. Valid values:
- good: Balanced quality preset, good for most applications - best: Best quality preset, slower encoding - realtime: Fast encoding preset, suitable for live streaming
const ( WebmVp9QualityGood WebmVp9Quality = "good" WebmVp9QualityBest WebmVp9Quality = "best" WebmVp9QualityRealtime WebmVp9Quality = "realtime" )
type Workflow ¶ added in v0.17.0
type Workflow struct {
// Unique Workflow ID.
ID string `json:"id" api:"required"`
// When the Workflow was archived, or null if it is available for selection.
// Archiving stops new runs; accepted actions finish.
ArchivedAt time.Time `json:"archived_at" api:"required" format:"date-time"`
// When the Workflow was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Name specifies the Workflow name. Use 1 to 128 characters.
Name string `json:"name" api:"required"`
// Current definition revision. Starts at 1 and increases when rules are replaced.
Revision int64 `json:"revision" api:"required"`
// Rules specifies the event subscriptions and actions in this definition. Provide
// exactly one asset.ready rule and up to 15 connected rules, with at most 32
// actions and 65536 encoded bytes across all rules. Array order affects display
// only.
Rules []WorkflowRule `json:"rules" api:"required"`
// SchemaVersion specifies the Workflow definition format. The supported version
// is 1.
SchemaVersion int64 `json:"schema_version" api:"required"`
// When the Workflow was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ArchivedAt respjson.Field
CreatedAt respjson.Field
Name respjson.Field
Revision respjson.Field
Rules respjson.Field
SchemaVersion respjson.Field
UpdatedAt respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A reusable definition of actions triggered by Asset events.
func (*Workflow) UnmarshalJSON ¶ added in v0.17.0
type WorkflowActionCounts ¶ added in v1.0.0
type WorkflowActionCounts struct {
// Number of actions cancelled before completion.
Cancelled int64 `json:"cancelled" api:"required"`
// Number of actions that completed successfully, including reused outputs.
Completed int64 `json:"completed" api:"required"`
// Number of actions that failed.
Failed int64 `json:"failed" api:"required"`
// Number of completed actions that reused an existing output. Included in
// completed.
Reused int64 `json:"reused" api:"required"`
// Number of actions skipped without producing an output.
Skipped int64 `json:"skipped" api:"required"`
// Total number of actions in the run, including unfinished actions.
Total int64 `json:"total" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cancelled respjson.Field
Completed respjson.Field
Failed respjson.Field
Reused respjson.Field
Skipped respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Counts of action outcomes in this run.
func (WorkflowActionCounts) RawJSON ¶ added in v1.0.0
func (r WorkflowActionCounts) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowActionCounts) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowActionCounts) UnmarshalJSON(data []byte) error
type WorkflowActionParamsUnion ¶ added in v1.0.0
type WorkflowActionParamsUnion struct {
OfCreateStaticRendition *WorkflowStaticActionParams `json:",omitzero,inline"`
OfCreateCaption *WorkflowCaptionActionParams `json:",omitzero,inline"`
OfTranslateCaption *WorkflowTranslationActionParams `json:",omitzero,inline"`
OfCreateThumbnails *WorkflowThumbnailActionParams `json:",omitzero,inline"`
OfCreateTranscript *WorkflowTranscriptActionParams `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 WorkflowActionParamsOfCreateCaption ¶ added in v1.0.0
func WorkflowActionParamsOfCreateCaption(id string, params WorkflowCaptionParams) WorkflowActionParamsUnion
func WorkflowActionParamsOfCreateStaticRendition ¶ added in v1.0.0
func WorkflowActionParamsOfCreateStaticRendition(id string, params WorkflowStaticParams) WorkflowActionParamsUnion
func WorkflowActionParamsOfCreateThumbnails ¶ added in v1.0.0
func WorkflowActionParamsOfCreateThumbnails(id string, params WorkflowThumbnailParams) WorkflowActionParamsUnion
func WorkflowActionParamsOfCreateTranscript ¶ added in v1.0.0
func WorkflowActionParamsOfCreateTranscript(id string, params WorkflowTranscriptParams) WorkflowActionParamsUnion
func WorkflowActionParamsOfTranslateCaption ¶ added in v1.0.0
func WorkflowActionParamsOfTranslateCaption(captionID WorkflowOutputBindingParams, id string, params WorkflowTranslationParams) WorkflowActionParamsUnion
func (WorkflowActionParamsUnion) GetCaptionID ¶ added in v1.0.0
func (u WorkflowActionParamsUnion) GetCaptionID() *WorkflowOutputBindingParams
Returns a pointer to the underlying variant's property, if present.
func (WorkflowActionParamsUnion) GetID ¶ added in v1.0.0
func (u WorkflowActionParamsUnion) GetID() *string
Returns a pointer to the underlying variant's property, if present.
func (WorkflowActionParamsUnion) GetParams ¶ added in v1.0.0
func (u WorkflowActionParamsUnion) GetParams() (res workflowActionParamsUnionParams)
Returns a subunion which exports methods to access subproperties
Or use AsAny() to get the underlying value
func (WorkflowActionParamsUnion) GetTranscriptID ¶ added in v1.0.0
func (u WorkflowActionParamsUnion) GetTranscriptID() *WorkflowOutputBindingParams
Returns a pointer to the underlying variant's property, if present.
func (WorkflowActionParamsUnion) GetType ¶ added in v1.0.0
func (u WorkflowActionParamsUnion) GetType() *string
Returns a pointer to the underlying variant's property, if present.
func (WorkflowActionParamsUnion) MarshalJSON ¶ added in v1.0.0
func (u WorkflowActionParamsUnion) MarshalJSON() ([]byte, error)
func (*WorkflowActionParamsUnion) UnmarshalJSON ¶ added in v1.0.0
func (u *WorkflowActionParamsUnion) UnmarshalJSON(data []byte) error
type WorkflowActionUnion ¶ added in v0.17.0
type WorkflowActionUnion struct {
ID string `json:"id"`
// This field is a union of [WorkflowStatic], [WorkflowCaption],
// [WorkflowTranslation], [WorkflowThumbnail], [WorkflowTranscript]
Params WorkflowActionUnionParams `json:"params"`
// Any of "create_static_rendition", "create_caption", "translate_caption",
// "create_thumbnails", "create_transcript".
Type string `json:"type"`
// This field is from variant [WorkflowCaptionAction].
TranscriptID WorkflowOutputBinding `json:"transcript_id"`
// This field is from variant [WorkflowTranslationAction].
CaptionID WorkflowOutputBinding `json:"caption_id"`
JSON struct {
ID respjson.Field
Params respjson.Field
Type respjson.Field
TranscriptID respjson.Field
CaptionID respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
WorkflowActionUnion contains all possible properties and values from WorkflowStaticAction, WorkflowCaptionAction, WorkflowTranslationAction, WorkflowThumbnailAction, WorkflowTranscriptAction.
Use the WorkflowActionUnion.AsAny method to switch on the variant.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (WorkflowActionUnion) AsAny ¶ added in v0.17.0
func (u WorkflowActionUnion) AsAny() anyWorkflowAction
Use the following switch statement to find the correct variant
switch variant := WorkflowActionUnion.AsAny().(type) {
case chunkify.WorkflowStaticAction:
case chunkify.WorkflowCaptionAction:
case chunkify.WorkflowTranslationAction:
case chunkify.WorkflowThumbnailAction:
case chunkify.WorkflowTranscriptAction:
default:
fmt.Errorf("no variant present")
}
func (WorkflowActionUnion) AsCreateCaption ¶ added in v0.17.0
func (u WorkflowActionUnion) AsCreateCaption() (v WorkflowCaptionAction)
func (WorkflowActionUnion) AsCreateStaticRendition ¶ added in v0.17.0
func (u WorkflowActionUnion) AsCreateStaticRendition() (v WorkflowStaticAction)
func (WorkflowActionUnion) AsCreateThumbnails ¶ added in v0.17.0
func (u WorkflowActionUnion) AsCreateThumbnails() (v WorkflowThumbnailAction)
func (WorkflowActionUnion) AsCreateTranscript ¶ added in v0.17.0
func (u WorkflowActionUnion) AsCreateTranscript() (v WorkflowTranscriptAction)
func (WorkflowActionUnion) AsTranslateCaption ¶ added in v0.17.0
func (u WorkflowActionUnion) AsTranslateCaption() (v WorkflowTranslationAction)
func (WorkflowActionUnion) RawJSON ¶ added in v0.17.0
func (u WorkflowActionUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowActionUnion) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowActionUnion) UnmarshalJSON(data []byte) error
type WorkflowActionUnionParams ¶ added in v0.17.0
type WorkflowActionUnionParams struct {
// This field is from variant [WorkflowStatic].
Resolution WorkflowStaticResolution `json:"resolution"`
// This field is from variant [WorkflowTranslation].
LanguageCode WorkflowTranslationLanguageCode `json:"language_code"`
// This field is from variant [WorkflowThumbnail].
Count int64 `json:"count"`
// This field is from variant [WorkflowThumbnail].
Format ThumbnailFormat `json:"format"`
// This field is from variant [WorkflowThumbnail].
Metadata map[string]string `json:"metadata"`
// This field is from variant [WorkflowThumbnail].
Output ThumbnailOutput `json:"output"`
// This field is from variant [WorkflowThumbnail].
Range WorkflowThumbnailRange `json:"range"`
// This field is from variant [WorkflowThumbnail].
Size int64 `json:"size"`
// This field is from variant [WorkflowThumbnail].
Timestamps []float64 `json:"timestamps"`
JSON struct {
Resolution respjson.Field
LanguageCode respjson.Field
Count respjson.Field
Format respjson.Field
Metadata respjson.Field
Output respjson.Field
Range respjson.Field
Size respjson.Field
Timestamps respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
WorkflowActionUnionParams is an implicit subunion of WorkflowActionUnion. WorkflowActionUnionParams provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the WorkflowActionUnion.
func (*WorkflowActionUnionParams) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowActionUnionParams) UnmarshalJSON(data []byte) error
type WorkflowCaption ¶ added in v1.0.0
type WorkflowCaption struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for generating original captions. Pass an empty object; the spoken language is detected automatically.
func (WorkflowCaption) RawJSON ¶ added in v1.0.0
func (r WorkflowCaption) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowCaption) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowCaption) UnmarshalJSON(data []byte) error
type WorkflowCaptionAction ¶ added in v0.17.0
type WorkflowCaptionAction struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Params specifies caption generation settings. Pass an empty object.
Params WorkflowCaption `json:"params" api:"required"`
// Type specifies the action to perform. Must be create_caption.
Type constant.CreateCaption `json:"type" default:"create_caption"`
// TranscriptId binds caption publication to the transcript in the triggering
// event. Use it only when connected to create_transcript. When omitted, creates or
// reuses the Asset’s original transcript.
TranscriptID WorkflowOutputBinding `json:"transcript_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Params respjson.Field
Type respjson.Field
TranscriptID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Generates or reuses original captions and their transcript from the Asset's speech.
func (WorkflowCaptionAction) RawJSON ¶ added in v0.17.0
func (r WorkflowCaptionAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowCaptionAction) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowCaptionAction) UnmarshalJSON(data []byte) error
type WorkflowCaptionActionParams ¶ added in v1.0.0
type WorkflowCaptionActionParams struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Params specifies caption generation settings. Pass an empty object.
Params WorkflowCaptionParams `json:"params" api:"required"`
// TranscriptId binds caption publication to the transcript in the triggering
// event. Use it only when connected to create_transcript. When omitted, creates or
// reuses the Asset’s original transcript.
TranscriptID WorkflowOutputBindingParams `json:"transcript_id,omitzero"`
// Type specifies the action to perform. Must be create_caption.
//
// This field can be elided, and will marshal its zero value as "create_caption".
Type constant.CreateCaption `json:"type" default:"create_caption"`
// contains filtered or unexported fields
}
Generates or reuses original captions and their transcript from the Asset's speech.
The properties ID, Params, Type are required.
func (WorkflowCaptionActionParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowCaptionActionParams) MarshalJSON() (data []byte, err error)
func (*WorkflowCaptionActionParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowCaptionActionParams) UnmarshalJSON(data []byte) error
type WorkflowCaptionParams ¶ added in v0.17.0
type WorkflowCaptionParams struct {
// contains filtered or unexported fields
}
Parameters for generating original captions. Pass an empty object; the spoken language is detected automatically.
func (WorkflowCaptionParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowCaptionParams) MarshalJSON() (data []byte, err error)
func (*WorkflowCaptionParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowCaptionParams) UnmarshalJSON(data []byte) error
type WorkflowGetResponseEnvelope ¶ added in v0.17.0
type WorkflowGetResponseEnvelope struct {
// The requested Workflow.
Data Workflow `json:"data" api:"required"`
// Status of the API request. Always success for this response.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing one Workflow.
func (WorkflowGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r WorkflowGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowListParams ¶ added in v0.17.0
type WorkflowListParams struct {
// Archived specifies whether to include archived Workflows. Defaults to false.
Archived param.Opt[bool] `query:"archived,omitzero" json:"-"`
// Limit specifies the maximum number of results to return. Accepts 1 to 100.
// Defaults to 100.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Offset specifies the number of matching results to skip. Must be at least 0.
// Defaults to 0.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowListParams) URLQuery ¶ added in v0.17.0
func (r WorkflowListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowListParams's query parameters as `url.Values`.
type WorkflowNewParams ¶ added in v0.17.0
type WorkflowNewParams struct {
// Name specifies the Workflow name. Use 1 to 128 characters.
Name string `json:"name" api:"required"`
// Rules specifies the event subscriptions and actions in this definition. Provide
// exactly one asset.ready rule and up to 15 connected rules, with at most 32
// actions and 65536 encoded bytes across all rules. Array order affects display
// only.
Rules []WorkflowRuleParams `json:"rules,omitzero" api:"required"`
// SchemaVersion specifies the Workflow definition format. The supported version
// is 1.
//
// Any of 1.
SchemaVersion int64 `json:"schema_version,omitzero" api:"required"`
// contains filtered or unexported fields
}
func (WorkflowNewParams) MarshalJSON ¶ added in v0.17.0
func (r WorkflowNewParams) MarshalJSON() (data []byte, err error)
func (*WorkflowNewParams) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowNewParams) UnmarshalJSON(data []byte) error
type WorkflowNewResponseEnvelope ¶ added in v0.17.0
type WorkflowNewResponseEnvelope struct {
// The requested Workflow.
Data Workflow `json:"data" api:"required"`
// Status of the API request. Always success for this response.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing one Workflow.
func (WorkflowNewResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r WorkflowNewResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowNewResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowNewResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowOrigin ¶ added in v1.0.0
type WorkflowOrigin struct {
// ActionId specifies the ID of the producing action within that rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ActionID string `json:"action_id" api:"required"`
// RuleId specifies the ID of the rule containing the producing action. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
RuleID string `json:"rule_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActionID respjson.Field
RuleID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Connects this rule to the output created or reused by an action in the same Workflow revision.
func (WorkflowOrigin) RawJSON ¶ added in v1.0.0
func (r WorkflowOrigin) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowOrigin) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowOrigin) UnmarshalJSON(data []byte) error
type WorkflowOriginParams ¶ added in v1.0.0
type WorkflowOriginParams struct {
// ActionId specifies the ID of the producing action within that rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ActionID string `json:"action_id" api:"required"`
// RuleId specifies the ID of the rule containing the producing action. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
RuleID string `json:"rule_id" api:"required"`
// contains filtered or unexported fields
}
Connects this rule to the output created or reused by an action in the same Workflow revision.
The properties ActionID, RuleID are required.
func (WorkflowOriginParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowOriginParams) MarshalJSON() (data []byte, err error)
func (*WorkflowOriginParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowOriginParams) UnmarshalJSON(data []byte) error
type WorkflowOutputBinding ¶ added in v1.0.0
type WorkflowOutputBinding struct {
// From specifies where to read the input output ID. Use event.output.id to consume
// the output in the triggering asset.output.ready event.
//
// Any of "event.output.id".
From WorkflowOutputBindingFrom `json:"from" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
From respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Selects the output referenced by the triggering event.
func (WorkflowOutputBinding) RawJSON ¶ added in v1.0.0
func (r WorkflowOutputBinding) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowOutputBinding) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowOutputBinding) UnmarshalJSON(data []byte) error
type WorkflowOutputBindingFrom ¶ added in v1.0.0
type WorkflowOutputBindingFrom string
const (
WorkflowOutputBindingFromEventOutputID WorkflowOutputBindingFrom = "event.output.id"
)
type WorkflowOutputBindingParams ¶ added in v1.0.0
type WorkflowOutputBindingParams struct {
// From specifies where to read the input output ID. Use event.output.id to consume
// the output in the triggering asset.output.ready event.
//
// Any of "event.output.id".
From WorkflowOutputBindingFrom `json:"from,omitzero" api:"required"`
// contains filtered or unexported fields
}
Selects the output referenced by the triggering event.
The property From is required.
func (WorkflowOutputBindingParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowOutputBindingParams) MarshalJSON() (data []byte, err error)
func (*WorkflowOutputBindingParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowOutputBindingParams) UnmarshalJSON(data []byte) error
type WorkflowRevision ¶ added in v0.17.0
type WorkflowRevision struct {
// When this Workflow revision was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Definition revision number, starting at 1.
Revision int64 `json:"revision" api:"required"`
// Rules specifies the event subscriptions and actions in this definition. Provide
// exactly one asset.ready rule and up to 15 connected rules, with at most 32
// actions and 65536 encoded bytes across all rules. Array order affects display
// only.
Rules []WorkflowRule `json:"rules" api:"required"`
// SchemaVersion specifies the Workflow definition format. The supported version
// is 1.
SchemaVersion int64 `json:"schema_version" api:"required"`
// ID of the Workflow that owns this revision.
WorkflowID string `json:"workflow_id" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreatedAt respjson.Field
Revision respjson.Field
Rules respjson.Field
SchemaVersion respjson.Field
WorkflowID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
An immutable Workflow definition pinned to Assets and Uploads at creation.
func (WorkflowRevision) RawJSON ¶ added in v0.17.0
func (r WorkflowRevision) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRevision) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowRevision) UnmarshalJSON(data []byte) error
type WorkflowRevisionGetParams ¶ added in v0.17.0
type WorkflowRevisionGetParams struct {
WorkflowID string `path:"workflowId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type WorkflowRevisionGetResponseEnvelope ¶ added in v0.17.0
type WorkflowRevisionGetResponseEnvelope struct {
// The requested Workflow revision.
Data WorkflowRevision `json:"data" api:"required"`
// Status of the API request. Always success for this response.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing one Workflow revision.
func (WorkflowRevisionGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r WorkflowRevisionGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRevisionGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowRevisionGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowRevisionService ¶ added in v0.17.0
type WorkflowRevisionService struct {
Options []option.RequestOption
}
WorkflowRevisionService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkflowRevisionService method instead.
func NewWorkflowRevisionService ¶ added in v0.17.0
func NewWorkflowRevisionService(opts ...option.RequestOption) (r WorkflowRevisionService)
NewWorkflowRevisionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkflowRevisionService) Get ¶ added in v0.17.0
func (r *WorkflowRevisionService) Get(ctx context.Context, revision int64, query WorkflowRevisionGetParams, opts ...option.RequestOption) (res *WorkflowRevision, err error)
Retrieve an immutable definition revision, including revisions of archived Workflows.
type WorkflowRule ¶ added in v0.17.0
type WorkflowRule struct {
// Id specifies a stable rule key, unique within this Workflow definition. Use 1 to
// 64 characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Actions specifies the work to start when the rule matches. Actions can run
// concurrently; array order does not define execution order. Provide 1 to 32
// actions per rule, with at most 32 across the definition.
Actions []WorkflowActionUnion `json:"actions" api:"required"`
// Event specifies when this rule starts. Use asset.ready for the single starting
// rule. Output ready events require an origin caption or static rendition action
// in this Workflow.
//
// Any of "asset.ready", "asset.output.ready".
Event WorkflowRuleEvent `json:"event" api:"required"`
// Origin specifies the action whose ready output starts this rule. Required for
// asset.output.ready; omit it for asset.ready. Translation steps must connect to a
// create_caption action. References must point to a compatible action in this
// definition and must not form a cycle.
Origin WorkflowOrigin `json:"origin"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Actions respjson.Field
Event respjson.Field
Origin respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
A starting or connected step with one or more independent actions.
func (WorkflowRule) RawJSON ¶ added in v0.17.0
func (r WorkflowRule) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRule) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowRule) UnmarshalJSON(data []byte) error
type WorkflowRuleEvent ¶ added in v0.17.0
type WorkflowRuleEvent string
const ( WorkflowRuleEventAssetReady WorkflowRuleEvent = "asset.ready" WorkflowRuleEventAssetOutputReady WorkflowRuleEvent = "asset.output.ready" )
type WorkflowRuleParams ¶ added in v1.0.0
type WorkflowRuleParams struct {
// Id specifies a stable rule key, unique within this Workflow definition. Use 1 to
// 64 characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Actions specifies the work to start when the rule matches. Actions can run
// concurrently; array order does not define execution order. Provide 1 to 32
// actions per rule, with at most 32 across the definition.
Actions []WorkflowActionParamsUnion `json:"actions,omitzero" api:"required"`
// Event specifies when this rule starts. Use asset.ready for the single starting
// rule. Output ready events require an origin caption or static rendition action
// in this Workflow.
//
// Any of "asset.ready", "asset.output.ready".
Event WorkflowRuleEvent `json:"event,omitzero" api:"required"`
// Origin specifies the action whose ready output starts this rule. Required for
// asset.output.ready; omit it for asset.ready. Translation steps must connect to a
// create_caption action. References must point to a compatible action in this
// definition and must not form a cycle.
Origin WorkflowOriginParams `json:"origin,omitzero"`
// contains filtered or unexported fields
}
A starting or connected step with one or more independent actions.
The properties ID, Actions, Event are required.
func (WorkflowRuleParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowRuleParams) MarshalJSON() (data []byte, err error)
func (*WorkflowRuleParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowRuleParams) UnmarshalJSON(data []byte) error
type WorkflowRun ¶ added in v0.17.0
type WorkflowRun struct {
// Unique Workflow run ID.
ID string `json:"id" api:"required"`
// Counts of action outcomes in this run. Reused actions are included in completed.
Actions WorkflowActionCounts `json:"actions" api:"required"`
// AssetExecutionStatus specifies the combined status of this revision for the
// Asset across retained runs. Any failed action or run makes it failed. Pending or
// active work, or an Asset still preparing for an unarchived Workflow, makes it
// running. Otherwise it is completed.
//
// Any of "pending", "running", "completed", "failed", "cancelled".
AssetExecutionStatus WorkflowRunStatus `json:"asset_execution_status" api:"required"`
// ID of the Asset processed by this run.
AssetID string `json:"asset_id" api:"required"`
// When the run completed, failed, or was cancelled. Null while the run is pending
// or running.
CompletedAt time.Time `json:"completed_at" api:"required" format:"date-time"`
// When the run was created.
CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
// Event specifies the Asset lifecycle event that triggered this run, or manual
// when the Asset was updated to a newer revision. Action details are available
// from the run's actions endpoint.
Event string `json:"event" api:"required"`
// EventId specifies the event that triggered this run. Null when the Asset was
// updated to a newer revision.
EventID string `json:"event_id" api:"required"`
// Pinned Workflow revision used by this run.
Revision int64 `json:"revision" api:"required"`
// ID of the first run in this event chain. Equals id when this run starts the
// chain.
RootRunID string `json:"root_run_id" api:"required"`
// Current status of this event run, based on its own actions.
//
// Any of "pending", "running", "completed", "failed", "cancelled".
Status WorkflowRunStatus `json:"status" api:"required"`
// When the run was last updated.
UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
// ID of the Workflow executed by this run.
WorkflowID string `json:"workflow_id" api:"required"`
// Reason the run failed. Omitted when no failure message is available.
Error string `json:"error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Actions respjson.Field
AssetExecutionStatus respjson.Field
AssetID respjson.Field
CompletedAt respjson.Field
CreatedAt respjson.Field
Event respjson.Field
EventID respjson.Field
Revision respjson.Field
RootRunID respjson.Field
Status respjson.Field
UpdatedAt respjson.Field
WorkflowID respjson.Field
Error respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
One execution of Workflow rules for an Asset, started by an event or by updating to a newer revision.
func (WorkflowRun) RawJSON ¶ added in v0.17.0
func (r WorkflowRun) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRun) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowRun) UnmarshalJSON(data []byte) error
type WorkflowRunActionGetParams ¶ added in v0.17.0
type WorkflowRunActionGetResponseEnvelope ¶ added in v0.17.0
type WorkflowRunActionGetResponseEnvelope struct {
// The requested Asset action run.
Data AssetActionRun `json:"data" api:"required"`
// Status of the API request. Always success for this response.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing one Asset action run.
func (WorkflowRunActionGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r WorkflowRunActionGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRunActionGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowRunActionGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowRunActionListParams ¶ added in v0.17.0
type WorkflowRunActionListParams struct {
WorkflowID string `path:"workflowId" api:"required" json:"-"`
// AssetId specifies the Asset whose results to return. Omit it to include all
// Assets.
AssetID param.Opt[string] `query:"asset_id,omitzero" json:"-"`
// Limit specifies the maximum number of results to return. Accepts 1 to 100.
// Defaults to 100.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Offset specifies the number of matching results to skip. Must be at least 0.
// Defaults to 0.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
Created WorkflowRunActionListParamsCreated `query:"created,omitzero" json:"-"`
// Status specifies the action status to filter by. Omit it to include all
// statuses.
//
// Any of "pending", "running", "waiting", "completed", "failed", "skipped",
// "cancelled".
Status WorkflowRunActionListParamsStatus `query:"status,omitzero" json:"-"`
// Type specifies the action type to filter by. Omit it to include all action
// types.
//
// Any of "create_static_rendition", "create_caption", "create_transcript",
// "translate_caption".
Type WorkflowRunActionListParamsType `query:"type,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowRunActionListParams) URLQuery ¶ added in v0.17.0
func (r WorkflowRunActionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowRunActionListParams's query parameters as `url.Values`.
type WorkflowRunActionListParamsCreated ¶ added in v0.17.0
type WorkflowRunActionListParamsCreated struct {
// Created at or after this Unix timestamp in seconds.
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Created at or before this Unix timestamp in seconds.
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowRunActionListParamsCreated) URLQuery ¶ added in v0.17.0
func (r WorkflowRunActionListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowRunActionListParamsCreated's query parameters as `url.Values`.
type WorkflowRunActionListParamsStatus ¶ added in v0.17.0
type WorkflowRunActionListParamsStatus string
Status specifies the action status to filter by. Omit it to include all statuses.
const ( WorkflowRunActionListParamsStatusPending WorkflowRunActionListParamsStatus = "pending" WorkflowRunActionListParamsStatusRunning WorkflowRunActionListParamsStatus = "running" WorkflowRunActionListParamsStatusWaiting WorkflowRunActionListParamsStatus = "waiting" WorkflowRunActionListParamsStatusCompleted WorkflowRunActionListParamsStatus = "completed" WorkflowRunActionListParamsStatusFailed WorkflowRunActionListParamsStatus = "failed" WorkflowRunActionListParamsStatusSkipped WorkflowRunActionListParamsStatus = "skipped" WorkflowRunActionListParamsStatusCancelled WorkflowRunActionListParamsStatus = "cancelled" )
type WorkflowRunActionListParamsType ¶ added in v0.17.0
type WorkflowRunActionListParamsType string
Type specifies the action type to filter by. Omit it to include all action types.
const ( WorkflowRunActionListParamsTypeCreateStaticRendition WorkflowRunActionListParamsType = "create_static_rendition" WorkflowRunActionListParamsTypeCreateCaption WorkflowRunActionListParamsType = "create_caption" WorkflowRunActionListParamsTypeCreateTranscript WorkflowRunActionListParamsType = "create_transcript" WorkflowRunActionListParamsTypeTranslateCaption WorkflowRunActionListParamsType = "translate_caption" )
type WorkflowRunActionService ¶ added in v0.17.0
type WorkflowRunActionService struct {
Options []option.RequestOption
}
WorkflowRunActionService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkflowRunActionService method instead.
func NewWorkflowRunActionService ¶ added in v0.17.0
func NewWorkflowRunActionService(opts ...option.RequestOption) (r WorkflowRunActionService)
NewWorkflowRunActionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkflowRunActionService) Get ¶ added in v0.17.0
func (r *WorkflowRunActionService) Get(ctx context.Context, actionRunID string, query WorkflowRunActionGetParams, opts ...option.RequestOption) (res *AssetActionRun, err error)
Retrieve one action execution in a retained Workflow run, including its resolved inputs, status, and result.
func (*WorkflowRunActionService) List ¶ added in v0.17.0
func (r *WorkflowRunActionService) List(ctx context.Context, runID string, params WorkflowRunActionListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[AssetActionRun], err error)
List actions in a retained Workflow run, newest first. Includes resolved inputs, statuses, output references, and skip or failure reasons.
func (*WorkflowRunActionService) ListAutoPaging ¶ added in v0.17.0
func (r *WorkflowRunActionService) ListAutoPaging(ctx context.Context, runID string, params WorkflowRunActionListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[AssetActionRun]
List actions in a retained Workflow run, newest first. Includes resolved inputs, statuses, output references, and skip or failure reasons.
type WorkflowRunGetParams ¶ added in v0.17.0
type WorkflowRunGetParams struct {
WorkflowID string `path:"workflowId" api:"required" json:"-"`
// contains filtered or unexported fields
}
type WorkflowRunGetResponseEnvelope ¶ added in v0.17.0
type WorkflowRunGetResponseEnvelope struct {
// The requested Workflow run.
Data WorkflowRun `json:"data" api:"required"`
// Status of the API request. Always success for this response.
Status constant.Success `json:"status" default:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Response containing one Workflow run.
func (WorkflowRunGetResponseEnvelope) RawJSON ¶ added in v0.17.0
func (r WorkflowRunGetResponseEnvelope) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowRunGetResponseEnvelope) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowRunGetResponseEnvelope) UnmarshalJSON(data []byte) error
type WorkflowRunListParams ¶ added in v0.17.0
type WorkflowRunListParams struct {
// AssetId specifies the Asset whose results to return. Omit it to include all
// Assets.
AssetID param.Opt[string] `query:"asset_id,omitzero" json:"-"`
// EventId specifies the triggering event ID to filter by. Omit it to include all
// events.
EventID param.Opt[string] `query:"event_id,omitzero" json:"-"`
// LatestPerAsset specifies whether to return only the latest matching run for each
// Asset. Defaults to false. Pagination and total count apply to Assets when true.
LatestPerAsset param.Opt[bool] `query:"latest_per_asset,omitzero" json:"-"`
// Limit specifies the maximum number of results to return. Accepts 1 to 100.
// Defaults to 100.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Offset specifies the number of matching results to skip. Must be at least 0.
// Defaults to 0.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
Created WorkflowRunListParamsCreated `query:"created,omitzero" json:"-"`
// Status specifies the run status to filter by. Omit it to include all statuses.
//
// Any of "pending", "running", "completed", "failed", "cancelled".
Status WorkflowRunListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowRunListParams) URLQuery ¶ added in v0.17.0
func (r WorkflowRunListParams) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowRunListParams's query parameters as `url.Values`.
type WorkflowRunListParamsCreated ¶ added in v0.17.0
type WorkflowRunListParamsCreated struct {
// Created at or after this Unix timestamp in seconds.
Gte param.Opt[int64] `query:"gte,omitzero" json:"-"`
// Created at or before this Unix timestamp in seconds.
Lte param.Opt[int64] `query:"lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (WorkflowRunListParamsCreated) URLQuery ¶ added in v0.17.0
func (r WorkflowRunListParamsCreated) URLQuery() (v url.Values, err error)
URLQuery serializes WorkflowRunListParamsCreated's query parameters as `url.Values`.
type WorkflowRunListParamsStatus ¶ added in v0.17.0
type WorkflowRunListParamsStatus string
Status specifies the run status to filter by. Omit it to include all statuses.
const ( WorkflowRunListParamsStatusPending WorkflowRunListParamsStatus = "pending" WorkflowRunListParamsStatusRunning WorkflowRunListParamsStatus = "running" WorkflowRunListParamsStatusCompleted WorkflowRunListParamsStatus = "completed" WorkflowRunListParamsStatusFailed WorkflowRunListParamsStatus = "failed" WorkflowRunListParamsStatusCancelled WorkflowRunListParamsStatus = "cancelled" )
type WorkflowRunService ¶ added in v0.17.0
type WorkflowRunService struct {
Options []option.RequestOption
Actions WorkflowRunActionService
}
WorkflowRunService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkflowRunService method instead.
func NewWorkflowRunService ¶ added in v0.17.0
func NewWorkflowRunService(opts ...option.RequestOption) (r WorkflowRunService)
NewWorkflowRunService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkflowRunService) Get ¶ added in v0.17.0
func (r *WorkflowRunService) Get(ctx context.Context, runID string, query WorkflowRunGetParams, opts ...option.RequestOption) (res *WorkflowRun, err error)
Retrieve a retained run with its triggering event, status, and action counts.
func (*WorkflowRunService) List ¶ added in v0.17.0
func (r *WorkflowRunService) List(ctx context.Context, workflowID string, query WorkflowRunListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[WorkflowRun], err error)
List retained runs for this Workflow, newest first. Each run corresponds to one matching Asset event.
func (*WorkflowRunService) ListAutoPaging ¶ added in v0.17.0
func (r *WorkflowRunService) ListAutoPaging(ctx context.Context, workflowID string, query WorkflowRunListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[WorkflowRun]
List retained runs for this Workflow, newest first. Each run corresponds to one matching Asset event.
type WorkflowRunStatus ¶ added in v0.17.0
type WorkflowRunStatus string
Current run status. pending means its actions have not started; running means work remains. After all actions finish, failed takes precedence over cancelled. Otherwise the run is completed, including when actions were skipped.
const ( WorkflowRunStatusPending WorkflowRunStatus = "pending" WorkflowRunStatusRunning WorkflowRunStatus = "running" WorkflowRunStatusCompleted WorkflowRunStatus = "completed" WorkflowRunStatusFailed WorkflowRunStatus = "failed" WorkflowRunStatusCancelled WorkflowRunStatus = "cancelled" )
type WorkflowService ¶ added in v0.17.0
type WorkflowService struct {
Options []option.RequestOption
Revisions WorkflowRevisionService
Runs WorkflowRunService
}
WorkflowService contains methods and other services that help with interacting with the chunkify API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWorkflowService method instead.
func NewWorkflowService ¶ added in v0.17.0
func NewWorkflowService(opts ...option.RequestOption) (r WorkflowService)
NewWorkflowService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WorkflowService) Delete ¶ added in v0.17.0
func (r *WorkflowService) Delete(ctx context.Context, workflowID string, opts ...option.RequestOption) (err error)
Archive the Workflow and clear it from the Project default. New Assets cannot select it and new events do not start runs. Accepted actions finish, and outputs and retained history remain available.
func (*WorkflowService) Get ¶ added in v0.17.0
func (r *WorkflowService) Get(ctx context.Context, workflowID string, opts ...option.RequestOption) (res *Workflow, err error)
Retrieve a Workflow and its current definition, including archived Workflows.
func (*WorkflowService) List ¶ added in v0.17.0
func (r *WorkflowService) List(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) (res *pagination.PaginatedResults[Workflow], err error)
List Workflows in the Project, newest first. Archived Workflows are excluded unless archived is true.
func (*WorkflowService) ListAutoPaging ¶ added in v0.17.0
func (r *WorkflowService) ListAutoPaging(ctx context.Context, query WorkflowListParams, opts ...option.RequestOption) *pagination.PaginatedResultsAutoPager[Workflow]
List Workflows in the Project, newest first. Archived Workflows are excluded unless archived is true.
func (*WorkflowService) New ¶ added in v0.17.0
func (r *WorkflowService) New(ctx context.Context, body WorkflowNewParams, opts ...option.RequestOption) (res *Workflow, err error)
Create a Workflow with its first definition revision. Select it when creating an Asset or Upload, or set it as the Project default.
func (*WorkflowService) Update ¶ added in v0.17.0
func (r *WorkflowService) Update(ctx context.Context, workflowID string, body WorkflowUpdateParams, opts ...option.RequestOption) (err error)
Update the Workflow name or replace its rules. Replacing rules requires the current revision. A changed definition creates a new revision; unchanged rules and name-only edits preserve it. Existing Assets and Uploads keep their selected revision until a ready Asset explicitly updates to the latest revision. Archived Workflows cannot be updated.
type WorkflowStatic ¶ added in v1.0.0
type WorkflowStatic struct {
// Resolution specifies the H.264 MP4 output resolution. highest selects the
// largest supported output without upscaling. Hobby supports up to 1080p; other
// plans support up to 2160p. Streaming resolution limits do not apply.
//
// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
// "2160p".
Resolution WorkflowStaticResolution `json:"resolution" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Resolution respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for creating one static rendition.
func (WorkflowStatic) RawJSON ¶ added in v1.0.0
func (r WorkflowStatic) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowStatic) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowStatic) UnmarshalJSON(data []byte) error
type WorkflowStaticAction ¶ added in v0.17.0
type WorkflowStaticAction struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Params specifies the static rendition resolution.
Params WorkflowStatic `json:"params" api:"required"`
// Type specifies the action to perform. Must be create_static_rendition.
Type constant.CreateStaticRendition `json:"type" default:"create_static_rendition"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Params respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Creates or reuses one static rendition for the Asset.
func (WorkflowStaticAction) RawJSON ¶ added in v0.17.0
func (r WorkflowStaticAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowStaticAction) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowStaticAction) UnmarshalJSON(data []byte) error
type WorkflowStaticActionParams ¶ added in v1.0.0
type WorkflowStaticActionParams struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Params specifies the static rendition resolution.
Params WorkflowStaticParams `json:"params,omitzero" api:"required"`
// Type specifies the action to perform. Must be create_static_rendition.
//
// This field can be elided, and will marshal its zero value as
// "create_static_rendition".
Type constant.CreateStaticRendition `json:"type" default:"create_static_rendition"`
// contains filtered or unexported fields
}
Creates or reuses one static rendition for the Asset.
The properties ID, Params, Type are required.
func (WorkflowStaticActionParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowStaticActionParams) MarshalJSON() (data []byte, err error)
func (*WorkflowStaticActionParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowStaticActionParams) UnmarshalJSON(data []byte) error
type WorkflowStaticParams ¶ added in v0.17.0
type WorkflowStaticParams struct {
// Resolution specifies the H.264 MP4 output resolution. highest selects the
// largest supported output without upscaling. Hobby supports up to 1080p; other
// plans support up to 2160p. Streaming resolution limits do not apply.
//
// Any of "highest", "240p", "360p", "480p", "540p", "720p", "1080p", "1440p",
// "2160p".
Resolution WorkflowStaticResolution `json:"resolution,omitzero" api:"required"`
// contains filtered or unexported fields
}
Parameters for creating one static rendition.
The property Resolution is required.
func (WorkflowStaticParams) MarshalJSON ¶ added in v0.17.0
func (r WorkflowStaticParams) MarshalJSON() (data []byte, err error)
func (*WorkflowStaticParams) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowStaticParams) UnmarshalJSON(data []byte) error
type WorkflowStaticResolution ¶ added in v1.0.0
type WorkflowStaticResolution string
const ( WorkflowStaticResolutionHighest WorkflowStaticResolution = "highest" WorkflowStaticResolution240p WorkflowStaticResolution = "240p" WorkflowStaticResolution360p WorkflowStaticResolution = "360p" WorkflowStaticResolution480p WorkflowStaticResolution = "480p" WorkflowStaticResolution540p WorkflowStaticResolution = "540p" WorkflowStaticResolution720p WorkflowStaticResolution = "720p" WorkflowStaticResolution1080p WorkflowStaticResolution = "1080p" WorkflowStaticResolution1440p WorkflowStaticResolution = "1440p" WorkflowStaticResolution2160p WorkflowStaticResolution = "2160p" )
type WorkflowThumbnail ¶ added in v1.0.0
type WorkflowThumbnail struct {
// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
// selected range.
Count int64 `json:"count"`
// Format selects JPEG or WebP. Defaults to JPEG.
//
// Any of "jpeg", "webp".
Format ThumbnailFormat `json:"format"`
// Metadata attaches string values to this request. The serialized object may
// contain at most 2048 bytes.
Metadata map[string]string `json:"metadata"`
// Output selects images or sprites. Defaults to images.
//
// Any of "images", "sprites".
Output ThumbnailOutput `json:"output"`
// Range limits sampling to part of the Source. Defaults to the whole Source
// duration.
Range WorkflowThumbnailRange `json:"range"`
// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
// cropping or upscaling.
Size int64 `json:"size"`
// Timestamps specifies 1 to 100 Source-relative target times in seconds. Times
// outside the selected range are skipped when the action runs. If none remain, the
// action is skipped without a charge. Repeated targets produce separate outputs.
Timestamps []float64 `json:"timestamps"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
Format respjson.Field
Metadata respjson.Field
Output respjson.Field
Range respjson.Field
Size respjson.Field
Timestamps respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Generate additional thumbnails in the Asset folder and Storage. Each layout, format and size combination can be requested once. Specify exactly one of timestamps or count.
func (WorkflowThumbnail) RawJSON ¶ added in v1.0.0
func (r WorkflowThumbnail) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowThumbnail) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowThumbnail) UnmarshalJSON(data []byte) error
type WorkflowThumbnailAction ¶ added in v0.17.0
type WorkflowThumbnailAction struct {
// Id specifies a stable action key, unique within its rule.
ID string `json:"id" api:"required"`
// Params specifies sampling and image settings. Outputs use the Asset folder and
// Storage.
Params WorkflowThumbnail `json:"params" api:"required"`
// Type specifies the action to perform. Must be create_thumbnails.
Type constant.CreateThumbnails `json:"type" default:"create_thumbnails"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Params respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Creates an independent thumbnail request after asset.ready. Replaying this action uses its accepted request; separate actions create separate requests.
func (WorkflowThumbnailAction) RawJSON ¶ added in v0.17.0
func (r WorkflowThumbnailAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowThumbnailAction) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowThumbnailAction) UnmarshalJSON(data []byte) error
type WorkflowThumbnailActionParams ¶ added in v1.0.0
type WorkflowThumbnailActionParams struct {
// Id specifies a stable action key, unique within its rule.
ID string `json:"id" api:"required"`
// Params specifies sampling and image settings. Outputs use the Asset folder and
// Storage.
Params WorkflowThumbnailParams `json:"params" api:"required"`
// Type specifies the action to perform. Must be create_thumbnails.
//
// This field can be elided, and will marshal its zero value as
// "create_thumbnails".
Type constant.CreateThumbnails `json:"type" default:"create_thumbnails"`
// contains filtered or unexported fields
}
Creates an independent thumbnail request after asset.ready. Replaying this action uses its accepted request; separate actions create separate requests.
The properties ID, Params, Type are required.
func (WorkflowThumbnailActionParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowThumbnailActionParams) MarshalJSON() (data []byte, err error)
func (*WorkflowThumbnailActionParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowThumbnailActionParams) UnmarshalJSON(data []byte) error
type WorkflowThumbnailParams ¶ added in v0.17.0
type WorkflowThumbnailParams struct {
// Count specifies 1 to 100 thumbnails at the middle of equal sections of the
// selected range.
Count param.Opt[int64] `json:"count,omitzero"`
// Size specifies the maximum image or tile edge in pixels, from 64 to 1920.
// Defaults to 320. Odd sizes are supported. Preserves display aspect ratio without
// cropping or upscaling.
Size param.Opt[int64] `json:"size,omitzero"`
// Format selects JPEG or WebP. Defaults to JPEG.
//
// Any of "jpeg", "webp".
Format ThumbnailFormat `json:"format,omitzero"`
// Metadata attaches string values to this request. The serialized object may
// contain at most 2048 bytes.
Metadata map[string]string `json:"metadata,omitzero"`
// Output selects images or sprites. Defaults to images.
//
// Any of "images", "sprites".
Output ThumbnailOutput `json:"output,omitzero"`
// Range limits sampling to part of the Source. Defaults to the whole Source
// duration.
Range WorkflowThumbnailRangeParams `json:"range,omitzero"`
// Timestamps specifies 1 to 100 Source-relative target times in seconds. Times
// outside the selected range are skipped when the action runs. If none remain, the
// action is skipped without a charge. Repeated targets produce separate outputs.
Timestamps []float64 `json:"timestamps,omitzero"`
// contains filtered or unexported fields
}
Generate additional thumbnails in the Asset folder and Storage. Each layout, format and size combination can be requested once. Specify exactly one of timestamps or count.
func (WorkflowThumbnailParams) MarshalJSON ¶ added in v0.17.0
func (r WorkflowThumbnailParams) MarshalJSON() (data []byte, err error)
func (*WorkflowThumbnailParams) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowThumbnailParams) UnmarshalJSON(data []byte) error
type WorkflowThumbnailRange ¶ added in v1.0.0
type WorkflowThumbnailRange struct {
// End specifies the exclusive upper bound in seconds. Defaults to the Source
// duration.
End float64 `json:"end"`
// Start specifies the inclusive lower bound in seconds. Defaults to zero.
Start float64 `json:"start"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
End respjson.Field
Start respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Optional Source-relative sampling boundaries.
func (WorkflowThumbnailRange) RawJSON ¶ added in v1.0.0
func (r WorkflowThumbnailRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowThumbnailRange) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowThumbnailRange) UnmarshalJSON(data []byte) error
type WorkflowThumbnailRangeParams ¶ added in v1.0.0
type WorkflowThumbnailRangeParams struct {
// End specifies the exclusive upper bound in seconds. Defaults to the Source
// duration.
End param.Opt[float64] `json:"end,omitzero"`
// Start specifies the inclusive lower bound in seconds. Defaults to zero.
Start param.Opt[float64] `json:"start,omitzero"`
// contains filtered or unexported fields
}
Optional Source-relative sampling boundaries.
func (WorkflowThumbnailRangeParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowThumbnailRangeParams) MarshalJSON() (data []byte, err error)
func (*WorkflowThumbnailRangeParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowThumbnailRangeParams) UnmarshalJSON(data []byte) error
type WorkflowTranscript ¶ added in v1.0.0
type WorkflowTranscript struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for an original-language transcript. Pass an empty object; the spoken language is detected automatically.
func (WorkflowTranscript) RawJSON ¶ added in v1.0.0
func (r WorkflowTranscript) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowTranscript) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowTranscript) UnmarshalJSON(data []byte) error
type WorkflowTranscriptAction ¶ added in v0.17.0
type WorkflowTranscriptAction struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Params specifies transcript settings. Pass an empty object.
Params WorkflowTranscript `json:"params" api:"required"`
// Type specifies the action to perform. Must be create_transcript.
Type constant.CreateTranscript `json:"type" default:"create_transcript"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Params respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Creates or reuses the original-language transcript. Can run alongside caption generation in the same asset.ready rule.
func (WorkflowTranscriptAction) RawJSON ¶ added in v0.17.0
func (r WorkflowTranscriptAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowTranscriptAction) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowTranscriptAction) UnmarshalJSON(data []byte) error
type WorkflowTranscriptActionParams ¶ added in v1.0.0
type WorkflowTranscriptActionParams struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// Params specifies transcript settings. Pass an empty object.
Params WorkflowTranscriptParams `json:"params" api:"required"`
// Type specifies the action to perform. Must be create_transcript.
//
// This field can be elided, and will marshal its zero value as
// "create_transcript".
Type constant.CreateTranscript `json:"type" default:"create_transcript"`
// contains filtered or unexported fields
}
Creates or reuses the original-language transcript. Can run alongside caption generation in the same asset.ready rule.
The properties ID, Params, Type are required.
func (WorkflowTranscriptActionParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowTranscriptActionParams) MarshalJSON() (data []byte, err error)
func (*WorkflowTranscriptActionParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowTranscriptActionParams) UnmarshalJSON(data []byte) error
type WorkflowTranscriptParams ¶ added in v1.0.0
type WorkflowTranscriptParams struct {
// contains filtered or unexported fields
}
Parameters for an original-language transcript. Pass an empty object; the spoken language is detected automatically.
func (WorkflowTranscriptParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowTranscriptParams) MarshalJSON() (data []byte, err error)
func (*WorkflowTranscriptParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowTranscriptParams) UnmarshalJSON(data []byte) error
type WorkflowTranslation ¶ added in v1.0.0
type WorkflowTranslation struct {
// LanguageCode specifies the target language for the translated subtitle track,
// such as en or fr. The same code appears in the caption and HLS manifest.
//
// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
// "ru", "tr", "pl", "sv".
LanguageCode WorkflowTranslationLanguageCode `json:"language_code" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
LanguageCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Parameters for translating one original caption into another language.
func (WorkflowTranslation) RawJSON ¶ added in v1.0.0
func (r WorkflowTranslation) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowTranslation) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowTranslation) UnmarshalJSON(data []byte) error
type WorkflowTranslationAction ¶ added in v0.17.0
type WorkflowTranslationAction struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// CaptionId specifies the binding to the original caption in the triggering event.
CaptionID WorkflowOutputBinding `json:"caption_id" api:"required"`
// Params specifies the target language.
Params WorkflowTranslation `json:"params" api:"required"`
// Type specifies the action to perform. Must be translate_caption.
Type constant.TranslateCaption `json:"type" default:"translate_caption"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CaptionID respjson.Field
Params respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Translates or reuses an original caption in one target language. Requires an asset.output.ready rule connected to an original caption creation action.
func (WorkflowTranslationAction) RawJSON ¶ added in v0.17.0
func (r WorkflowTranslationAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*WorkflowTranslationAction) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowTranslationAction) UnmarshalJSON(data []byte) error
type WorkflowTranslationActionParams ¶ added in v1.0.0
type WorkflowTranslationActionParams struct {
// Id specifies a stable action key, unique within its rule. Use 1 to 64
// characters, starting with a letter and containing only letters, digits, or
// underscores.
ID string `json:"id" api:"required"`
// CaptionId specifies the binding to the original caption in the triggering event.
CaptionID WorkflowOutputBindingParams `json:"caption_id,omitzero" api:"required"`
// Params specifies the target language.
Params WorkflowTranslationParams `json:"params,omitzero" api:"required"`
// Type specifies the action to perform. Must be translate_caption.
//
// This field can be elided, and will marshal its zero value as
// "translate_caption".
Type constant.TranslateCaption `json:"type" default:"translate_caption"`
// contains filtered or unexported fields
}
Translates or reuses an original caption in one target language. Requires an asset.output.ready rule connected to an original caption creation action.
The properties ID, CaptionID, Params, Type are required.
func (WorkflowTranslationActionParams) MarshalJSON ¶ added in v1.0.0
func (r WorkflowTranslationActionParams) MarshalJSON() (data []byte, err error)
func (*WorkflowTranslationActionParams) UnmarshalJSON ¶ added in v1.0.0
func (r *WorkflowTranslationActionParams) UnmarshalJSON(data []byte) error
type WorkflowTranslationLanguageCode ¶ added in v1.0.0
type WorkflowTranslationLanguageCode string
const ( WorkflowTranslationLanguageCodeEn WorkflowTranslationLanguageCode = "en" WorkflowTranslationLanguageCodeFr WorkflowTranslationLanguageCode = "fr" WorkflowTranslationLanguageCodeEs WorkflowTranslationLanguageCode = "es" WorkflowTranslationLanguageCodeDe WorkflowTranslationLanguageCode = "de" WorkflowTranslationLanguageCodeIt WorkflowTranslationLanguageCode = "it" WorkflowTranslationLanguageCodePt WorkflowTranslationLanguageCode = "pt" WorkflowTranslationLanguageCodeNl WorkflowTranslationLanguageCode = "nl" WorkflowTranslationLanguageCodeJa WorkflowTranslationLanguageCode = "ja" WorkflowTranslationLanguageCodeKo WorkflowTranslationLanguageCode = "ko" WorkflowTranslationLanguageCodeZh WorkflowTranslationLanguageCode = "zh" WorkflowTranslationLanguageCodeAr WorkflowTranslationLanguageCode = "ar" WorkflowTranslationLanguageCodeHi WorkflowTranslationLanguageCode = "hi" WorkflowTranslationLanguageCodeRu WorkflowTranslationLanguageCode = "ru" WorkflowTranslationLanguageCodeTr WorkflowTranslationLanguageCode = "tr" WorkflowTranslationLanguageCodePl WorkflowTranslationLanguageCode = "pl" WorkflowTranslationLanguageCodeSv WorkflowTranslationLanguageCode = "sv" )
type WorkflowTranslationParams ¶ added in v0.17.0
type WorkflowTranslationParams struct {
// LanguageCode specifies the target language for the translated subtitle track,
// such as en or fr. The same code appears in the caption and HLS manifest.
//
// Any of "en", "fr", "es", "de", "it", "pt", "nl", "ja", "ko", "zh", "ar", "hi",
// "ru", "tr", "pl", "sv".
LanguageCode WorkflowTranslationLanguageCode `json:"language_code,omitzero" api:"required"`
// contains filtered or unexported fields
}
Parameters for translating one original caption into another language.
The property LanguageCode is required.
func (WorkflowTranslationParams) MarshalJSON ¶ added in v0.17.0
func (r WorkflowTranslationParams) MarshalJSON() (data []byte, err error)
func (*WorkflowTranslationParams) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowTranslationParams) UnmarshalJSON(data []byte) error
type WorkflowUpdateParams ¶ added in v0.17.0
type WorkflowUpdateParams struct {
// ExpectedRevision specifies the current Workflow revision when replacing rules.
// The update returns a conflict if it no longer matches. Required when rules is
// provided. Must be at least 1.
ExpectedRevision param.Opt[int64] `json:"expected_revision,omitzero"`
// Name specifies the Workflow name. Use 1 to 128 characters.
Name param.Opt[string] `json:"name,omitzero"`
// Rules specifies the event subscriptions and actions in this definition. Provide
// exactly one asset.ready rule and up to 15 connected rules, with at most 32
// actions and 65536 encoded bytes across all rules. Array order affects display
// only. Replaces the complete definition and requires schema_version and
// expected_revision. Existing Assets and Uploads keep their pinned revision.
Rules []WorkflowRuleParams `json:"rules,omitzero"`
// SchemaVersion specifies the Workflow definition format. The supported version
// is 1. Required when rules is provided.
//
// Any of 1.
SchemaVersion int64 `json:"schema_version,omitzero"`
// contains filtered or unexported fields
}
func (WorkflowUpdateParams) MarshalJSON ¶ added in v0.17.0
func (r WorkflowUpdateParams) MarshalJSON() (data []byte, err error)
func (*WorkflowUpdateParams) UnmarshalJSON ¶ added in v0.17.0
func (r *WorkflowUpdateParams) UnmarshalJSON(data []byte) error
Source Files
¶
- aliases.go
- asset.go
- assetoutput.go
- assetworkflow.go
- assetworkflowaction.go
- client.go
- default_http_client.go
- event.go
- field.go
- file.go
- job.go
- jobfile.go
- joblog.go
- jobtranscoder.go
- metric.go
- notification.go
- project.go
- projectanalytics.go
- projectanalyticsconnection.go
- projectanalyticsconnectionkey.go
- source.go
- storage.go
- thumbnail.go
- token.go
- transcoding.go
- upload.go
- webhook.go
- workflow.go
- workflowrevision.go
- workflowrun.go
- workflowrunaction.go
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
|
|