stream

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin

This is an alias to an internal value.

View Source
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare

This is an alias to an internal value.

View Source
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser

This is an alias to an internal value.

View Source
const CertificateCADigicert = shared.CertificateCADigicert

This is an alias to an internal value.

View Source
const CertificateCAGoogle = shared.CertificateCAGoogle

This is an alias to an internal value.

View Source
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt

This is an alias to an internal value.

View Source
const CertificateCASSLCom = shared.CertificateCASSLCom

This is an alias to an internal value.

View Source
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC

This is an alias to an internal value.

View Source
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy

This is an alias to an internal value.

View Source
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec

This is an alias to an internal value.

View Source
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector

This is an alias to an internal value.

View Source
const MemberStatusAccepted = shared.MemberStatusAccepted

This is an alias to an internal value.

View Source
const MemberStatusPending = shared.MemberStatusPending

This is an alias to an internal value.

View Source
const SortDirectionAsc = shared.SortDirectionAsc

This is an alias to an internal value.

View Source
const SortDirectionDesc = shared.SortDirectionDesc

This is an alias to an internal value.

View Source
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly

This is an alias to an internal value.

View Source
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly

This is an alias to an internal value.

View Source
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment

This is an alias to an internal value.

View Source
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled

This is an alias to an internal value.

View Source
const SubscriptionStateExpired = shared.SubscriptionStateExpired

This is an alias to an internal value.

View Source
const SubscriptionStateFailed = shared.SubscriptionStateFailed

This is an alias to an internal value.

View Source
const SubscriptionStatePaid = shared.SubscriptionStatePaid

This is an alias to an internal value.

View Source
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned

This is an alias to an internal value.

View Source
const SubscriptionStateTrial = shared.SubscriptionStateTrial

This is an alias to an internal value.

Variables

This section is empty.

Functions

This section is empty.

Types

type ASN

type ASN = shared.ASN

This is an alias to an internal type.

type ASNParam

type ASNParam = shared.ASNParam

This is an alias to an internal type.

type AllowedOrigins

type AllowedOrigins = string

type AllowedOriginsParam

type AllowedOriginsParam = string

type Audio

type Audio struct {
	// Denotes whether the audio track will be played by default in a player.
	Default bool `json:"default"`
	// A string to uniquely identify the track amongst other audio track labels for the
	// specified video.
	Label string `json:"label"`
	// Specifies the processing status of the video.
	Status AudioStatus `json:"status"`
	// A Cloudflare-generated unique identifier for a media item.
	UID  string    `json:"uid"`
	JSON audioJSON `json:"-"`
}

func (*Audio) UnmarshalJSON

func (r *Audio) UnmarshalJSON(data []byte) (err error)

type AudioStatus

type AudioStatus string

Specifies the processing status of the video.

const (
	AudioStatusQueued AudioStatus = "queued"
	AudioStatusReady  AudioStatus = "ready"
	AudioStatusError  AudioStatus = "error"
)

func (AudioStatus) IsKnown

func (r AudioStatus) IsKnown() bool

type AudioTrackCopyParams

type AudioTrackCopyParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// A string to uniquely identify the track amongst other audio track labels for the
	// specified video.
	Label param.Field[string] `json:"label,required"`
	// An audio track URL. The server must be publicly routable and support `HTTP HEAD`
	// requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD`
	// requests with a `content-range` header that includes the size of the file.
	URL param.Field[string] `json:"url" format:"uri"`
}

func (AudioTrackCopyParams) MarshalJSON

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

type AudioTrackCopyResponseEnvelope

type AudioTrackCopyResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success AudioTrackCopyResponseEnvelopeSuccess `json:"success,required"`
	Result  Audio                                 `json:"result"`
	JSON    audioTrackCopyResponseEnvelopeJSON    `json:"-"`
}

func (*AudioTrackCopyResponseEnvelope) UnmarshalJSON

func (r *AudioTrackCopyResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type AudioTrackCopyResponseEnvelopeSuccess

type AudioTrackCopyResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackCopyResponseEnvelopeSuccessTrue AudioTrackCopyResponseEnvelopeSuccess = true
)

func (AudioTrackCopyResponseEnvelopeSuccess) IsKnown

type AudioTrackDeleteParams

type AudioTrackDeleteParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type AudioTrackDeleteResponseEnvelope

type AudioTrackDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success AudioTrackDeleteResponseEnvelopeSuccess `json:"success,required"`
	Result  string                                  `json:"result"`
	JSON    audioTrackDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*AudioTrackDeleteResponseEnvelope) UnmarshalJSON

func (r *AudioTrackDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type AudioTrackDeleteResponseEnvelopeSuccess

type AudioTrackDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackDeleteResponseEnvelopeSuccessTrue AudioTrackDeleteResponseEnvelopeSuccess = true
)

func (AudioTrackDeleteResponseEnvelopeSuccess) IsKnown

type AudioTrackEditParams

type AudioTrackEditParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Denotes whether the audio track will be played by default in a player.
	Default param.Field[bool] `json:"default"`
	// A string to uniquely identify the track amongst other audio track labels for the
	// specified video.
	Label param.Field[string] `json:"label"`
}

func (AudioTrackEditParams) MarshalJSON

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

type AudioTrackEditResponseEnvelope

type AudioTrackEditResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success AudioTrackEditResponseEnvelopeSuccess `json:"success,required"`
	Result  Audio                                 `json:"result"`
	JSON    audioTrackEditResponseEnvelopeJSON    `json:"-"`
}

func (*AudioTrackEditResponseEnvelope) UnmarshalJSON

func (r *AudioTrackEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type AudioTrackEditResponseEnvelopeSuccess

type AudioTrackEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackEditResponseEnvelopeSuccessTrue AudioTrackEditResponseEnvelopeSuccess = true
)

func (AudioTrackEditResponseEnvelopeSuccess) IsKnown

type AudioTrackGetParams

type AudioTrackGetParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type AudioTrackGetResponseEnvelope

type AudioTrackGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success AudioTrackGetResponseEnvelopeSuccess `json:"success,required"`
	Result  []Audio                              `json:"result"`
	JSON    audioTrackGetResponseEnvelopeJSON    `json:"-"`
}

func (*AudioTrackGetResponseEnvelope) UnmarshalJSON

func (r *AudioTrackGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type AudioTrackGetResponseEnvelopeSuccess

type AudioTrackGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackGetResponseEnvelopeSuccessTrue AudioTrackGetResponseEnvelopeSuccess = true
)

func (AudioTrackGetResponseEnvelopeSuccess) IsKnown

type AudioTrackService

type AudioTrackService struct {
	Options []option.RequestOption
}

AudioTrackService contains methods and other services that help with interacting with the cloudflare API.

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

func NewAudioTrackService

func NewAudioTrackService(opts ...option.RequestOption) (r *AudioTrackService)

NewAudioTrackService 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 (*AudioTrackService) Copy

func (r *AudioTrackService) Copy(ctx context.Context, identifier string, params AudioTrackCopyParams, opts ...option.RequestOption) (res *Audio, err error)

Adds an additional audio track to a video using the provided audio track URL.

func (*AudioTrackService) Delete

func (r *AudioTrackService) Delete(ctx context.Context, identifier string, audioIdentifier string, body AudioTrackDeleteParams, opts ...option.RequestOption) (res *string, err error)

Deletes additional audio tracks on a video. Deleting a default audio track is not allowed. You must assign another audio track as default prior to deletion.

func (*AudioTrackService) Edit

func (r *AudioTrackService) Edit(ctx context.Context, identifier string, audioIdentifier string, params AudioTrackEditParams, opts ...option.RequestOption) (res *Audio, err error)

Edits additional audio tracks on a video. Editing the default status of an audio track to `true` will mark all other audio tracks on the video default status to `false`.

func (*AudioTrackService) Get

func (r *AudioTrackService) Get(ctx context.Context, identifier string, query AudioTrackGetParams, opts ...option.RequestOption) (res *[]Audio, err error)

Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.

type AuditLog

type AuditLog = shared.AuditLog

This is an alias to an internal type.

type AuditLogAction

type AuditLogAction = shared.AuditLogAction

This is an alias to an internal type.

type AuditLogActor

type AuditLogActor = shared.AuditLogActor

This is an alias to an internal type.

type AuditLogActorType

type AuditLogActorType = shared.AuditLogActorType

The type of actor, whether a User, Cloudflare Admin, or an Automated System.

This is an alias to an internal type.

type AuditLogOwner

type AuditLogOwner = shared.AuditLogOwner

This is an alias to an internal type.

type AuditLogResource

type AuditLogResource = shared.AuditLogResource

This is an alias to an internal type.

type Caption

type Caption struct {
	// Whether the caption was generated via AI.
	Generated bool `json:"generated"`
	// The language label displayed in the native language to users.
	Label string `json:"label"`
	// The language tag in BCP 47 format.
	Language string `json:"language"`
	// The status of a generated caption.
	Status CaptionStatus `json:"status"`
	JSON   captionJSON   `json:"-"`
}

func (*Caption) UnmarshalJSON

func (r *Caption) UnmarshalJSON(data []byte) (err error)

type CaptionGetParams

type CaptionGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type CaptionGetResponseEnvelope

type CaptionGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success CaptionGetResponseEnvelopeSuccess `json:"success,required"`
	Result  []Caption                         `json:"result"`
	JSON    captionGetResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionGetResponseEnvelope) UnmarshalJSON

func (r *CaptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type CaptionGetResponseEnvelopeSuccess

type CaptionGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionGetResponseEnvelopeSuccessTrue CaptionGetResponseEnvelopeSuccess = true
)

func (CaptionGetResponseEnvelopeSuccess) IsKnown

type CaptionLanguageDeleteParams

type CaptionLanguageDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type CaptionLanguageDeleteResponseEnvelope

type CaptionLanguageDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success CaptionLanguageDeleteResponseEnvelopeSuccess `json:"success,required"`
	Result  string                                       `json:"result"`
	JSON    captionLanguageDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionLanguageDeleteResponseEnvelope) UnmarshalJSON

func (r *CaptionLanguageDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type CaptionLanguageDeleteResponseEnvelopeSuccess

type CaptionLanguageDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionLanguageDeleteResponseEnvelopeSuccessTrue CaptionLanguageDeleteResponseEnvelopeSuccess = true
)

func (CaptionLanguageDeleteResponseEnvelopeSuccess) IsKnown

type CaptionLanguageGetParams

type CaptionLanguageGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type CaptionLanguageGetResponseEnvelope

type CaptionLanguageGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success CaptionLanguageGetResponseEnvelopeSuccess `json:"success,required"`
	Result  Caption                                   `json:"result"`
	JSON    captionLanguageGetResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionLanguageGetResponseEnvelope) UnmarshalJSON

func (r *CaptionLanguageGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type CaptionLanguageGetResponseEnvelopeSuccess

type CaptionLanguageGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionLanguageGetResponseEnvelopeSuccessTrue CaptionLanguageGetResponseEnvelopeSuccess = true
)

func (CaptionLanguageGetResponseEnvelopeSuccess) IsKnown

type CaptionLanguageNewParams

type CaptionLanguageNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type CaptionLanguageNewResponseEnvelope

type CaptionLanguageNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success CaptionLanguageNewResponseEnvelopeSuccess `json:"success,required"`
	Result  Caption                                   `json:"result"`
	JSON    captionLanguageNewResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionLanguageNewResponseEnvelope) UnmarshalJSON

func (r *CaptionLanguageNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type CaptionLanguageNewResponseEnvelopeSuccess

type CaptionLanguageNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionLanguageNewResponseEnvelopeSuccessTrue CaptionLanguageNewResponseEnvelopeSuccess = true
)

func (CaptionLanguageNewResponseEnvelopeSuccess) IsKnown

type CaptionLanguageService

type CaptionLanguageService struct {
	Options []option.RequestOption
	Vtt     *CaptionLanguageVttService
}

CaptionLanguageService contains methods and other services that help with interacting with the cloudflare API.

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

func NewCaptionLanguageService

func NewCaptionLanguageService(opts ...option.RequestOption) (r *CaptionLanguageService)

NewCaptionLanguageService 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 (*CaptionLanguageService) Delete

func (r *CaptionLanguageService) Delete(ctx context.Context, identifier string, language string, body CaptionLanguageDeleteParams, opts ...option.RequestOption) (res *string, err error)

Removes the captions or subtitles from a video.

func (*CaptionLanguageService) Get

func (r *CaptionLanguageService) Get(ctx context.Context, identifier string, language string, query CaptionLanguageGetParams, opts ...option.RequestOption) (res *Caption, err error)

Lists the captions or subtitles for provided language.

func (*CaptionLanguageService) New

func (r *CaptionLanguageService) New(ctx context.Context, identifier string, language string, body CaptionLanguageNewParams, opts ...option.RequestOption) (res *Caption, err error)

Generate captions or subtitles for provided language via AI.

func (*CaptionLanguageService) Update

func (r *CaptionLanguageService) Update(ctx context.Context, identifier string, language string, params CaptionLanguageUpdateParams, opts ...option.RequestOption) (res *Caption, err error)

Uploads the caption or subtitle file to the endpoint for a specific BCP47 language. One caption or subtitle file per language is allowed.

type CaptionLanguageUpdateParams

type CaptionLanguageUpdateParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The WebVTT file containing the caption or subtitle content.
	File param.Field[string] `json:"file,required"`
}

func (CaptionLanguageUpdateParams) MarshalMultipart

func (r CaptionLanguageUpdateParams) MarshalMultipart() (data []byte, contentType string, err error)

type CaptionLanguageUpdateResponseEnvelope

type CaptionLanguageUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success CaptionLanguageUpdateResponseEnvelopeSuccess `json:"success,required"`
	Result  Caption                                      `json:"result"`
	JSON    captionLanguageUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionLanguageUpdateResponseEnvelope) UnmarshalJSON

func (r *CaptionLanguageUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type CaptionLanguageUpdateResponseEnvelopeSuccess

type CaptionLanguageUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionLanguageUpdateResponseEnvelopeSuccessTrue CaptionLanguageUpdateResponseEnvelopeSuccess = true
)

func (CaptionLanguageUpdateResponseEnvelopeSuccess) IsKnown

type CaptionLanguageVttGetParams

type CaptionLanguageVttGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type CaptionLanguageVttService

type CaptionLanguageVttService struct {
	Options []option.RequestOption
}

CaptionLanguageVttService contains methods and other services that help with interacting with the cloudflare API.

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

func NewCaptionLanguageVttService

func NewCaptionLanguageVttService(opts ...option.RequestOption) (r *CaptionLanguageVttService)

NewCaptionLanguageVttService 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 (*CaptionLanguageVttService) Get

func (r *CaptionLanguageVttService) Get(ctx context.Context, identifier string, language string, query CaptionLanguageVttGetParams, opts ...option.RequestOption) (res *string, err error)

Return WebVTT captions for a provided language.

type CaptionService

type CaptionService struct {
	Options  []option.RequestOption
	Language *CaptionLanguageService
}

CaptionService contains methods and other services that help with interacting with the cloudflare API.

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

func NewCaptionService

func NewCaptionService(opts ...option.RequestOption) (r *CaptionService)

NewCaptionService 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 (*CaptionService) Get

func (r *CaptionService) Get(ctx context.Context, identifier string, query CaptionGetParams, opts ...option.RequestOption) (res *[]Caption, err error)

Lists the available captions or subtitles for a specific video.

type CaptionStatus

type CaptionStatus string

The status of a generated caption.

const (
	CaptionStatusReady      CaptionStatus = "ready"
	CaptionStatusInprogress CaptionStatus = "inprogress"
	CaptionStatusError      CaptionStatus = "error"
)

func (CaptionStatus) IsKnown

func (r CaptionStatus) IsKnown() bool

type CertificateCA

type CertificateCA = shared.CertificateCA

The Certificate Authority that will issue the certificate

This is an alias to an internal type.

type CertificateRequestType

type CertificateRequestType = shared.CertificateRequestType

Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).

This is an alias to an internal type.

type Clip

type Clip struct {
	// Lists the origins allowed to display the video. Enter allowed origin domains in
	// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
	// viewed on any origin.
	AllowedOrigins []AllowedOrigins `json:"allowedOrigins"`
	// The unique video identifier (UID).
	ClippedFromVideoUID string `json:"clippedFromVideoUID"`
	// The date and time the clip was created.
	Created time.Time `json:"created" format:"date-time"`
	// A user-defined identifier for the media creator.
	Creator string `json:"creator"`
	// Specifies the end time for the video clip in seconds.
	EndTimeSeconds int64 `json:"endTimeSeconds"`
	// The maximum duration in seconds for a video upload. Can be set for a video that
	// is not yet uploaded to limit its duration. Uploads that exceed the specified
	// duration will fail during processing. A value of `-1` means the value is
	// unknown.
	MaxDurationSeconds int64 `json:"maxDurationSeconds"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing videos.
	Meta interface{} `json:"meta"`
	// The date and time the live input was last modified.
	Modified time.Time    `json:"modified" format:"date-time"`
	Playback ClipPlayback `json:"playback"`
	// The video's preview page URI. This field is omitted until encoding is complete.
	Preview string `json:"preview" format:"uri"`
	// Indicates whether the video can be a accessed using the UID. When set to `true`,
	// a signed token must be generated with a signing key to view the video.
	RequireSignedURLs bool `json:"requireSignedURLs"`
	// Specifies the start time for the video clip in seconds.
	StartTimeSeconds int64 `json:"startTimeSeconds"`
	// Specifies the processing status for all quality levels for a video.
	Status ClipStatus `json:"status"`
	// The timestamp for a thumbnail image calculated as a percentage value of the
	// video's duration. To convert from a second-wise timestamp to a percentage,
	// divide the desired timestamp by the total duration of the video. If this value
	// is not set, the default thumbnail image is taken from 0s of the video.
	ThumbnailTimestampPct float64       `json:"thumbnailTimestampPct"`
	Watermark             ClipWatermark `json:"watermark"`
	JSON                  clipJSON      `json:"-"`
}

func (*Clip) UnmarshalJSON

func (r *Clip) UnmarshalJSON(data []byte) (err error)

type ClipNewParams

type ClipNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// The unique video identifier (UID).
	ClippedFromVideoUID param.Field[string] `json:"clippedFromVideoUID,required"`
	// Specifies the end time for the video clip in seconds.
	EndTimeSeconds param.Field[int64] `json:"endTimeSeconds,required"`
	// Specifies the start time for the video clip in seconds.
	StartTimeSeconds param.Field[int64] `json:"startTimeSeconds,required"`
	// Lists the origins allowed to display the video. Enter allowed origin domains in
	// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
	// viewed on any origin.
	AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowedOrigins"`
	// A user-defined identifier for the media creator.
	Creator param.Field[string] `json:"creator"`
	// The maximum duration in seconds for a video upload. Can be set for a video that
	// is not yet uploaded to limit its duration. Uploads that exceed the specified
	// duration will fail during processing. A value of `-1` means the value is
	// unknown.
	MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds"`
	// Indicates whether the video can be a accessed using the UID. When set to `true`,
	// a signed token must be generated with a signing key to view the video.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
	// The timestamp for a thumbnail image calculated as a percentage value of the
	// video's duration. To convert from a second-wise timestamp to a percentage,
	// divide the desired timestamp by the total duration of the video. If this value
	// is not set, the default thumbnail image is taken from 0s of the video.
	ThumbnailTimestampPct param.Field[float64]                `json:"thumbnailTimestampPct"`
	Watermark             param.Field[ClipNewParamsWatermark] `json:"watermark"`
}

func (ClipNewParams) MarshalJSON

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

type ClipNewParamsWatermark

type ClipNewParamsWatermark struct {
	// The unique identifier for the watermark profile.
	UID param.Field[string] `json:"uid"`
}

func (ClipNewParamsWatermark) MarshalJSON

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

type ClipNewResponseEnvelope

type ClipNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success ClipNewResponseEnvelopeSuccess `json:"success,required"`
	Result  Clip                           `json:"result"`
	JSON    clipNewResponseEnvelopeJSON    `json:"-"`
}

func (*ClipNewResponseEnvelope) UnmarshalJSON

func (r *ClipNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type ClipNewResponseEnvelopeSuccess

type ClipNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ClipNewResponseEnvelopeSuccessTrue ClipNewResponseEnvelopeSuccess = true
)

func (ClipNewResponseEnvelopeSuccess) IsKnown

type ClipPlayback

type ClipPlayback struct {
	// DASH Media Presentation Description for the video.
	Dash string `json:"dash"`
	// The HLS manifest for the video.
	Hls  string           `json:"hls"`
	JSON clipPlaybackJSON `json:"-"`
}

func (*ClipPlayback) UnmarshalJSON

func (r *ClipPlayback) UnmarshalJSON(data []byte) (err error)

type ClipService

type ClipService struct {
	Options []option.RequestOption
}

ClipService contains methods and other services that help with interacting with the cloudflare API.

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

func NewClipService

func NewClipService(opts ...option.RequestOption) (r *ClipService)

NewClipService 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 (*ClipService) New

func (r *ClipService) New(ctx context.Context, params ClipNewParams, opts ...option.RequestOption) (res *Clip, err error)

Clips a video based on the specified start and end times provided in seconds.

type ClipStatus

type ClipStatus string

Specifies the processing status for all quality levels for a video.

const (
	ClipStatusPendingupload ClipStatus = "pendingupload"
	ClipStatusDownloading   ClipStatus = "downloading"
	ClipStatusQueued        ClipStatus = "queued"
	ClipStatusInprogress    ClipStatus = "inprogress"
	ClipStatusReady         ClipStatus = "ready"
	ClipStatusError         ClipStatus = "error"
)

func (ClipStatus) IsKnown

func (r ClipStatus) IsKnown() bool

type ClipWatermark

type ClipWatermark struct {
	// The unique identifier for the watermark profile.
	UID  string            `json:"uid"`
	JSON clipWatermarkJSON `json:"-"`
}

func (*ClipWatermark) UnmarshalJSON

func (r *ClipWatermark) UnmarshalJSON(data []byte) (err error)

type CloudflareTunnel

type CloudflareTunnel = shared.CloudflareTunnel

A Cloudflare Tunnel that connects your origin to Cloudflare's edge.

This is an alias to an internal type.

type CloudflareTunnelConnection

type CloudflareTunnelConnection = shared.CloudflareTunnelConnection

This is an alias to an internal type.

type CloudflareTunnelStatus

type CloudflareTunnelStatus = shared.CloudflareTunnelStatus

The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).

This is an alias to an internal type.

type CloudflareTunnelTunType

type CloudflareTunnelTunType = shared.CloudflareTunnelTunType

The type of tunnel.

This is an alias to an internal type.

type CopyNewParams

type CopyNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// A video's URL. The server must be publicly routable and support `HTTP HEAD`
	// requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD`
	// requests with a `content-range` header that includes the size of the file.
	URL param.Field[string] `json:"url,required" format:"uri"`
	// Lists the origins allowed to display the video. Enter allowed origin domains in
	// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
	// viewed on any origin.
	AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowedOrigins"`
	// A user-defined identifier for the media creator.
	Creator param.Field[string] `json:"creator"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing videos.
	Meta param.Field[interface{}] `json:"meta"`
	// Indicates whether the video can be a accessed using the UID. When set to `true`,
	// a signed token must be generated with a signing key to view the video.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
	// Indicates the date and time at which the video will be deleted. Omit the field
	// to indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion. If specified, must be at least 30 days from upload time.
	ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"`
	// The timestamp for a thumbnail image calculated as a percentage value of the
	// video's duration. To convert from a second-wise timestamp to a percentage,
	// divide the desired timestamp by the total duration of the video. If this value
	// is not set, the default thumbnail image is taken from 0s of the video.
	ThumbnailTimestampPct param.Field[float64]                `json:"thumbnailTimestampPct"`
	Watermark             param.Field[CopyNewParamsWatermark] `json:"watermark"`
	// A user-defined identifier for the media creator.
	UploadCreator param.Field[string] `header:"Upload-Creator"`
	// Comma-separated key-value pairs following the TUS protocol specification. Values
	// are Base-64 encoded. Supported keys: `name`, `requiresignedurls`,
	// `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`.
	UploadMetadata param.Field[string] `header:"Upload-Metadata"`
}

func (CopyNewParams) MarshalJSON

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

type CopyNewParamsWatermark

type CopyNewParamsWatermark struct {
	// The unique identifier for the watermark profile.
	UID param.Field[string] `json:"uid"`
}

func (CopyNewParamsWatermark) MarshalJSON

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

type CopyNewResponseEnvelope

type CopyNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success CopyNewResponseEnvelopeSuccess `json:"success,required"`
	Result  Video                          `json:"result"`
	JSON    copyNewResponseEnvelopeJSON    `json:"-"`
}

func (*CopyNewResponseEnvelope) UnmarshalJSON

func (r *CopyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type CopyNewResponseEnvelopeSuccess

type CopyNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CopyNewResponseEnvelopeSuccessTrue CopyNewResponseEnvelopeSuccess = true
)

func (CopyNewResponseEnvelopeSuccess) IsKnown

type CopyService

type CopyService struct {
	Options []option.RequestOption
}

CopyService contains methods and other services that help with interacting with the cloudflare API.

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

func NewCopyService

func NewCopyService(opts ...option.RequestOption) (r *CopyService)

NewCopyService 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 (*CopyService) New

func (r *CopyService) New(ctx context.Context, params CopyNewParams, opts ...option.RequestOption) (res *Video, err error)

Uploads a video to Stream from a provided URL.

type DirectUploadNewParams

type DirectUploadNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// The maximum duration in seconds for a video upload. Can be set for a video that
	// is not yet uploaded to limit its duration. Uploads that exceed the specified
	// duration will fail during processing. A value of `-1` means the value is
	// unknown.
	MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds,required"`
	// Lists the origins allowed to display the video. Enter allowed origin domains in
	// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
	// viewed on any origin.
	AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowedOrigins"`
	// A user-defined identifier for the media creator.
	Creator param.Field[string] `json:"creator"`
	// The date and time after upload when videos will not be accepted.
	Expiry param.Field[time.Time] `json:"expiry" format:"date-time"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing videos.
	Meta param.Field[interface{}] `json:"meta"`
	// Indicates whether the video can be a accessed using the UID. When set to `true`,
	// a signed token must be generated with a signing key to view the video.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
	// Indicates the date and time at which the video will be deleted. Omit the field
	// to indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion. If specified, must be at least 30 days from upload time.
	ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"`
	// The timestamp for a thumbnail image calculated as a percentage value of the
	// video's duration. To convert from a second-wise timestamp to a percentage,
	// divide the desired timestamp by the total duration of the video. If this value
	// is not set, the default thumbnail image is taken from 0s of the video.
	ThumbnailTimestampPct param.Field[float64]                        `json:"thumbnailTimestampPct"`
	Watermark             param.Field[DirectUploadNewParamsWatermark] `json:"watermark"`
	// A user-defined identifier for the media creator.
	UploadCreator param.Field[string] `header:"Upload-Creator"`
}

func (DirectUploadNewParams) MarshalJSON

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

type DirectUploadNewParamsWatermark

type DirectUploadNewParamsWatermark struct {
	// The unique identifier for the watermark profile.
	UID param.Field[string] `json:"uid"`
}

func (DirectUploadNewParamsWatermark) MarshalJSON

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

type DirectUploadNewResponse

type DirectUploadNewResponse struct {
	// Indicates the date and time at which the video will be deleted. Omit the field
	// to indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion. If specified, must be at least 30 days from upload time.
	ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
	// A Cloudflare-generated unique identifier for a media item.
	UID string `json:"uid"`
	// The URL an unauthenticated upload can use for a single
	// `HTTP POST multipart/form-data` request.
	UploadURL string                      `json:"uploadURL"`
	Watermark Watermark                   `json:"watermark"`
	JSON      directUploadNewResponseJSON `json:"-"`
}

func (*DirectUploadNewResponse) UnmarshalJSON

func (r *DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error)

type DirectUploadNewResponseEnvelope

type DirectUploadNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success DirectUploadNewResponseEnvelopeSuccess `json:"success,required"`
	Result  DirectUploadNewResponse                `json:"result"`
	JSON    directUploadNewResponseEnvelopeJSON    `json:"-"`
}

func (*DirectUploadNewResponseEnvelope) UnmarshalJSON

func (r *DirectUploadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DirectUploadNewResponseEnvelopeSuccess

type DirectUploadNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DirectUploadNewResponseEnvelopeSuccessTrue DirectUploadNewResponseEnvelopeSuccess = true
)

func (DirectUploadNewResponseEnvelopeSuccess) IsKnown

type DirectUploadService

type DirectUploadService struct {
	Options []option.RequestOption
}

DirectUploadService contains methods and other services that help with interacting with the cloudflare API.

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

func NewDirectUploadService

func NewDirectUploadService(opts ...option.RequestOption) (r *DirectUploadService)

NewDirectUploadService 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 (*DirectUploadService) New

Creates a direct upload that allows video uploads without an API key.

type DownloadDeleteParams

type DownloadDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type DownloadDeleteResponseEnvelope

type DownloadDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success DownloadDeleteResponseEnvelopeSuccess `json:"success,required"`
	Result  string                                `json:"result"`
	JSON    downloadDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*DownloadDeleteResponseEnvelope) UnmarshalJSON

func (r *DownloadDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DownloadDeleteResponseEnvelopeSuccess

type DownloadDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DownloadDeleteResponseEnvelopeSuccessTrue DownloadDeleteResponseEnvelopeSuccess = true
)

func (DownloadDeleteResponseEnvelopeSuccess) IsKnown

type DownloadGetParams

type DownloadGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type DownloadGetResponse

type DownloadGetResponse = interface{}

type DownloadGetResponseEnvelope

type DownloadGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success DownloadGetResponseEnvelopeSuccess `json:"success,required"`
	Result  DownloadGetResponse                `json:"result"`
	JSON    downloadGetResponseEnvelopeJSON    `json:"-"`
}

func (*DownloadGetResponseEnvelope) UnmarshalJSON

func (r *DownloadGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DownloadGetResponseEnvelopeSuccess

type DownloadGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DownloadGetResponseEnvelopeSuccessTrue DownloadGetResponseEnvelopeSuccess = true
)

func (DownloadGetResponseEnvelopeSuccess) IsKnown

type DownloadNewParams

type DownloadNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	Body      interface{}         `json:"body,required"`
}

func (DownloadNewParams) MarshalJSON

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

type DownloadNewResponse

type DownloadNewResponse = interface{}

type DownloadNewResponseEnvelope

type DownloadNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success DownloadNewResponseEnvelopeSuccess `json:"success,required"`
	Result  DownloadNewResponse                `json:"result"`
	JSON    downloadNewResponseEnvelopeJSON    `json:"-"`
}

func (*DownloadNewResponseEnvelope) UnmarshalJSON

func (r *DownloadNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type DownloadNewResponseEnvelopeSuccess

type DownloadNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DownloadNewResponseEnvelopeSuccessTrue DownloadNewResponseEnvelopeSuccess = true
)

func (DownloadNewResponseEnvelopeSuccess) IsKnown

type DownloadService

type DownloadService struct {
	Options []option.RequestOption
}

DownloadService contains methods and other services that help with interacting with the cloudflare API.

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

func NewDownloadService

func NewDownloadService(opts ...option.RequestOption) (r *DownloadService)

NewDownloadService 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 (*DownloadService) Delete

func (r *DownloadService) Delete(ctx context.Context, identifier string, body DownloadDeleteParams, opts ...option.RequestOption) (res *string, err error)

Delete the downloads for a video.

func (*DownloadService) Get

func (r *DownloadService) Get(ctx context.Context, identifier string, query DownloadGetParams, opts ...option.RequestOption) (res *DownloadGetResponse, err error)

Lists the downloads created for a video.

func (*DownloadService) New

func (r *DownloadService) New(ctx context.Context, identifier string, params DownloadNewParams, opts ...option.RequestOption) (res *DownloadNewResponse, err error)

Creates a download for a video when a video is ready to view.

type EmbedGetParams

type EmbedGetParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type EmbedService

type EmbedService struct {
	Options []option.RequestOption
}

EmbedService contains methods and other services that help with interacting with the cloudflare API.

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

func NewEmbedService

func NewEmbedService(opts ...option.RequestOption) (r *EmbedService)

NewEmbedService 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 (*EmbedService) Get

func (r *EmbedService) Get(ctx context.Context, identifier string, query EmbedGetParams, opts ...option.RequestOption) (res *string, err error)

Fetches an HTML code snippet to embed a video in a web page delivered through Cloudflare. On success, returns an HTML fragment for use on web pages to display a video. On failure, returns a JSON response body.

type Error

type Error = apierror.Error

type ErrorData

type ErrorData = shared.ErrorData

This is an alias to an internal type.

type KeyDeleteParams

type KeyDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type KeyDeleteResponseEnvelope

type KeyDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success KeyDeleteResponseEnvelopeSuccess `json:"success,required"`
	Result  string                           `json:"result"`
	JSON    keyDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*KeyDeleteResponseEnvelope) UnmarshalJSON

func (r *KeyDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type KeyDeleteResponseEnvelopeSuccess

type KeyDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	KeyDeleteResponseEnvelopeSuccessTrue KeyDeleteResponseEnvelopeSuccess = true
)

func (KeyDeleteResponseEnvelopeSuccess) IsKnown

type KeyGetParams

type KeyGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type KeyGetResponse

type KeyGetResponse struct {
	// Identifier
	ID string `json:"id"`
	// The date and time a signing key was created.
	Created time.Time          `json:"created" format:"date-time"`
	JSON    keyGetResponseJSON `json:"-"`
}

func (*KeyGetResponse) UnmarshalJSON

func (r *KeyGetResponse) UnmarshalJSON(data []byte) (err error)

type KeyGetResponseEnvelope

type KeyGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success KeyGetResponseEnvelopeSuccess `json:"success,required"`
	Result  []KeyGetResponse              `json:"result"`
	JSON    keyGetResponseEnvelopeJSON    `json:"-"`
}

func (*KeyGetResponseEnvelope) UnmarshalJSON

func (r *KeyGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type KeyGetResponseEnvelopeSuccess

type KeyGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	KeyGetResponseEnvelopeSuccessTrue KeyGetResponseEnvelopeSuccess = true
)

func (KeyGetResponseEnvelopeSuccess) IsKnown

func (r KeyGetResponseEnvelopeSuccess) IsKnown() bool

type KeyNewParams

type KeyNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	Body      interface{}         `json:"body,required"`
}

func (KeyNewParams) MarshalJSON

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

type KeyNewResponseEnvelope

type KeyNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success KeyNewResponseEnvelopeSuccess `json:"success,required"`
	Result  Keys                          `json:"result"`
	JSON    keyNewResponseEnvelopeJSON    `json:"-"`
}

func (*KeyNewResponseEnvelope) UnmarshalJSON

func (r *KeyNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type KeyNewResponseEnvelopeSuccess

type KeyNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	KeyNewResponseEnvelopeSuccessTrue KeyNewResponseEnvelopeSuccess = true
)

func (KeyNewResponseEnvelopeSuccess) IsKnown

func (r KeyNewResponseEnvelopeSuccess) IsKnown() bool

type KeyService

type KeyService struct {
	Options []option.RequestOption
}

KeyService contains methods and other services that help with interacting with the cloudflare API.

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

func NewKeyService

func NewKeyService(opts ...option.RequestOption) (r *KeyService)

NewKeyService 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 (*KeyService) Delete

func (r *KeyService) Delete(ctx context.Context, identifier string, body KeyDeleteParams, opts ...option.RequestOption) (res *string, err error)

Deletes signing keys and revokes all signed URLs generated with the key.

func (*KeyService) Get

func (r *KeyService) Get(ctx context.Context, query KeyGetParams, opts ...option.RequestOption) (res *[]KeyGetResponse, err error)

Lists the video ID and creation date and time when a signing key was created.

func (*KeyService) New

func (r *KeyService) New(ctx context.Context, params KeyNewParams, opts ...option.RequestOption) (res *Keys, err error)

Creates an RSA private key in PEM and JWK formats. Key files are only displayed once after creation. Keys are created, used, and deleted independently of videos, and every key can sign any video.

type Keys

type Keys struct {
	// Identifier
	ID string `json:"id"`
	// The date and time a signing key was created.
	Created time.Time `json:"created" format:"date-time"`
	// The signing key in JWK format.
	Jwk string `json:"jwk"`
	// The signing key in PEM format.
	Pem  string   `json:"pem"`
	JSON keysJSON `json:"-"`
}

func (*Keys) UnmarshalJSON

func (r *Keys) UnmarshalJSON(data []byte) (err error)

type LiveInput

type LiveInput struct {
	// The date and time the live input was created.
	Created time.Time `json:"created" format:"date-time"`
	// Indicates the number of days after which the live inputs recordings will be
	// deleted. When a stream completes and the recording is ready, the value is used
	// to calculate a scheduled deletion date for that recording. Omit the field to
	// indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion.
	DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing live inputs.
	Meta interface{} `json:"meta"`
	// The date and time the live input was last modified.
	Modified time.Time `json:"modified" format:"date-time"`
	// Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
	// most cases, the video will initially be viewable as a live video and transition
	// to on-demand after a condition is satisfied.
	Recording LiveInputRecording `json:"recording"`
	// Details for streaming to an live input using RTMPS.
	Rtmps LiveInputRtmps `json:"rtmps"`
	// Details for playback from an live input using RTMPS.
	RtmpsPlayback LiveInputRtmpsPlayback `json:"rtmpsPlayback"`
	// Details for streaming to a live input using SRT.
	Srt LiveInputSrt `json:"srt"`
	// Details for playback from an live input using SRT.
	SrtPlayback LiveInputSrtPlayback `json:"srtPlayback"`
	// The connection status of a live input.
	Status LiveInputStatus `json:"status,nullable"`
	// A unique identifier for a live input.
	UID string `json:"uid"`
	// Details for streaming to a live input using WebRTC.
	WebRtc LiveInputWebRtc `json:"webRTC"`
	// Details for playback from a live input using WebRTC.
	WebRtcPlayback LiveInputWebRtcPlayback `json:"webRTCPlayback"`
	JSON           liveInputJSON           `json:"-"`
}

Details about a live input.

func (*LiveInput) UnmarshalJSON

func (r *LiveInput) UnmarshalJSON(data []byte) (err error)

type LiveInputDeleteParams

type LiveInputDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type LiveInputGetParams

type LiveInputGetParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type LiveInputGetResponseEnvelope

type LiveInputGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success LiveInputGetResponseEnvelopeSuccess `json:"success,required"`
	// Details about a live input.
	Result LiveInput                        `json:"result"`
	JSON   liveInputGetResponseEnvelopeJSON `json:"-"`
}

func (*LiveInputGetResponseEnvelope) UnmarshalJSON

func (r *LiveInputGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LiveInputGetResponseEnvelopeSuccess

type LiveInputGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputGetResponseEnvelopeSuccessTrue LiveInputGetResponseEnvelopeSuccess = true
)

func (LiveInputGetResponseEnvelopeSuccess) IsKnown

type LiveInputListParams

type LiveInputListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// Includes the total number of videos associated with the submitted query
	// parameters.
	IncludeCounts param.Field[bool] `query:"include_counts"`
}

func (LiveInputListParams) URLQuery

func (r LiveInputListParams) URLQuery() (v url.Values)

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

type LiveInputListResponse

type LiveInputListResponse struct {
	LiveInputs []LiveInputListResponseLiveInput `json:"liveInputs"`
	// The total number of remaining live inputs based on cursor position.
	Range int64 `json:"range"`
	// The total number of live inputs that match the provided filters.
	Total int64                     `json:"total"`
	JSON  liveInputListResponseJSON `json:"-"`
}

func (*LiveInputListResponse) UnmarshalJSON

func (r *LiveInputListResponse) UnmarshalJSON(data []byte) (err error)

type LiveInputListResponseEnvelope

type LiveInputListResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success LiveInputListResponseEnvelopeSuccess `json:"success,required"`
	Result  LiveInputListResponse                `json:"result"`
	JSON    liveInputListResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputListResponseEnvelope) UnmarshalJSON

func (r *LiveInputListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LiveInputListResponseEnvelopeSuccess

type LiveInputListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputListResponseEnvelopeSuccessTrue LiveInputListResponseEnvelopeSuccess = true
)

func (LiveInputListResponseEnvelopeSuccess) IsKnown

type LiveInputListResponseLiveInput

type LiveInputListResponseLiveInput struct {
	// The date and time the live input was created.
	Created time.Time `json:"created" format:"date-time"`
	// Indicates the number of days after which the live inputs recordings will be
	// deleted. When a stream completes and the recording is ready, the value is used
	// to calculate a scheduled deletion date for that recording. Omit the field to
	// indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion.
	DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing live inputs.
	Meta interface{} `json:"meta"`
	// The date and time the live input was last modified.
	Modified time.Time `json:"modified" format:"date-time"`
	// A unique identifier for a live input.
	UID  string                             `json:"uid"`
	JSON liveInputListResponseLiveInputJSON `json:"-"`
}

func (*LiveInputListResponseLiveInput) UnmarshalJSON

func (r *LiveInputListResponseLiveInput) UnmarshalJSON(data []byte) (err error)

type LiveInputNewParams

type LiveInputNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// Sets the creator ID asssociated with this live input.
	DefaultCreator param.Field[string] `json:"defaultCreator"`
	// Indicates the number of days after which the live inputs recordings will be
	// deleted. When a stream completes and the recording is ready, the value is used
	// to calculate a scheduled deletion date for that recording. Omit the field to
	// indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion.
	DeleteRecordingAfterDays param.Field[float64] `json:"deleteRecordingAfterDays"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing live inputs.
	Meta param.Field[interface{}] `json:"meta"`
	// Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
	// most cases, the video will initially be viewable as a live video and transition
	// to on-demand after a condition is satisfied.
	Recording param.Field[LiveInputNewParamsRecording] `json:"recording"`
}

func (LiveInputNewParams) MarshalJSON

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

type LiveInputNewParamsRecording

type LiveInputNewParamsRecording struct {
	// Lists the origins allowed to display videos created with this input. Enter
	// allowed origin domains in an array and use `*` for wildcard subdomains. An empty
	// array allows videos to be viewed on any origin.
	AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
	// Disables reporting the number of live viewers when this property is set to
	// `true`.
	HideLiveViewerCount param.Field[bool] `json:"hideLiveViewerCount"`
	// Specifies the recording behavior for the live input. Set this value to `off` to
	// prevent a recording. Set the value to `automatic` to begin a recording and
	// transition to on-demand after Stream Live stops receiving input.
	Mode param.Field[LiveInputNewParamsRecordingMode] `json:"mode"`
	// Indicates if a video using the live input has the `requireSignedURLs` property
	// set. Also enforces access controls on any video recording of the livestream with
	// the live input.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
	// Determines the amount of time a live input configured in `automatic` mode should
	// wait before a recording transitions from live to on-demand. `0` is recommended
	// for most use cases and indicates the platform default should be used.
	TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"`
}

Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.

func (LiveInputNewParamsRecording) MarshalJSON

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

type LiveInputNewParamsRecordingMode

type LiveInputNewParamsRecordingMode string

Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.

const (
	LiveInputNewParamsRecordingModeOff       LiveInputNewParamsRecordingMode = "off"
	LiveInputNewParamsRecordingModeAutomatic LiveInputNewParamsRecordingMode = "automatic"
)

func (LiveInputNewParamsRecordingMode) IsKnown

type LiveInputNewResponseEnvelope

type LiveInputNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success LiveInputNewResponseEnvelopeSuccess `json:"success,required"`
	// Details about a live input.
	Result LiveInput                        `json:"result"`
	JSON   liveInputNewResponseEnvelopeJSON `json:"-"`
}

func (*LiveInputNewResponseEnvelope) UnmarshalJSON

func (r *LiveInputNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LiveInputNewResponseEnvelopeSuccess

type LiveInputNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputNewResponseEnvelopeSuccessTrue LiveInputNewResponseEnvelopeSuccess = true
)

func (LiveInputNewResponseEnvelopeSuccess) IsKnown

type LiveInputOutputDeleteParams

type LiveInputOutputDeleteParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type LiveInputOutputListParams

type LiveInputOutputListParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
}

type LiveInputOutputNewParams

type LiveInputOutputNewParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// The streamKey used to authenticate against an output's target.
	StreamKey param.Field[string] `json:"streamKey,required"`
	// The URL an output uses to restream.
	URL param.Field[string] `json:"url,required"`
	// When enabled, live video streamed to the associated live input will be sent to
	// the output URL. When disabled, live video will not be sent to the output URL,
	// even when streaming to the associated live input. Use this to control precisely
	// when you start and stop simulcasting to specific destinations like YouTube and
	// Twitch.
	Enabled param.Field[bool] `json:"enabled"`
}

func (LiveInputOutputNewParams) MarshalJSON

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

type LiveInputOutputNewResponseEnvelope

type LiveInputOutputNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success LiveInputOutputNewResponseEnvelopeSuccess `json:"success,required"`
	Result  Output                                    `json:"result"`
	JSON    liveInputOutputNewResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputOutputNewResponseEnvelope) UnmarshalJSON

func (r *LiveInputOutputNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LiveInputOutputNewResponseEnvelopeSuccess

type LiveInputOutputNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputOutputNewResponseEnvelopeSuccessTrue LiveInputOutputNewResponseEnvelopeSuccess = true
)

func (LiveInputOutputNewResponseEnvelopeSuccess) IsKnown

type LiveInputOutputService

type LiveInputOutputService struct {
	Options []option.RequestOption
}

LiveInputOutputService contains methods and other services that help with interacting with the cloudflare API.

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

func NewLiveInputOutputService

func NewLiveInputOutputService(opts ...option.RequestOption) (r *LiveInputOutputService)

NewLiveInputOutputService 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 (*LiveInputOutputService) Delete

func (r *LiveInputOutputService) Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, body LiveInputOutputDeleteParams, opts ...option.RequestOption) (err error)

Deletes an output and removes it from the associated live input.

func (*LiveInputOutputService) List

func (r *LiveInputOutputService) List(ctx context.Context, liveInputIdentifier string, query LiveInputOutputListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Output], err error)

Retrieves all outputs associated with a specified live input.

func (*LiveInputOutputService) ListAutoPaging

Retrieves all outputs associated with a specified live input.

func (*LiveInputOutputService) New

func (r *LiveInputOutputService) New(ctx context.Context, liveInputIdentifier string, params LiveInputOutputNewParams, opts ...option.RequestOption) (res *Output, err error)

Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs.

func (*LiveInputOutputService) Update

func (r *LiveInputOutputService) Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params LiveInputOutputUpdateParams, opts ...option.RequestOption) (res *Output, err error)

Updates the state of an output.

type LiveInputOutputUpdateParams

type LiveInputOutputUpdateParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// When enabled, live video streamed to the associated live input will be sent to
	// the output URL. When disabled, live video will not be sent to the output URL,
	// even when streaming to the associated live input. Use this to control precisely
	// when you start and stop simulcasting to specific destinations like YouTube and
	// Twitch.
	Enabled param.Field[bool] `json:"enabled,required"`
}

func (LiveInputOutputUpdateParams) MarshalJSON

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

type LiveInputOutputUpdateResponseEnvelope

type LiveInputOutputUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success LiveInputOutputUpdateResponseEnvelopeSuccess `json:"success,required"`
	Result  Output                                       `json:"result"`
	JSON    liveInputOutputUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputOutputUpdateResponseEnvelope) UnmarshalJSON

func (r *LiveInputOutputUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LiveInputOutputUpdateResponseEnvelopeSuccess

type LiveInputOutputUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputOutputUpdateResponseEnvelopeSuccessTrue LiveInputOutputUpdateResponseEnvelopeSuccess = true
)

func (LiveInputOutputUpdateResponseEnvelopeSuccess) IsKnown

type LiveInputRecording

type LiveInputRecording struct {
	// Lists the origins allowed to display videos created with this input. Enter
	// allowed origin domains in an array and use `*` for wildcard subdomains. An empty
	// array allows videos to be viewed on any origin.
	AllowedOrigins []string `json:"allowedOrigins"`
	// Disables reporting the number of live viewers when this property is set to
	// `true`.
	HideLiveViewerCount bool `json:"hideLiveViewerCount"`
	// Specifies the recording behavior for the live input. Set this value to `off` to
	// prevent a recording. Set the value to `automatic` to begin a recording and
	// transition to on-demand after Stream Live stops receiving input.
	Mode LiveInputRecordingMode `json:"mode"`
	// Indicates if a video using the live input has the `requireSignedURLs` property
	// set. Also enforces access controls on any video recording of the livestream with
	// the live input.
	RequireSignedURLs bool `json:"requireSignedURLs"`
	// Determines the amount of time a live input configured in `automatic` mode should
	// wait before a recording transitions from live to on-demand. `0` is recommended
	// for most use cases and indicates the platform default should be used.
	TimeoutSeconds int64                  `json:"timeoutSeconds"`
	JSON           liveInputRecordingJSON `json:"-"`
}

Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.

func (*LiveInputRecording) UnmarshalJSON

func (r *LiveInputRecording) UnmarshalJSON(data []byte) (err error)

type LiveInputRecordingMode

type LiveInputRecordingMode string

Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.

const (
	LiveInputRecordingModeOff       LiveInputRecordingMode = "off"
	LiveInputRecordingModeAutomatic LiveInputRecordingMode = "automatic"
)

func (LiveInputRecordingMode) IsKnown

func (r LiveInputRecordingMode) IsKnown() bool

type LiveInputRtmps

type LiveInputRtmps struct {
	// The secret key to use when streaming via RTMPS to a live input.
	StreamKey string `json:"streamKey"`
	// The RTMPS URL you provide to the broadcaster, which they stream live video to.
	URL  string             `json:"url"`
	JSON liveInputRtmpsJSON `json:"-"`
}

Details for streaming to an live input using RTMPS.

func (*LiveInputRtmps) UnmarshalJSON

func (r *LiveInputRtmps) UnmarshalJSON(data []byte) (err error)

type LiveInputRtmpsPlayback

type LiveInputRtmpsPlayback struct {
	// The secret key to use for playback via RTMPS.
	StreamKey string `json:"streamKey"`
	// The URL used to play live video over RTMPS.
	URL  string                     `json:"url"`
	JSON liveInputRtmpsPlaybackJSON `json:"-"`
}

Details for playback from an live input using RTMPS.

func (*LiveInputRtmpsPlayback) UnmarshalJSON

func (r *LiveInputRtmpsPlayback) UnmarshalJSON(data []byte) (err error)

type LiveInputService

type LiveInputService struct {
	Options []option.RequestOption
	Outputs *LiveInputOutputService
}

LiveInputService contains methods and other services that help with interacting with the cloudflare API.

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

func NewLiveInputService

func NewLiveInputService(opts ...option.RequestOption) (r *LiveInputService)

NewLiveInputService 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 (*LiveInputService) Delete

func (r *LiveInputService) Delete(ctx context.Context, liveInputIdentifier string, body LiveInputDeleteParams, opts ...option.RequestOption) (err error)

Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.

func (*LiveInputService) Get

func (r *LiveInputService) Get(ctx context.Context, liveInputIdentifier string, query LiveInputGetParams, opts ...option.RequestOption) (res *LiveInput, err error)

Retrieves details of an existing live input.

func (*LiveInputService) List

Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.

func (*LiveInputService) New

func (r *LiveInputService) New(ctx context.Context, params LiveInputNewParams, opts ...option.RequestOption) (res *LiveInput, err error)

Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.

func (*LiveInputService) Update

func (r *LiveInputService) Update(ctx context.Context, liveInputIdentifier string, params LiveInputUpdateParams, opts ...option.RequestOption) (res *LiveInput, err error)

Updates a specified live input.

type LiveInputSrt

type LiveInputSrt struct {
	// The secret key to use when streaming via SRT to a live input.
	Passphrase string `json:"passphrase"`
	// The identifier of the live input to use when streaming via SRT.
	StreamID string `json:"streamId"`
	// The SRT URL you provide to the broadcaster, which they stream live video to.
	URL  string           `json:"url"`
	JSON liveInputSrtJSON `json:"-"`
}

Details for streaming to a live input using SRT.

func (*LiveInputSrt) UnmarshalJSON

func (r *LiveInputSrt) UnmarshalJSON(data []byte) (err error)

type LiveInputSrtPlayback

type LiveInputSrtPlayback struct {
	// The secret key to use for playback via SRT.
	Passphrase string `json:"passphrase"`
	// The identifier of the live input to use for playback via SRT.
	StreamID string `json:"streamId"`
	// The URL used to play live video over SRT.
	URL  string                   `json:"url"`
	JSON liveInputSrtPlaybackJSON `json:"-"`
}

Details for playback from an live input using SRT.

func (*LiveInputSrtPlayback) UnmarshalJSON

func (r *LiveInputSrtPlayback) UnmarshalJSON(data []byte) (err error)

type LiveInputStatus

type LiveInputStatus string

The connection status of a live input.

const (
	LiveInputStatusConnected                LiveInputStatus = "connected"
	LiveInputStatusReconnected              LiveInputStatus = "reconnected"
	LiveInputStatusReconnecting             LiveInputStatus = "reconnecting"
	LiveInputStatusClientDisconnect         LiveInputStatus = "client_disconnect"
	LiveInputStatusTTLExceeded              LiveInputStatus = "ttl_exceeded"
	LiveInputStatusFailedToConnect          LiveInputStatus = "failed_to_connect"
	LiveInputStatusFailedToReconnect        LiveInputStatus = "failed_to_reconnect"
	LiveInputStatusNewConfigurationAccepted LiveInputStatus = "new_configuration_accepted"
)

func (LiveInputStatus) IsKnown

func (r LiveInputStatus) IsKnown() bool

type LiveInputUpdateParams

type LiveInputUpdateParams struct {
	// Identifier
	AccountID param.Field[string] `path:"account_id,required"`
	// Sets the creator ID asssociated with this live input.
	DefaultCreator param.Field[string] `json:"defaultCreator"`
	// Indicates the number of days after which the live inputs recordings will be
	// deleted. When a stream completes and the recording is ready, the value is used
	// to calculate a scheduled deletion date for that recording. Omit the field to
	// indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion.
	DeleteRecordingAfterDays param.Field[float64] `json:"deleteRecordingAfterDays"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing live inputs.
	Meta param.Field[interface{}] `json:"meta"`
	// Records the input to a Cloudflare Stream video. Behavior depends on the mode. In
	// most cases, the video will initially be viewable as a live video and transition
	// to on-demand after a condition is satisfied.
	Recording param.Field[LiveInputUpdateParamsRecording] `json:"recording"`
}

func (LiveInputUpdateParams) MarshalJSON

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

type LiveInputUpdateParamsRecording

type LiveInputUpdateParamsRecording struct {
	// Lists the origins allowed to display videos created with this input. Enter
	// allowed origin domains in an array and use `*` for wildcard subdomains. An empty
	// array allows videos to be viewed on any origin.
	AllowedOrigins param.Field[[]string] `json:"allowedOrigins"`
	// Disables reporting the number of live viewers when this property is set to
	// `true`.
	HideLiveViewerCount param.Field[bool] `json:"hideLiveViewerCount"`
	// Specifies the recording behavior for the live input. Set this value to `off` to
	// prevent a recording. Set the value to `automatic` to begin a recording and
	// transition to on-demand after Stream Live stops receiving input.
	Mode param.Field[LiveInputUpdateParamsRecordingMode] `json:"mode"`
	// Indicates if a video using the live input has the `requireSignedURLs` property
	// set. Also enforces access controls on any video recording of the livestream with
	// the live input.
	RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"`
	// Determines the amount of time a live input configured in `automatic` mode should
	// wait before a recording transitions from live to on-demand. `0` is recommended
	// for most use cases and indicates the platform default should be used.
	TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"`
}

Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.

func (LiveInputUpdateParamsRecording) MarshalJSON

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

type LiveInputUpdateParamsRecordingMode

type LiveInputUpdateParamsRecordingMode string

Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.

const (
	LiveInputUpdateParamsRecordingModeOff       LiveInputUpdateParamsRecordingMode = "off"
	LiveInputUpdateParamsRecordingModeAutomatic LiveInputUpdateParamsRecordingMode = "automatic"
)

func (LiveInputUpdateParamsRecordingMode) IsKnown

type LiveInputUpdateResponseEnvelope

type LiveInputUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success LiveInputUpdateResponseEnvelopeSuccess `json:"success,required"`
	// Details about a live input.
	Result LiveInput                           `json:"result"`
	JSON   liveInputUpdateResponseEnvelopeJSON `json:"-"`
}

func (*LiveInputUpdateResponseEnvelope) UnmarshalJSON

func (r *LiveInputUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LiveInputUpdateResponseEnvelopeSuccess

type LiveInputUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputUpdateResponseEnvelopeSuccessTrue LiveInputUpdateResponseEnvelopeSuccess = true
)

func (LiveInputUpdateResponseEnvelopeSuccess) IsKnown

type LiveInputWebRtc

type LiveInputWebRtc struct {
	// The WebRTC URL you provide to the broadcaster, which they stream live video to.
	URL  string              `json:"url"`
	JSON liveInputWebRtcJSON `json:"-"`
}

Details for streaming to a live input using WebRTC.

func (*LiveInputWebRtc) UnmarshalJSON

func (r *LiveInputWebRtc) UnmarshalJSON(data []byte) (err error)

type LiveInputWebRtcPlayback

type LiveInputWebRtcPlayback struct {
	// The URL used to play live video over WebRTC.
	URL  string                      `json:"url"`
	JSON liveInputWebRtcPlaybackJSON `json:"-"`
}

Details for playback from a live input using WebRTC.

func (*LiveInputWebRtcPlayback) UnmarshalJSON

func (r *LiveInputWebRtcPlayback) UnmarshalJSON(data []byte) (err error)

type MemberParam

type MemberParam = shared.MemberParam

This is an alias to an internal type.

type MemberRoleParam

type MemberRoleParam = shared.MemberRoleParam

This is an alias to an internal type.

type MemberRolesPermissionsParam

type MemberRolesPermissionsParam = shared.MemberRolesPermissionsParam

This is an alias to an internal type.

type MemberStatus

type MemberStatus = shared.MemberStatus

A member's status in the account.

This is an alias to an internal type.

type MemberUserParam

type MemberUserParam = shared.MemberUserParam

Details of the user associated to the membership.

This is an alias to an internal type.

type Output

type Output struct {
	// When enabled, live video streamed to the associated live input will be sent to
	// the output URL. When disabled, live video will not be sent to the output URL,
	// even when streaming to the associated live input. Use this to control precisely
	// when you start and stop simulcasting to specific destinations like YouTube and
	// Twitch.
	Enabled bool `json:"enabled"`
	// The streamKey used to authenticate against an output's target.
	StreamKey string `json:"streamKey"`
	// A unique identifier for the output.
	UID string `json:"uid"`
	// The URL an output uses to restream.
	URL  string     `json:"url"`
	JSON outputJSON `json:"-"`
}

func (*Output) UnmarshalJSON

func (r *Output) UnmarshalJSON(data []byte) (err error)

type Permission

type Permission = shared.Permission

This is an alias to an internal type.

type PermissionGrant

type PermissionGrant = shared.PermissionGrant

This is an alias to an internal type.

type PermissionGrantParam

type PermissionGrantParam = shared.PermissionGrantParam

This is an alias to an internal type.

type RatePlan

type RatePlan = shared.RatePlan

The rate plan applied to the subscription.

This is an alias to an internal type.

type RatePlanParam

type RatePlanParam = shared.RatePlanParam

The rate plan applied to the subscription.

This is an alias to an internal type.

type ResponseInfo

type ResponseInfo = shared.ResponseInfo

This is an alias to an internal type.

type Role

type Role = shared.Role

This is an alias to an internal type.

type SortDirection

type SortDirection = shared.SortDirection

Direction to order DNS records in.

This is an alias to an internal type.

type StreamDeleteParams

type StreamDeleteParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type StreamGetParams

type StreamGetParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type StreamGetResponseEnvelope

type StreamGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success StreamGetResponseEnvelopeSuccess `json:"success,required"`
	Result  Video                            `json:"result"`
	JSON    streamGetResponseEnvelopeJSON    `json:"-"`
}

func (*StreamGetResponseEnvelope) UnmarshalJSON

func (r *StreamGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type StreamGetResponseEnvelopeSuccess

type StreamGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	StreamGetResponseEnvelopeSuccessTrue StreamGetResponseEnvelopeSuccess = true
)

func (StreamGetResponseEnvelopeSuccess) IsKnown

type StreamListParams

type StreamListParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// Lists videos in ascending order of creation.
	Asc param.Field[bool] `query:"asc"`
	// A user-defined identifier for the media creator.
	Creator param.Field[string] `query:"creator"`
	// Lists videos created before the specified date.
	End param.Field[time.Time] `query:"end" format:"date-time"`
	// Includes the total number of videos associated with the submitted query
	// parameters.
	IncludeCounts param.Field[bool] `query:"include_counts"`
	// Searches over the `name` key in the `meta` field. This field can be set with or
	// after the upload request.
	Search param.Field[string] `query:"search"`
	// Lists videos created after the specified date.
	Start param.Field[time.Time] `query:"start" format:"date-time"`
	// Specifies the processing status for all quality levels for a video.
	Status param.Field[StreamListParamsStatus] `query:"status"`
	// Specifies whether the video is `vod` or `live`.
	Type param.Field[string] `query:"type"`
}

func (StreamListParams) URLQuery

func (r StreamListParams) URLQuery() (v url.Values)

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

type StreamListParamsStatus

type StreamListParamsStatus string

Specifies the processing status for all quality levels for a video.

const (
	StreamListParamsStatusPendingupload StreamListParamsStatus = "pendingupload"
	StreamListParamsStatusDownloading   StreamListParamsStatus = "downloading"
	StreamListParamsStatusQueued        StreamListParamsStatus = "queued"
	StreamListParamsStatusInprogress    StreamListParamsStatus = "inprogress"
	StreamListParamsStatusReady         StreamListParamsStatus = "ready"
	StreamListParamsStatusError         StreamListParamsStatus = "error"
)

func (StreamListParamsStatus) IsKnown

func (r StreamListParamsStatus) IsKnown() bool

type StreamNewParams

type StreamNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	Body      interface{}         `json:"body,required"`
	// Specifies the TUS protocol version. This value must be included in every upload
	// request. Notes: The only supported version of TUS protocol is 1.0.0.
	TusResumable param.Field[StreamNewParamsTusResumable] `header:"Tus-Resumable,required"`
	// Indicates the size of the entire upload in bytes. The value must be a
	// non-negative integer.
	UploadLength param.Field[int64] `header:"Upload-Length,required"`
	// A user-defined identifier for the media creator.
	UploadCreator param.Field[string] `header:"Upload-Creator"`
	// Comma-separated key-value pairs following the TUS protocol specification. Values
	// are Base-64 encoded. Supported keys: `name`, `requiresignedurls`,
	// `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`.
	UploadMetadata param.Field[string] `header:"Upload-Metadata"`
}

func (StreamNewParams) MarshalJSON

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

type StreamNewParamsTusResumable

type StreamNewParamsTusResumable string

Specifies the TUS protocol version. This value must be included in every upload request. Notes: The only supported version of TUS protocol is 1.0.0.

const (
	StreamNewParamsTusResumable1_0_0 StreamNewParamsTusResumable = "1.0.0"
)

func (StreamNewParamsTusResumable) IsKnown

func (r StreamNewParamsTusResumable) IsKnown() bool

type StreamService

type StreamService struct {
	Options      []option.RequestOption
	AudioTracks  *AudioTrackService
	Videos       *VideoService
	Clip         *ClipService
	Copy         *CopyService
	DirectUpload *DirectUploadService
	Keys         *KeyService
	LiveInputs   *LiveInputService
	Watermarks   *WatermarkService
	Webhooks     *WebhookService
	Captions     *CaptionService
	Downloads    *DownloadService
	Embed        *EmbedService
	Token        *TokenService
}

StreamService contains methods and other services that help with interacting with the cloudflare API.

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

func NewStreamService

func NewStreamService(opts ...option.RequestOption) (r *StreamService)

NewStreamService 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 (*StreamService) Delete

func (r *StreamService) Delete(ctx context.Context, identifier string, body StreamDeleteParams, opts ...option.RequestOption) (err error)

Deletes a video and its copies from Cloudflare Stream.

func (*StreamService) Get

func (r *StreamService) Get(ctx context.Context, identifier string, query StreamGetParams, opts ...option.RequestOption) (res *Video, err error)

Fetches details for a single video.

func (*StreamService) List

Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.

func (*StreamService) ListAutoPaging

Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.

func (*StreamService) New

func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts ...option.RequestOption) (err error)

Initiates a video upload using the TUS protocol. On success, the server responds with a status code 201 (created) and includes a `location` header to indicate where the content should be uploaded. Refer to https://tus.io for protocol details.

type Subscription

type Subscription = shared.Subscription

This is an alias to an internal type.

type SubscriptionFrequency

type SubscriptionFrequency = shared.SubscriptionFrequency

How often the subscription is renewed automatically.

This is an alias to an internal type.

type SubscriptionParam

type SubscriptionParam = shared.SubscriptionParam

This is an alias to an internal type.

type SubscriptionState

type SubscriptionState = shared.SubscriptionState

The state that the subscription is in.

This is an alias to an internal type.

type TokenNewParams

type TokenNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// The optional ID of a Stream signing key. If present, the `pem` field is also
	// required.
	ID param.Field[string] `json:"id"`
	// The optional list of access rule constraints on the token. Access can be blocked
	// or allowed based on an IP, IP range, or by country. Access rules are evaluated
	// from first to last. If a rule matches, the associated action is applied and no
	// further rules are evaluated.
	AccessRules param.Field[[]TokenNewParamsAccessRule] `json:"accessRules"`
	// The optional boolean value that enables using signed tokens to access MP4
	// download links for a video.
	Downloadable param.Field[bool] `json:"downloadable"`
	// The optional unix epoch timestamp that specficies the time after a token is not
	// accepted. The maximum time specification is 24 hours from issuing time. If this
	// field is not set, the default is one hour after issuing.
	Exp param.Field[int64] `json:"exp"`
	// The optional unix epoch timestamp that specifies the time before a the token is
	// not accepted. If this field is not set, the default is one hour before issuing.
	Nbf param.Field[int64] `json:"nbf"`
	// The optional base64 encoded private key in PEM format associated with a Stream
	// signing key. If present, the `id` field is also required.
	Pem param.Field[string] `json:"pem"`
}

func (TokenNewParams) MarshalJSON

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

type TokenNewParamsAccessRule

type TokenNewParamsAccessRule struct {
	// The action to take when a request matches a rule. If the action is `block`, the
	// signed token blocks views for viewers matching the rule.
	Action param.Field[TokenNewParamsAccessRulesAction] `json:"action"`
	// An array of 2-letter country codes in ISO 3166-1 Alpha-2 format used to match
	// requests.
	Country param.Field[[]string] `json:"country"`
	// An array of IPv4 or IPV6 addresses or CIDRs used to match requests.
	IP param.Field[[]string] `json:"ip"`
	// Lists available rule types to match for requests. An `any` type matches all
	// requests and can be used as a wildcard to apply default actions after other
	// rules.
	Type param.Field[TokenNewParamsAccessRulesType] `json:"type"`
}

Defines rules for fine-grained control over content than signed URL tokens alone. Access rules primarily make tokens conditionally valid based on user information. Access Rules are specified on token payloads as the `accessRules` property containing an array of Rule objects.

func (TokenNewParamsAccessRule) MarshalJSON

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

type TokenNewParamsAccessRulesAction

type TokenNewParamsAccessRulesAction string

The action to take when a request matches a rule. If the action is `block`, the signed token blocks views for viewers matching the rule.

const (
	TokenNewParamsAccessRulesActionAllow TokenNewParamsAccessRulesAction = "allow"
	TokenNewParamsAccessRulesActionBlock TokenNewParamsAccessRulesAction = "block"
)

func (TokenNewParamsAccessRulesAction) IsKnown

type TokenNewParamsAccessRulesType

type TokenNewParamsAccessRulesType string

Lists available rule types to match for requests. An `any` type matches all requests and can be used as a wildcard to apply default actions after other rules.

const (
	TokenNewParamsAccessRulesTypeAny            TokenNewParamsAccessRulesType = "any"
	TokenNewParamsAccessRulesTypeIPSrc          TokenNewParamsAccessRulesType = "ip.src"
	TokenNewParamsAccessRulesTypeIPGeoipCountry TokenNewParamsAccessRulesType = "ip.geoip.country"
)

func (TokenNewParamsAccessRulesType) IsKnown

func (r TokenNewParamsAccessRulesType) IsKnown() bool

type TokenNewResponse

type TokenNewResponse struct {
	// The signed token used with the signed URLs feature.
	Token string               `json:"token"`
	JSON  tokenNewResponseJSON `json:"-"`
}

func (*TokenNewResponse) UnmarshalJSON

func (r *TokenNewResponse) UnmarshalJSON(data []byte) (err error)

type TokenNewResponseEnvelope

type TokenNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success TokenNewResponseEnvelopeSuccess `json:"success,required"`
	Result  TokenNewResponse                `json:"result"`
	JSON    tokenNewResponseEnvelopeJSON    `json:"-"`
}

func (*TokenNewResponseEnvelope) UnmarshalJSON

func (r *TokenNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenNewResponseEnvelopeSuccess

type TokenNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenNewResponseEnvelopeSuccessTrue TokenNewResponseEnvelopeSuccess = true
)

func (TokenNewResponseEnvelopeSuccess) IsKnown

type TokenService

type TokenService struct {
	Options []option.RequestOption
}

TokenService contains methods and other services that help with interacting with the cloudflare API.

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

func NewTokenService

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) New

func (r *TokenService) New(ctx context.Context, identifier string, params TokenNewParams, opts ...option.RequestOption) (res *TokenNewResponse, err error)

Creates a signed URL token for a video. If a body is not provided in the request, a token is created with default values.

type Video

type Video struct {
	// Lists the origins allowed to display the video. Enter allowed origin domains in
	// an array and use `*` for wildcard subdomains. Empty arrays allow the video to be
	// viewed on any origin.
	AllowedOrigins []AllowedOrigins `json:"allowedOrigins"`
	// The date and time the media item was created.
	Created time.Time `json:"created" format:"date-time"`
	// A user-defined identifier for the media creator.
	Creator string `json:"creator"`
	// The duration of the video in seconds. A value of `-1` means the duration is
	// unknown. The duration becomes available after the upload and before the video is
	// ready.
	Duration float64    `json:"duration"`
	Input    VideoInput `json:"input"`
	// The live input ID used to upload a video with Stream Live.
	LiveInput string `json:"liveInput"`
	// The maximum duration in seconds for a video upload. Can be set for a video that
	// is not yet uploaded to limit its duration. Uploads that exceed the specified
	// duration will fail during processing. A value of `-1` means the value is
	// unknown.
	MaxDurationSeconds int64 `json:"maxDurationSeconds"`
	// A user modifiable key-value store used to reference other systems of record for
	// managing videos.
	Meta interface{} `json:"meta"`
	// The date and time the media item was last modified.
	Modified time.Time     `json:"modified" format:"date-time"`
	Playback VideoPlayback `json:"playback"`
	// The video's preview page URI. This field is omitted until encoding is complete.
	Preview string `json:"preview" format:"uri"`
	// Indicates whether the video is playable. The field is empty if the video is not
	// ready for viewing or the live stream is still in progress.
	ReadyToStream bool `json:"readyToStream"`
	// Indicates the time at which the video became playable. The field is empty if the
	// video is not ready for viewing or the live stream is still in progress.
	ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"`
	// Indicates whether the video can be a accessed using the UID. When set to `true`,
	// a signed token must be generated with a signing key to view the video.
	RequireSignedURLs bool `json:"requireSignedURLs"`
	// Indicates the date and time at which the video will be deleted. Omit the field
	// to indicate no change, or include with a `null` value to remove an existing
	// scheduled deletion. If specified, must be at least 30 days from upload time.
	ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"`
	// The size of the media item in bytes.
	Size float64 `json:"size"`
	// Specifies a detailed status for a video. If the `state` is `inprogress` or
	// `error`, the `step` field returns `encoding` or `manifest`. If the `state` is
	// `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the
	// approximate percent of completion. If the `state` is `error`, `errorReasonCode`
	// and `errorReasonText` provide additional details.
	Status VideoStatus `json:"status"`
	// The media item's thumbnail URI. This field is omitted until encoding is
	// complete.
	Thumbnail string `json:"thumbnail" format:"uri"`
	// The timestamp for a thumbnail image calculated as a percentage value of the
	// video's duration. To convert from a second-wise timestamp to a percentage,
	// divide the desired timestamp by the total duration of the video. If this value
	// is not set, the default thumbnail image is taken from 0s of the video.
	ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"`
	// A Cloudflare-generated unique identifier for a media item.
	UID string `json:"uid"`
	// The date and time the media item was uploaded.
	Uploaded time.Time `json:"uploaded" format:"date-time"`
	// The date and time when the video upload URL is no longer valid for direct user
	// uploads.
	UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"`
	Watermark    Watermark `json:"watermark"`
	JSON         videoJSON `json:"-"`
}

func (*Video) UnmarshalJSON

func (r *Video) UnmarshalJSON(data []byte) (err error)

type VideoInput

type VideoInput struct {
	// The video height in pixels. A value of `-1` means the height is unknown. The
	// value becomes available after the upload and before the video is ready.
	Height int64 `json:"height"`
	// The video width in pixels. A value of `-1` means the width is unknown. The value
	// becomes available after the upload and before the video is ready.
	Width int64          `json:"width"`
	JSON  videoInputJSON `json:"-"`
}

func (*VideoInput) UnmarshalJSON

func (r *VideoInput) UnmarshalJSON(data []byte) (err error)

type VideoPlayback

type VideoPlayback struct {
	// DASH Media Presentation Description for the video.
	Dash string `json:"dash"`
	// The HLS manifest for the video.
	Hls  string            `json:"hls"`
	JSON videoPlaybackJSON `json:"-"`
}

func (*VideoPlayback) UnmarshalJSON

func (r *VideoPlayback) UnmarshalJSON(data []byte) (err error)

type VideoService

type VideoService struct {
	Options []option.RequestOption
}

VideoService contains methods and other services that help with interacting with the cloudflare API.

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

func NewVideoService

func NewVideoService(opts ...option.RequestOption) (r *VideoService)

NewVideoService 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 (*VideoService) StorageUsage

func (r *VideoService) StorageUsage(ctx context.Context, params VideoStorageUsageParams, opts ...option.RequestOption) (res *VideoStorageUsageResponse, err error)

Returns information about an account's storage use.

type VideoStatus

type VideoStatus struct {
	// Specifies why the video failed to encode. This field is empty if the video is
	// not in an `error` state. Preferred for programmatic use.
	ErrorReasonCode string `json:"errorReasonCode"`
	// Specifies why the video failed to encode using a human readable error message in
	// English. This field is empty if the video is not in an `error` state.
	ErrorReasonText string `json:"errorReasonText"`
	// Indicates the size of the entire upload in bytes. The value must be a
	// non-negative integer.
	PctComplete string `json:"pctComplete"`
	// Specifies the processing status for all quality levels for a video.
	State VideoStatusState `json:"state"`
	JSON  videoStatusJSON  `json:"-"`
}

Specifies a detailed status for a video. If the `state` is `inprogress` or `error`, the `step` field returns `encoding` or `manifest`. If the `state` is `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the approximate percent of completion. If the `state` is `error`, `errorReasonCode` and `errorReasonText` provide additional details.

func (*VideoStatus) UnmarshalJSON

func (r *VideoStatus) UnmarshalJSON(data []byte) (err error)

type VideoStatusState

type VideoStatusState string

Specifies the processing status for all quality levels for a video.

const (
	VideoStatusStatePendingupload VideoStatusState = "pendingupload"
	VideoStatusStateDownloading   VideoStatusState = "downloading"
	VideoStatusStateQueued        VideoStatusState = "queued"
	VideoStatusStateInprogress    VideoStatusState = "inprogress"
	VideoStatusStateReady         VideoStatusState = "ready"
	VideoStatusStateError         VideoStatusState = "error"
)

func (VideoStatusState) IsKnown

func (r VideoStatusState) IsKnown() bool

type VideoStorageUsageParams

type VideoStorageUsageParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// A user-defined identifier for the media creator.
	Creator param.Field[string] `query:"creator"`
}

func (VideoStorageUsageParams) URLQuery

func (r VideoStorageUsageParams) URLQuery() (v url.Values)

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

type VideoStorageUsageResponse

type VideoStorageUsageResponse struct {
	// A user-defined identifier for the media creator.
	Creator string `json:"creator"`
	// The total minutes of video content stored in the account.
	TotalStorageMinutes int64 `json:"totalStorageMinutes"`
	// The storage capacity alloted for the account.
	TotalStorageMinutesLimit int64 `json:"totalStorageMinutesLimit"`
	// The total count of videos associated with the account.
	VideoCount int64                         `json:"videoCount"`
	JSON       videoStorageUsageResponseJSON `json:"-"`
}

func (*VideoStorageUsageResponse) UnmarshalJSON

func (r *VideoStorageUsageResponse) UnmarshalJSON(data []byte) (err error)

type VideoStorageUsageResponseEnvelope

type VideoStorageUsageResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success VideoStorageUsageResponseEnvelopeSuccess `json:"success,required"`
	Result  VideoStorageUsageResponse                `json:"result"`
	JSON    videoStorageUsageResponseEnvelopeJSON    `json:"-"`
}

func (*VideoStorageUsageResponseEnvelope) UnmarshalJSON

func (r *VideoStorageUsageResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type VideoStorageUsageResponseEnvelopeSuccess

type VideoStorageUsageResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	VideoStorageUsageResponseEnvelopeSuccessTrue VideoStorageUsageResponseEnvelopeSuccess = true
)

func (VideoStorageUsageResponseEnvelopeSuccess) IsKnown

type Watermark

type Watermark struct {
	// The date and a time a watermark profile was created.
	Created time.Time `json:"created" format:"date-time"`
	// The source URL for a downloaded image. If the watermark profile was created via
	// direct upload, this field is null.
	DownloadedFrom string `json:"downloadedFrom"`
	// The height of the image in pixels.
	Height int64 `json:"height"`
	// A short description of the watermark profile.
	Name string `json:"name"`
	// The translucency of the image. A value of `0.0` makes the image completely
	// transparent, and `1.0` makes the image completely opaque. Note that if the image
	// is already semi-transparent, setting this to `1.0` will not make the image
	// completely opaque.
	Opacity float64 `json:"opacity"`
	// The whitespace between the adjacent edges (determined by position) of the video
	// and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
	// video width or length, as determined by the algorithm.
	Padding float64 `json:"padding"`
	// The location of the image. Valid positions are: `upperRight`, `upperLeft`,
	// `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
	// `padding` parameter.
	Position string `json:"position"`
	// The size of the image relative to the overall size of the video. This parameter
	// will adapt to horizontal and vertical videos automatically. `0.0` indicates no
	// scaling (use the size of the image as-is), and `1.0 `fills the entire video.
	Scale float64 `json:"scale"`
	// The size of the image in bytes.
	Size float64 `json:"size"`
	// The unique identifier for a watermark profile.
	UID string `json:"uid"`
	// The width of the image in pixels.
	Width int64         `json:"width"`
	JSON  watermarkJSON `json:"-"`
}

func (*Watermark) UnmarshalJSON

func (r *Watermark) UnmarshalJSON(data []byte) (err error)

type WatermarkDeleteParams

type WatermarkDeleteParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type WatermarkDeleteResponseEnvelope

type WatermarkDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success WatermarkDeleteResponseEnvelopeSuccess `json:"success,required"`
	Result  string                                 `json:"result"`
	JSON    watermarkDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*WatermarkDeleteResponseEnvelope) UnmarshalJSON

func (r *WatermarkDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type WatermarkDeleteResponseEnvelopeSuccess

type WatermarkDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkDeleteResponseEnvelopeSuccessTrue WatermarkDeleteResponseEnvelopeSuccess = true
)

func (WatermarkDeleteResponseEnvelopeSuccess) IsKnown

type WatermarkGetParams

type WatermarkGetParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type WatermarkGetResponseEnvelope

type WatermarkGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success WatermarkGetResponseEnvelopeSuccess `json:"success,required"`
	Result  Watermark                           `json:"result"`
	JSON    watermarkGetResponseEnvelopeJSON    `json:"-"`
}

func (*WatermarkGetResponseEnvelope) UnmarshalJSON

func (r *WatermarkGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type WatermarkGetResponseEnvelopeSuccess

type WatermarkGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkGetResponseEnvelopeSuccessTrue WatermarkGetResponseEnvelopeSuccess = true
)

func (WatermarkGetResponseEnvelopeSuccess) IsKnown

type WatermarkListParams

type WatermarkListParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type WatermarkNewParams

type WatermarkNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// The image file to upload.
	File param.Field[string] `json:"file,required"`
	// A short description of the watermark profile.
	Name param.Field[string] `json:"name"`
	// The translucency of the image. A value of `0.0` makes the image completely
	// transparent, and `1.0` makes the image completely opaque. Note that if the image
	// is already semi-transparent, setting this to `1.0` will not make the image
	// completely opaque.
	Opacity param.Field[float64] `json:"opacity"`
	// The whitespace between the adjacent edges (determined by position) of the video
	// and the image. `0.0` indicates no padding, and `1.0` indicates a fully padded
	// video width or length, as determined by the algorithm.
	Padding param.Field[float64] `json:"padding"`
	// The location of the image. Valid positions are: `upperRight`, `upperLeft`,
	// `lowerLeft`, `lowerRight`, and `center`. Note that `center` ignores the
	// `padding` parameter.
	Position param.Field[string] `json:"position"`
	// The size of the image relative to the overall size of the video. This parameter
	// will adapt to horizontal and vertical videos automatically. `0.0` indicates no
	// scaling (use the size of the image as-is), and `1.0 `fills the entire video.
	Scale param.Field[float64] `json:"scale"`
}

func (WatermarkNewParams) MarshalMultipart

func (r WatermarkNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type WatermarkNewResponseEnvelope

type WatermarkNewResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success WatermarkNewResponseEnvelopeSuccess `json:"success,required"`
	Result  Watermark                           `json:"result"`
	JSON    watermarkNewResponseEnvelopeJSON    `json:"-"`
}

func (*WatermarkNewResponseEnvelope) UnmarshalJSON

func (r *WatermarkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type WatermarkNewResponseEnvelopeSuccess

type WatermarkNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkNewResponseEnvelopeSuccessTrue WatermarkNewResponseEnvelopeSuccess = true
)

func (WatermarkNewResponseEnvelopeSuccess) IsKnown

type WatermarkService

type WatermarkService struct {
	Options []option.RequestOption
}

WatermarkService contains methods and other services that help with interacting with the cloudflare API.

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

func NewWatermarkService

func NewWatermarkService(opts ...option.RequestOption) (r *WatermarkService)

NewWatermarkService 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 (*WatermarkService) Delete

func (r *WatermarkService) Delete(ctx context.Context, identifier string, body WatermarkDeleteParams, opts ...option.RequestOption) (res *string, err error)

Deletes a watermark profile.

func (*WatermarkService) Get

func (r *WatermarkService) Get(ctx context.Context, identifier string, query WatermarkGetParams, opts ...option.RequestOption) (res *Watermark, err error)

Retrieves details for a single watermark profile.

func (*WatermarkService) List

Lists all watermark profiles for an account.

func (*WatermarkService) ListAutoPaging

Lists all watermark profiles for an account.

func (*WatermarkService) New

func (r *WatermarkService) New(ctx context.Context, params WatermarkNewParams, opts ...option.RequestOption) (res *Watermark, err error)

Creates watermark profiles using a single `HTTP POST multipart/form-data` request.

type WebhookDeleteParams

type WebhookDeleteParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type WebhookDeleteResponseEnvelope

type WebhookDeleteResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success WebhookDeleteResponseEnvelopeSuccess `json:"success,required"`
	Result  string                               `json:"result"`
	JSON    webhookDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*WebhookDeleteResponseEnvelope) UnmarshalJSON

func (r *WebhookDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type WebhookDeleteResponseEnvelopeSuccess

type WebhookDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WebhookDeleteResponseEnvelopeSuccessTrue WebhookDeleteResponseEnvelopeSuccess = true
)

func (WebhookDeleteResponseEnvelopeSuccess) IsKnown

type WebhookGetParams

type WebhookGetParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
}

type WebhookGetResponse

type WebhookGetResponse = interface{}

type WebhookGetResponseEnvelope

type WebhookGetResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success WebhookGetResponseEnvelopeSuccess `json:"success,required"`
	Result  WebhookGetResponse                `json:"result"`
	JSON    webhookGetResponseEnvelopeJSON    `json:"-"`
}

func (*WebhookGetResponseEnvelope) UnmarshalJSON

func (r *WebhookGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type WebhookGetResponseEnvelopeSuccess

type WebhookGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WebhookGetResponseEnvelopeSuccessTrue WebhookGetResponseEnvelopeSuccess = true
)

func (WebhookGetResponseEnvelopeSuccess) IsKnown

type WebhookService

type WebhookService struct {
	Options []option.RequestOption
}

WebhookService contains methods and other services that help with interacting with the cloudflare API.

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

func NewWebhookService

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

func (r *WebhookService) Delete(ctx context.Context, body WebhookDeleteParams, opts ...option.RequestOption) (res *string, err error)

Deletes a webhook.

func (*WebhookService) Get

Retrieves a list of webhooks.

func (*WebhookService) Update

Creates a webhook notification.

type WebhookUpdateParams

type WebhookUpdateParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,required"`
	// The URL where webhooks will be sent.
	NotificationURL param.Field[string] `json:"notificationUrl,required" format:"uri"`
}

func (WebhookUpdateParams) MarshalJSON

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

type WebhookUpdateResponse

type WebhookUpdateResponse = interface{}

type WebhookUpdateResponseEnvelope

type WebhookUpdateResponseEnvelope struct {
	Errors   []shared.ResponseInfo `json:"errors,required"`
	Messages []shared.ResponseInfo `json:"messages,required"`
	// Whether the API call was successful
	Success WebhookUpdateResponseEnvelopeSuccess `json:"success,required"`
	Result  WebhookUpdateResponse                `json:"result"`
	JSON    webhookUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*WebhookUpdateResponseEnvelope) UnmarshalJSON

func (r *WebhookUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type WebhookUpdateResponseEnvelopeSuccess

type WebhookUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WebhookUpdateResponseEnvelopeSuccessTrue WebhookUpdateResponseEnvelopeSuccess = true
)

func (WebhookUpdateResponseEnvelopeSuccess) IsKnown

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL