stream

package
v2.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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   []AudioTrackCopyResponseEnvelopeErrors   `json:"errors,required"`
	Messages []AudioTrackCopyResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamAdditionalAudio                    `json:"result,required"`
	// Whether the API call was successful
	Success AudioTrackCopyResponseEnvelopeSuccess `json:"success,required"`
	JSON    audioTrackCopyResponseEnvelopeJSON    `json:"-"`
}

func (*AudioTrackCopyResponseEnvelope) UnmarshalJSON

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

type AudioTrackCopyResponseEnvelopeErrors

type AudioTrackCopyResponseEnvelopeErrors struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    audioTrackCopyResponseEnvelopeErrorsJSON `json:"-"`
}

func (*AudioTrackCopyResponseEnvelopeErrors) UnmarshalJSON

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

type AudioTrackCopyResponseEnvelopeMessages

type AudioTrackCopyResponseEnvelopeMessages struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    audioTrackCopyResponseEnvelopeMessagesJSON `json:"-"`
}

func (*AudioTrackCopyResponseEnvelopeMessages) UnmarshalJSON

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

type AudioTrackCopyResponseEnvelopeSuccess

type AudioTrackCopyResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackCopyResponseEnvelopeSuccessTrue AudioTrackCopyResponseEnvelopeSuccess = true
)

type AudioTrackDeleteParams

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

type AudioTrackDeleteResponse

type AudioTrackDeleteResponse interface {
	ImplementsStreamAudioTrackDeleteResponse()
}

Union satisfied by stream.AudioTrackDeleteResponseUnknown or shared.UnionString.

type AudioTrackDeleteResponseEnvelope

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

func (*AudioTrackDeleteResponseEnvelope) UnmarshalJSON

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

type AudioTrackDeleteResponseEnvelopeErrors

type AudioTrackDeleteResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    audioTrackDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*AudioTrackDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type AudioTrackDeleteResponseEnvelopeMessages

type AudioTrackDeleteResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    audioTrackDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*AudioTrackDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type AudioTrackDeleteResponseEnvelopeSuccess

type AudioTrackDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackDeleteResponseEnvelopeSuccessTrue AudioTrackDeleteResponseEnvelopeSuccess = true
)

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   []AudioTrackEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []AudioTrackEditResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamAdditionalAudio                    `json:"result,required"`
	// Whether the API call was successful
	Success AudioTrackEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    audioTrackEditResponseEnvelopeJSON    `json:"-"`
}

func (*AudioTrackEditResponseEnvelope) UnmarshalJSON

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

type AudioTrackEditResponseEnvelopeErrors

type AudioTrackEditResponseEnvelopeErrors struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    audioTrackEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*AudioTrackEditResponseEnvelopeErrors) UnmarshalJSON

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

type AudioTrackEditResponseEnvelopeMessages

type AudioTrackEditResponseEnvelopeMessages struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    audioTrackEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*AudioTrackEditResponseEnvelopeMessages) UnmarshalJSON

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

type AudioTrackEditResponseEnvelopeSuccess

type AudioTrackEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackEditResponseEnvelopeSuccessTrue AudioTrackEditResponseEnvelopeSuccess = true
)

type AudioTrackGetParams

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

type AudioTrackGetResponseEnvelope

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

func (*AudioTrackGetResponseEnvelope) UnmarshalJSON

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

type AudioTrackGetResponseEnvelopeErrors

type AudioTrackGetResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    audioTrackGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*AudioTrackGetResponseEnvelopeErrors) UnmarshalJSON

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

type AudioTrackGetResponseEnvelopeMessages

type AudioTrackGetResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    audioTrackGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*AudioTrackGetResponseEnvelopeMessages) UnmarshalJSON

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

type AudioTrackGetResponseEnvelopeSuccess

type AudioTrackGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	AudioTrackGetResponseEnvelopeSuccessTrue AudioTrackGetResponseEnvelopeSuccess = true
)

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 *StreamAdditionalAudio, 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 *AudioTrackDeleteResponse, 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 *StreamAdditionalAudio, 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 *[]StreamAdditionalAudio, err error)

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

type CaptionDeleteParams

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

type CaptionDeleteResponse

type CaptionDeleteResponse interface {
	ImplementsStreamCaptionDeleteResponse()
}

Union satisfied by stream.CaptionDeleteResponseUnknown, stream.CaptionDeleteResponseArray or shared.UnionString.

type CaptionDeleteResponseArray

type CaptionDeleteResponseArray []interface{}

func (CaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponse

func (r CaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponse()

type CaptionDeleteResponseEnvelope

type CaptionDeleteResponseEnvelope struct {
	Errors   []CaptionDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CaptionDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   CaptionDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success CaptionDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    captionDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionDeleteResponseEnvelope) UnmarshalJSON

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

type CaptionDeleteResponseEnvelopeErrors

type CaptionDeleteResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    captionDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CaptionDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type CaptionDeleteResponseEnvelopeMessages

type CaptionDeleteResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    captionDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CaptionDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type CaptionDeleteResponseEnvelopeSuccess

type CaptionDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionDeleteResponseEnvelopeSuccessTrue CaptionDeleteResponseEnvelopeSuccess = true
)

type CaptionGetParams

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

type CaptionGetResponseEnvelope

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

func (*CaptionGetResponseEnvelope) UnmarshalJSON

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

type CaptionGetResponseEnvelopeErrors

type CaptionGetResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    captionGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CaptionGetResponseEnvelopeErrors) UnmarshalJSON

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

type CaptionGetResponseEnvelopeMessages

type CaptionGetResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    captionGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CaptionGetResponseEnvelopeMessages) UnmarshalJSON

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

type CaptionGetResponseEnvelopeSuccess

type CaptionGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionGetResponseEnvelopeSuccessTrue CaptionGetResponseEnvelopeSuccess = true
)

type CaptionService

type CaptionService struct {
	Options []option.RequestOption
}

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

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

Removes the captions or subtitles from a video.

func (*CaptionService) Get

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

Lists the available captions or subtitles for a specific video.

func (*CaptionService) Update

func (r *CaptionService) Update(ctx context.Context, identifier string, language string, params CaptionUpdateParams, opts ...option.RequestOption) (res *CaptionUpdateResponse, 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 CaptionUpdateParams

type CaptionUpdateParams 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 (CaptionUpdateParams) MarshalJSON

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

type CaptionUpdateResponse

type CaptionUpdateResponse interface {
	ImplementsStreamCaptionUpdateResponse()
}

Union satisfied by stream.CaptionUpdateResponseUnknown or shared.UnionString.

type CaptionUpdateResponseEnvelope

type CaptionUpdateResponseEnvelope struct {
	Errors   []CaptionUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CaptionUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   CaptionUpdateResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success CaptionUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    captionUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*CaptionUpdateResponseEnvelope) UnmarshalJSON

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

type CaptionUpdateResponseEnvelopeErrors

type CaptionUpdateResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    captionUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CaptionUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type CaptionUpdateResponseEnvelopeMessages

type CaptionUpdateResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    captionUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CaptionUpdateResponseEnvelopeMessages) UnmarshalJSON

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

type CaptionUpdateResponseEnvelopeSuccess

type CaptionUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CaptionUpdateResponseEnvelopeSuccessTrue CaptionUpdateResponseEnvelopeSuccess = true
)

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[[]string] `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   []ClipNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []ClipNewResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamClipping                    `json:"result,required"`
	// Whether the API call was successful
	Success ClipNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    clipNewResponseEnvelopeJSON    `json:"-"`
}

func (*ClipNewResponseEnvelope) UnmarshalJSON

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

type ClipNewResponseEnvelopeErrors

type ClipNewResponseEnvelopeErrors struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    clipNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*ClipNewResponseEnvelopeErrors) UnmarshalJSON

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

type ClipNewResponseEnvelopeMessages

type ClipNewResponseEnvelopeMessages struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    clipNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*ClipNewResponseEnvelopeMessages) UnmarshalJSON

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

type ClipNewResponseEnvelopeSuccess

type ClipNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	ClipNewResponseEnvelopeSuccessTrue ClipNewResponseEnvelopeSuccess = true
)

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 *StreamClipping, err error)

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

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[[]string] `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   []CopyNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []CopyNewResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamVideos                      `json:"result,required"`
	// Whether the API call was successful
	Success CopyNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    copyNewResponseEnvelopeJSON    `json:"-"`
}

func (*CopyNewResponseEnvelope) UnmarshalJSON

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

type CopyNewResponseEnvelopeErrors

type CopyNewResponseEnvelopeErrors struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    copyNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*CopyNewResponseEnvelopeErrors) UnmarshalJSON

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

type CopyNewResponseEnvelopeMessages

type CopyNewResponseEnvelopeMessages struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    copyNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*CopyNewResponseEnvelopeMessages) UnmarshalJSON

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

type CopyNewResponseEnvelopeSuccess

type CopyNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	CopyNewResponseEnvelopeSuccessTrue CopyNewResponseEnvelopeSuccess = true
)

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 *StreamVideos, 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[[]string] `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 StreamWatermarks            `json:"watermark"`
	JSON      directUploadNewResponseJSON `json:"-"`
}

func (*DirectUploadNewResponse) UnmarshalJSON

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

type DirectUploadNewResponseEnvelope

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

func (*DirectUploadNewResponseEnvelope) UnmarshalJSON

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

type DirectUploadNewResponseEnvelopeErrors

type DirectUploadNewResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    directUploadNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*DirectUploadNewResponseEnvelopeErrors) UnmarshalJSON

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

type DirectUploadNewResponseEnvelopeMessages

type DirectUploadNewResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    directUploadNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*DirectUploadNewResponseEnvelopeMessages) UnmarshalJSON

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

type DirectUploadNewResponseEnvelopeSuccess

type DirectUploadNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DirectUploadNewResponseEnvelopeSuccessTrue DirectUploadNewResponseEnvelopeSuccess = true
)

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 DownloadDeleteResponse

type DownloadDeleteResponse interface {
	ImplementsStreamDownloadDeleteResponse()
}

Union satisfied by stream.DownloadDeleteResponseUnknown or shared.UnionString.

type DownloadDeleteResponseEnvelope

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

func (*DownloadDeleteResponseEnvelope) UnmarshalJSON

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

type DownloadDeleteResponseEnvelopeErrors

type DownloadDeleteResponseEnvelopeErrors struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    downloadDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*DownloadDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type DownloadDeleteResponseEnvelopeMessages

type DownloadDeleteResponseEnvelopeMessages struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    downloadDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*DownloadDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type DownloadDeleteResponseEnvelopeSuccess

type DownloadDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DownloadDeleteResponseEnvelopeSuccessTrue DownloadDeleteResponseEnvelopeSuccess = true
)

type DownloadGetParams

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

type DownloadGetResponse

type DownloadGetResponse interface {
	ImplementsStreamDownloadGetResponse()
}

Union satisfied by stream.DownloadGetResponseUnknown or shared.UnionString.

type DownloadGetResponseEnvelope

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

func (*DownloadGetResponseEnvelope) UnmarshalJSON

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

type DownloadGetResponseEnvelopeErrors

type DownloadGetResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    downloadGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*DownloadGetResponseEnvelopeErrors) UnmarshalJSON

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

type DownloadGetResponseEnvelopeMessages

type DownloadGetResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    downloadGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*DownloadGetResponseEnvelopeMessages) UnmarshalJSON

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

type DownloadGetResponseEnvelopeSuccess

type DownloadGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DownloadGetResponseEnvelopeSuccessTrue DownloadGetResponseEnvelopeSuccess = true
)

type DownloadNewParams

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

type DownloadNewResponse

type DownloadNewResponse interface {
	ImplementsStreamDownloadNewResponse()
}

Union satisfied by stream.DownloadNewResponseUnknown or shared.UnionString.

type DownloadNewResponseEnvelope

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

func (*DownloadNewResponseEnvelope) UnmarshalJSON

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

type DownloadNewResponseEnvelopeErrors

type DownloadNewResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    downloadNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*DownloadNewResponseEnvelopeErrors) UnmarshalJSON

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

type DownloadNewResponseEnvelopeMessages

type DownloadNewResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    downloadNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*DownloadNewResponseEnvelopeMessages) UnmarshalJSON

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

type DownloadNewResponseEnvelopeSuccess

type DownloadNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	DownloadNewResponseEnvelopeSuccessTrue DownloadNewResponseEnvelopeSuccess = true
)

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 *DownloadDeleteResponse, 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, body 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 EmbedGetResponse

type EmbedGetResponse = interface{}

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 *EmbedGetResponse, 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 KeyDeleteParams

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

type KeyDeleteResponse

type KeyDeleteResponse interface {
	ImplementsStreamKeyDeleteResponse()
}

Union satisfied by stream.KeyDeleteResponseUnknown or shared.UnionString.

type KeyDeleteResponseEnvelope

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

func (*KeyDeleteResponseEnvelope) UnmarshalJSON

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

type KeyDeleteResponseEnvelopeErrors

type KeyDeleteResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    keyDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*KeyDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type KeyDeleteResponseEnvelopeMessages

type KeyDeleteResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    keyDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*KeyDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type KeyDeleteResponseEnvelopeSuccess

type KeyDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	KeyDeleteResponseEnvelopeSuccessTrue KeyDeleteResponseEnvelopeSuccess = true
)

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   []KeyGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []KeyGetResponseEnvelopeMessages `json:"messages,required"`
	Result   []KeyGetResponse                 `json:"result,required"`
	// Whether the API call was successful
	Success KeyGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    keyGetResponseEnvelopeJSON    `json:"-"`
}

func (*KeyGetResponseEnvelope) UnmarshalJSON

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

type KeyGetResponseEnvelopeErrors

type KeyGetResponseEnvelopeErrors struct {
	Code    int64                            `json:"code,required"`
	Message string                           `json:"message,required"`
	JSON    keyGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*KeyGetResponseEnvelopeErrors) UnmarshalJSON

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

type KeyGetResponseEnvelopeMessages

type KeyGetResponseEnvelopeMessages struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    keyGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*KeyGetResponseEnvelopeMessages) UnmarshalJSON

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

type KeyGetResponseEnvelopeSuccess

type KeyGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	KeyGetResponseEnvelopeSuccessTrue KeyGetResponseEnvelopeSuccess = true
)

type KeyNewParams

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

type KeyNewResponseEnvelope

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

func (*KeyNewResponseEnvelope) UnmarshalJSON

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

type KeyNewResponseEnvelopeErrors

type KeyNewResponseEnvelopeErrors struct {
	Code    int64                            `json:"code,required"`
	Message string                           `json:"message,required"`
	JSON    keyNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*KeyNewResponseEnvelopeErrors) UnmarshalJSON

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

type KeyNewResponseEnvelopeMessages

type KeyNewResponseEnvelopeMessages struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    keyNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*KeyNewResponseEnvelopeMessages) UnmarshalJSON

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

type KeyNewResponseEnvelopeSuccess

type KeyNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	KeyNewResponseEnvelopeSuccessTrue KeyNewResponseEnvelopeSuccess = true
)

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 *KeyDeleteResponse, 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, body KeyNewParams, opts ...option.RequestOption) (res *StreamKeys, 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 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   []LiveInputGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LiveInputGetResponseEnvelopeMessages `json:"messages,required"`
	// Details about a live input.
	Result StreamLiveInput `json:"result,required"`
	// Whether the API call was successful
	Success LiveInputGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    liveInputGetResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputGetResponseEnvelope) UnmarshalJSON

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

type LiveInputGetResponseEnvelopeErrors

type LiveInputGetResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    liveInputGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputGetResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputGetResponseEnvelopeMessages

type LiveInputGetResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    liveInputGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputGetResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputGetResponseEnvelopeSuccess

type LiveInputGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputGetResponseEnvelopeSuccessTrue LiveInputGetResponseEnvelopeSuccess = true
)

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   []LiveInputListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LiveInputListResponseEnvelopeMessages `json:"messages,required"`
	Result   LiveInputListResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success LiveInputListResponseEnvelopeSuccess `json:"success,required"`
	JSON    liveInputListResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputListResponseEnvelope) UnmarshalJSON

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

type LiveInputListResponseEnvelopeErrors

type LiveInputListResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    liveInputListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputListResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputListResponseEnvelopeMessages

type LiveInputListResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    liveInputListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputListResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputListResponseEnvelopeSuccess

type LiveInputListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputListResponseEnvelopeSuccessTrue LiveInputListResponseEnvelopeSuccess = true
)

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"`
	// 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"
)

type LiveInputNewResponseEnvelope

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

func (*LiveInputNewResponseEnvelope) UnmarshalJSON

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

type LiveInputNewResponseEnvelopeErrors

type LiveInputNewResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    liveInputNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputNewResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputNewResponseEnvelopeMessages

type LiveInputNewResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    liveInputNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputNewResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputNewResponseEnvelopeSuccess

type LiveInputNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputNewResponseEnvelopeSuccessTrue LiveInputNewResponseEnvelopeSuccess = true
)

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 LiveInputOutputListResponseEnvelope

type LiveInputOutputListResponseEnvelope struct {
	Errors   []LiveInputOutputListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LiveInputOutputListResponseEnvelopeMessages `json:"messages,required"`
	Result   []StreamOutput                                `json:"result,required"`
	// Whether the API call was successful
	Success LiveInputOutputListResponseEnvelopeSuccess `json:"success,required"`
	JSON    liveInputOutputListResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputOutputListResponseEnvelope) UnmarshalJSON

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

type LiveInputOutputListResponseEnvelopeErrors

type LiveInputOutputListResponseEnvelopeErrors struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    liveInputOutputListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputOutputListResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputOutputListResponseEnvelopeMessages

type LiveInputOutputListResponseEnvelopeMessages struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    liveInputOutputListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputOutputListResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputOutputListResponseEnvelopeSuccess

type LiveInputOutputListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputOutputListResponseEnvelopeSuccessTrue LiveInputOutputListResponseEnvelopeSuccess = true
)

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   []LiveInputOutputNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LiveInputOutputNewResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamOutput                                 `json:"result,required"`
	// Whether the API call was successful
	Success LiveInputOutputNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    liveInputOutputNewResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputOutputNewResponseEnvelope) UnmarshalJSON

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

type LiveInputOutputNewResponseEnvelopeErrors

type LiveInputOutputNewResponseEnvelopeErrors struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    liveInputOutputNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputOutputNewResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputOutputNewResponseEnvelopeMessages

type LiveInputOutputNewResponseEnvelopeMessages struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    liveInputOutputNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputOutputNewResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputOutputNewResponseEnvelopeSuccess

type LiveInputOutputNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputOutputNewResponseEnvelopeSuccessTrue LiveInputOutputNewResponseEnvelopeSuccess = true
)

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 *[]StreamOutput, err error)

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 *StreamOutput, 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 *StreamOutput, 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   []LiveInputOutputUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LiveInputOutputUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamOutput                                    `json:"result,required"`
	// Whether the API call was successful
	Success LiveInputOutputUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    liveInputOutputUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*LiveInputOutputUpdateResponseEnvelope) UnmarshalJSON

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

type LiveInputOutputUpdateResponseEnvelopeErrors

type LiveInputOutputUpdateResponseEnvelopeErrors struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    liveInputOutputUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputOutputUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputOutputUpdateResponseEnvelopeMessages

type LiveInputOutputUpdateResponseEnvelopeMessages struct {
	Code    int64                                             `json:"code,required"`
	Message string                                            `json:"message,required"`
	JSON    liveInputOutputUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputOutputUpdateResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputOutputUpdateResponseEnvelopeSuccess

type LiveInputOutputUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputOutputUpdateResponseEnvelopeSuccessTrue LiveInputOutputUpdateResponseEnvelopeSuccess = true
)

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 *StreamLiveInput, 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

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 *StreamLiveInput, err error)

Updates a specified live input.

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"`
	// 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"
)

type LiveInputUpdateResponseEnvelope

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

func (*LiveInputUpdateResponseEnvelope) UnmarshalJSON

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

type LiveInputUpdateResponseEnvelopeErrors

type LiveInputUpdateResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    liveInputUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LiveInputUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type LiveInputUpdateResponseEnvelopeMessages

type LiveInputUpdateResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    liveInputUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LiveInputUpdateResponseEnvelopeMessages) UnmarshalJSON

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

type LiveInputUpdateResponseEnvelopeSuccess

type LiveInputUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LiveInputUpdateResponseEnvelopeSuccessTrue LiveInputUpdateResponseEnvelopeSuccess = true
)

type StreamAdditionalAudio

type StreamAdditionalAudio 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 StreamAdditionalAudioStatus `json:"status"`
	// A Cloudflare-generated unique identifier for a media item.
	Uid  string                    `json:"uid"`
	JSON streamAdditionalAudioJSON `json:"-"`
}

func (*StreamAdditionalAudio) UnmarshalJSON

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

type StreamAdditionalAudioStatus

type StreamAdditionalAudioStatus string

Specifies the processing status of the video.

const (
	StreamAdditionalAudioStatusQueued StreamAdditionalAudioStatus = "queued"
	StreamAdditionalAudioStatusReady  StreamAdditionalAudioStatus = "ready"
	StreamAdditionalAudioStatusError  StreamAdditionalAudioStatus = "error"
)

type StreamCaptions

type StreamCaptions struct {
	// 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"`
	JSON     streamCaptionsJSON `json:"-"`
}

func (*StreamCaptions) UnmarshalJSON

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

type StreamClipping

type StreamClipping 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 []string `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 StreamClippingPlayback `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 StreamClippingStatus `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             StreamClippingWatermark `json:"watermark"`
	JSON                  streamClippingJSON      `json:"-"`
}

func (*StreamClipping) UnmarshalJSON

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

type StreamClippingPlayback

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

func (*StreamClippingPlayback) UnmarshalJSON

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

type StreamClippingStatus

type StreamClippingStatus string

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

const (
	StreamClippingStatusPendingupload StreamClippingStatus = "pendingupload"
	StreamClippingStatusDownloading   StreamClippingStatus = "downloading"
	StreamClippingStatusQueued        StreamClippingStatus = "queued"
	StreamClippingStatusInprogress    StreamClippingStatus = "inprogress"
	StreamClippingStatusReady         StreamClippingStatus = "ready"
	StreamClippingStatusError         StreamClippingStatus = "error"
)

type StreamClippingWatermark

type StreamClippingWatermark struct {
	// The unique identifier for the watermark profile.
	Uid  string                      `json:"uid"`
	JSON streamClippingWatermarkJSON `json:"-"`
}

func (*StreamClippingWatermark) UnmarshalJSON

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

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   []StreamGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []StreamGetResponseEnvelopeMessages `json:"messages,required"`
	Result   StreamVideos                        `json:"result,required"`
	// Whether the API call was successful
	Success StreamGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    streamGetResponseEnvelopeJSON    `json:"-"`
}

func (*StreamGetResponseEnvelope) UnmarshalJSON

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

type StreamGetResponseEnvelopeErrors

type StreamGetResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    streamGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*StreamGetResponseEnvelopeErrors) UnmarshalJSON

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

type StreamGetResponseEnvelopeMessages

type StreamGetResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    streamGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*StreamGetResponseEnvelopeMessages) UnmarshalJSON

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

type StreamGetResponseEnvelopeSuccess

type StreamGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	StreamGetResponseEnvelopeSuccessTrue StreamGetResponseEnvelopeSuccess = true
)

type StreamKeys

type StreamKeys 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 streamKeysJSON `json:"-"`
}

func (*StreamKeys) UnmarshalJSON

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

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

type StreamListResponseEnvelope

type StreamListResponseEnvelope struct {
	Errors   []StreamListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []StreamListResponseEnvelopeMessages `json:"messages,required"`
	Result   []StreamVideos                       `json:"result,required"`
	// Whether the API call was successful
	Success StreamListResponseEnvelopeSuccess `json:"success,required"`
	// The total number of remaining videos based on cursor position.
	Range int64 `json:"range"`
	// The total number of videos that match the provided filters.
	Total int64                          `json:"total"`
	JSON  streamListResponseEnvelopeJSON `json:"-"`
}

func (*StreamListResponseEnvelope) UnmarshalJSON

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

type StreamListResponseEnvelopeErrors

type StreamListResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    streamListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*StreamListResponseEnvelopeErrors) UnmarshalJSON

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

type StreamListResponseEnvelopeMessages

type StreamListResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    streamListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*StreamListResponseEnvelopeMessages) UnmarshalJSON

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

type StreamListResponseEnvelopeSuccess

type StreamListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	StreamListResponseEnvelopeSuccessTrue StreamListResponseEnvelopeSuccess = true
)

type StreamLiveInput

type StreamLiveInput 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 StreamLiveInputRecording `json:"recording"`
	// Details for streaming to an live input using RTMPS.
	Rtmps StreamLiveInputRtmps `json:"rtmps"`
	// Details for playback from an live input using RTMPS.
	RtmpsPlayback StreamLiveInputRtmpsPlayback `json:"rtmpsPlayback"`
	// Details for streaming to a live input using SRT.
	Srt StreamLiveInputSrt `json:"srt"`
	// Details for playback from an live input using SRT.
	SrtPlayback StreamLiveInputSrtPlayback `json:"srtPlayback"`
	// The connection status of a live input.
	Status StreamLiveInputStatus `json:"status,nullable"`
	// A unique identifier for a live input.
	Uid string `json:"uid"`
	// Details for streaming to a live input using WebRTC.
	WebRtc StreamLiveInputWebRtc `json:"webRTC"`
	// Details for playback from a live input using WebRTC.
	WebRtcPlayback StreamLiveInputWebRtcPlayback `json:"webRTCPlayback"`
	JSON           streamLiveInputJSON           `json:"-"`
}

Details about a live input.

func (*StreamLiveInput) UnmarshalJSON

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

type StreamLiveInputRecording

type StreamLiveInputRecording 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"`
	// 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 StreamLiveInputRecordingMode `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           streamLiveInputRecordingJSON `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 (*StreamLiveInputRecording) UnmarshalJSON

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

type StreamLiveInputRecordingMode

type StreamLiveInputRecordingMode 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 (
	StreamLiveInputRecordingModeOff       StreamLiveInputRecordingMode = "off"
	StreamLiveInputRecordingModeAutomatic StreamLiveInputRecordingMode = "automatic"
)

type StreamLiveInputRtmps

type StreamLiveInputRtmps 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 streamLiveInputRtmpsJSON `json:"-"`
}

Details for streaming to an live input using RTMPS.

func (*StreamLiveInputRtmps) UnmarshalJSON

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

type StreamLiveInputRtmpsPlayback

type StreamLiveInputRtmpsPlayback 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 streamLiveInputRtmpsPlaybackJSON `json:"-"`
}

Details for playback from an live input using RTMPS.

func (*StreamLiveInputRtmpsPlayback) UnmarshalJSON

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

type StreamLiveInputSrt

type StreamLiveInputSrt 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 streamLiveInputSrtJSON `json:"-"`
}

Details for streaming to a live input using SRT.

func (*StreamLiveInputSrt) UnmarshalJSON

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

type StreamLiveInputSrtPlayback

type StreamLiveInputSrtPlayback 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 streamLiveInputSrtPlaybackJSON `json:"-"`
}

Details for playback from an live input using SRT.

func (*StreamLiveInputSrtPlayback) UnmarshalJSON

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

type StreamLiveInputStatus

type StreamLiveInputStatus string

The connection status of a live input.

const (
	StreamLiveInputStatusConnected                StreamLiveInputStatus = "connected"
	StreamLiveInputStatusReconnected              StreamLiveInputStatus = "reconnected"
	StreamLiveInputStatusReconnecting             StreamLiveInputStatus = "reconnecting"
	StreamLiveInputStatusClientDisconnect         StreamLiveInputStatus = "client_disconnect"
	StreamLiveInputStatusTTLExceeded              StreamLiveInputStatus = "ttl_exceeded"
	StreamLiveInputStatusFailedToConnect          StreamLiveInputStatus = "failed_to_connect"
	StreamLiveInputStatusFailedToReconnect        StreamLiveInputStatus = "failed_to_reconnect"
	StreamLiveInputStatusNewConfigurationAccepted StreamLiveInputStatus = "new_configuration_accepted"
)

type StreamLiveInputWebRtc

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

Details for streaming to a live input using WebRTC.

func (*StreamLiveInputWebRtc) UnmarshalJSON

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

type StreamLiveInputWebRtcPlayback

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

Details for playback from a live input using WebRTC.

func (*StreamLiveInputWebRtcPlayback) UnmarshalJSON

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

type StreamNewParams

type StreamNewParams struct {
	// The account identifier tag.
	AccountID param.Field[string] `path:"account_id,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"`
}

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

type StreamOutput

type StreamOutput 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 streamOutputJSON `json:"-"`
}

func (*StreamOutput) UnmarshalJSON

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

type StreamService

type StreamService struct {
	Options       []option.RequestOption
	AudioTracks   *AudioTrackService
	Videos        *VideoService
	Clips         *ClipService
	Copies        *CopyService
	DirectUploads *DirectUploadService
	Keys          *KeyService
	LiveInputs    *LiveInputService
	Watermarks    *WatermarkService
	Webhooks      *WebhookService
	Captions      *CaptionService
	Downloads     *DownloadService
	Embeds        *EmbedService
	Tokens        *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 *StreamVideos, err error)

Fetches details for a single video.

func (*StreamService) List

func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *[]StreamVideos, err error)

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 StreamVideos

type StreamVideos 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 []string `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    StreamVideosInput `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 StreamVideosPlayback `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 StreamVideosStatus `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    StreamWatermarks `json:"watermark"`
	JSON         streamVideosJSON `json:"-"`
}

func (*StreamVideos) UnmarshalJSON

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

type StreamVideosInput

type StreamVideosInput 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  streamVideosInputJSON `json:"-"`
}

func (*StreamVideosInput) UnmarshalJSON

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

type StreamVideosPlayback

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

func (*StreamVideosPlayback) UnmarshalJSON

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

type StreamVideosStatus

type StreamVideosStatus 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 StreamVideosStatusState `json:"state"`
	JSON  streamVideosStatusJSON  `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 (*StreamVideosStatus) UnmarshalJSON

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

type StreamVideosStatusState

type StreamVideosStatusState string

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

const (
	StreamVideosStatusStatePendingupload StreamVideosStatusState = "pendingupload"
	StreamVideosStatusStateDownloading   StreamVideosStatusState = "downloading"
	StreamVideosStatusStateQueued        StreamVideosStatusState = "queued"
	StreamVideosStatusStateInprogress    StreamVideosStatusState = "inprogress"
	StreamVideosStatusStateReady         StreamVideosStatusState = "ready"
	StreamVideosStatusStateError         StreamVideosStatusState = "error"
)

type StreamWatermarks

type StreamWatermarks 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  streamWatermarksJSON `json:"-"`
}

func (*StreamWatermarks) UnmarshalJSON

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

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

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

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   []TokenNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenNewResponseEnvelopeMessages `json:"messages,required"`
	Result   TokenNewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success TokenNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenNewResponseEnvelopeJSON    `json:"-"`
}

func (*TokenNewResponseEnvelope) UnmarshalJSON

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

type TokenNewResponseEnvelopeErrors

type TokenNewResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    tokenNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenNewResponseEnvelopeErrors) UnmarshalJSON

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

type TokenNewResponseEnvelopeMessages

type TokenNewResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    tokenNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenNewResponseEnvelopeMessages) UnmarshalJSON

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

type TokenNewResponseEnvelopeSuccess

type TokenNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenNewResponseEnvelopeSuccessTrue TokenNewResponseEnvelopeSuccess = true
)

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 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 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   []VideoStorageUsageResponseEnvelopeErrors   `json:"errors,required"`
	Messages []VideoStorageUsageResponseEnvelopeMessages `json:"messages,required"`
	Result   VideoStorageUsageResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success VideoStorageUsageResponseEnvelopeSuccess `json:"success,required"`
	JSON    videoStorageUsageResponseEnvelopeJSON    `json:"-"`
}

func (*VideoStorageUsageResponseEnvelope) UnmarshalJSON

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

type VideoStorageUsageResponseEnvelopeErrors

type VideoStorageUsageResponseEnvelopeErrors struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    videoStorageUsageResponseEnvelopeErrorsJSON `json:"-"`
}

func (*VideoStorageUsageResponseEnvelopeErrors) UnmarshalJSON

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

type VideoStorageUsageResponseEnvelopeMessages

type VideoStorageUsageResponseEnvelopeMessages struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    videoStorageUsageResponseEnvelopeMessagesJSON `json:"-"`
}

func (*VideoStorageUsageResponseEnvelopeMessages) UnmarshalJSON

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

type VideoStorageUsageResponseEnvelopeSuccess

type VideoStorageUsageResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	VideoStorageUsageResponseEnvelopeSuccessTrue VideoStorageUsageResponseEnvelopeSuccess = true
)

type WatermarkDeleteParams

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

type WatermarkDeleteResponse

type WatermarkDeleteResponse interface {
	ImplementsStreamWatermarkDeleteResponse()
}

Union satisfied by stream.WatermarkDeleteResponseUnknown or shared.UnionString.

type WatermarkDeleteResponseEnvelope

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

func (*WatermarkDeleteResponseEnvelope) UnmarshalJSON

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

type WatermarkDeleteResponseEnvelopeErrors

type WatermarkDeleteResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    watermarkDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WatermarkDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type WatermarkDeleteResponseEnvelopeMessages

type WatermarkDeleteResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    watermarkDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WatermarkDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type WatermarkDeleteResponseEnvelopeSuccess

type WatermarkDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkDeleteResponseEnvelopeSuccessTrue WatermarkDeleteResponseEnvelopeSuccess = true
)

type WatermarkGetParams

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

type WatermarkGetResponse

type WatermarkGetResponse interface {
	ImplementsStreamWatermarkGetResponse()
}

Union satisfied by stream.WatermarkGetResponseUnknown or shared.UnionString.

type WatermarkGetResponseEnvelope

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

func (*WatermarkGetResponseEnvelope) UnmarshalJSON

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

type WatermarkGetResponseEnvelopeErrors

type WatermarkGetResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    watermarkGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WatermarkGetResponseEnvelopeErrors) UnmarshalJSON

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

type WatermarkGetResponseEnvelopeMessages

type WatermarkGetResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    watermarkGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WatermarkGetResponseEnvelopeMessages) UnmarshalJSON

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

type WatermarkGetResponseEnvelopeSuccess

type WatermarkGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkGetResponseEnvelopeSuccessTrue WatermarkGetResponseEnvelopeSuccess = true
)

type WatermarkListParams

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

type WatermarkListResponseEnvelope

type WatermarkListResponseEnvelope struct {
	Errors   []WatermarkListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []WatermarkListResponseEnvelopeMessages `json:"messages,required"`
	Result   []StreamWatermarks                      `json:"result,required"`
	// Whether the API call was successful
	Success WatermarkListResponseEnvelopeSuccess `json:"success,required"`
	JSON    watermarkListResponseEnvelopeJSON    `json:"-"`
}

func (*WatermarkListResponseEnvelope) UnmarshalJSON

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

type WatermarkListResponseEnvelopeErrors

type WatermarkListResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    watermarkListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WatermarkListResponseEnvelopeErrors) UnmarshalJSON

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

type WatermarkListResponseEnvelopeMessages

type WatermarkListResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    watermarkListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WatermarkListResponseEnvelopeMessages) UnmarshalJSON

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

type WatermarkListResponseEnvelopeSuccess

type WatermarkListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkListResponseEnvelopeSuccessTrue WatermarkListResponseEnvelopeSuccess = true
)

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

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

type WatermarkNewResponse

type WatermarkNewResponse interface {
	ImplementsStreamWatermarkNewResponse()
}

Union satisfied by stream.WatermarkNewResponseUnknown or shared.UnionString.

type WatermarkNewResponseEnvelope

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

func (*WatermarkNewResponseEnvelope) UnmarshalJSON

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

type WatermarkNewResponseEnvelopeErrors

type WatermarkNewResponseEnvelopeErrors struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    watermarkNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WatermarkNewResponseEnvelopeErrors) UnmarshalJSON

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

type WatermarkNewResponseEnvelopeMessages

type WatermarkNewResponseEnvelopeMessages struct {
	Code    int64                                    `json:"code,required"`
	Message string                                   `json:"message,required"`
	JSON    watermarkNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WatermarkNewResponseEnvelopeMessages) UnmarshalJSON

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

type WatermarkNewResponseEnvelopeSuccess

type WatermarkNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WatermarkNewResponseEnvelopeSuccessTrue WatermarkNewResponseEnvelopeSuccess = true
)

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 *WatermarkDeleteResponse, err error)

Deletes a watermark profile.

func (*WatermarkService) Get

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

Retrieves details for a single watermark profile.

func (*WatermarkService) List

Lists all watermark profiles for an account.

func (*WatermarkService) New

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 WebhookDeleteResponse

type WebhookDeleteResponse interface {
	ImplementsStreamWebhookDeleteResponse()
}

Union satisfied by stream.WebhookDeleteResponseUnknown or shared.UnionString.

type WebhookDeleteResponseEnvelope

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

func (*WebhookDeleteResponseEnvelope) UnmarshalJSON

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

type WebhookDeleteResponseEnvelopeErrors

type WebhookDeleteResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    webhookDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WebhookDeleteResponseEnvelopeErrors) UnmarshalJSON

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

type WebhookDeleteResponseEnvelopeMessages

type WebhookDeleteResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    webhookDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WebhookDeleteResponseEnvelopeMessages) UnmarshalJSON

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

type WebhookDeleteResponseEnvelopeSuccess

type WebhookDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WebhookDeleteResponseEnvelopeSuccessTrue WebhookDeleteResponseEnvelopeSuccess = true
)

type WebhookGetParams

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

type WebhookGetResponse

type WebhookGetResponse interface {
	ImplementsStreamWebhookGetResponse()
}

Union satisfied by stream.WebhookGetResponseUnknown or shared.UnionString.

type WebhookGetResponseEnvelope

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

func (*WebhookGetResponseEnvelope) UnmarshalJSON

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

type WebhookGetResponseEnvelopeErrors

type WebhookGetResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    webhookGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WebhookGetResponseEnvelopeErrors) UnmarshalJSON

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

type WebhookGetResponseEnvelopeMessages

type WebhookGetResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    webhookGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WebhookGetResponseEnvelopeMessages) UnmarshalJSON

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

type WebhookGetResponseEnvelopeSuccess

type WebhookGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WebhookGetResponseEnvelopeSuccessTrue WebhookGetResponseEnvelopeSuccess = true
)

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

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 {
	ImplementsStreamWebhookUpdateResponse()
}

Union satisfied by stream.WebhookUpdateResponseUnknown or shared.UnionString.

type WebhookUpdateResponseEnvelope

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

func (*WebhookUpdateResponseEnvelope) UnmarshalJSON

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

type WebhookUpdateResponseEnvelopeErrors

type WebhookUpdateResponseEnvelopeErrors struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    webhookUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*WebhookUpdateResponseEnvelopeErrors) UnmarshalJSON

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

type WebhookUpdateResponseEnvelopeMessages

type WebhookUpdateResponseEnvelopeMessages struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    webhookUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*WebhookUpdateResponseEnvelopeMessages) UnmarshalJSON

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

type WebhookUpdateResponseEnvelopeSuccess

type WebhookUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	WebhookUpdateResponseEnvelopeSuccessTrue WebhookUpdateResponseEnvelopeSuccess = true
)

Jump to

Keyboard shortcuts

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