Documentation ¶
Index ¶
- Constants
- type AllowedOrigins
- type AllowedOriginsParam
- type Audio
- type AudioStatus
- type AudioTrackCopyParams
- type AudioTrackCopyResponseEnvelope
- type AudioTrackCopyResponseEnvelopeSuccess
- type AudioTrackDeleteParams
- type AudioTrackDeleteResponseEnvelope
- type AudioTrackDeleteResponseEnvelopeSuccess
- type AudioTrackDeleteResponseUnion
- type AudioTrackEditParams
- type AudioTrackEditResponseEnvelope
- type AudioTrackEditResponseEnvelopeSuccess
- type AudioTrackGetParams
- type AudioTrackGetResponseEnvelope
- type AudioTrackGetResponseEnvelopeSuccess
- type AudioTrackService
- func (r *AudioTrackService) Copy(ctx context.Context, identifier string, params AudioTrackCopyParams, ...) (res *Audio, err error)
- func (r *AudioTrackService) Delete(ctx context.Context, identifier string, audioIdentifier string, ...) (res *AudioTrackDeleteResponseUnion, err error)
- func (r *AudioTrackService) Edit(ctx context.Context, identifier string, audioIdentifier string, ...) (res *Audio, err error)
- func (r *AudioTrackService) Get(ctx context.Context, identifier string, query AudioTrackGetParams, ...) (res *[]Audio, err error)
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type Caption
- type CaptionDeleteParams
- type CaptionDeleteResponseArray
- type CaptionDeleteResponseEnvelope
- type CaptionDeleteResponseEnvelopeSuccess
- type CaptionDeleteResponseUnion
- type CaptionGetParams
- type CaptionGetResponseEnvelope
- type CaptionGetResponseEnvelopeSuccess
- type CaptionService
- func (r *CaptionService) Delete(ctx context.Context, identifier string, language string, ...) (res *CaptionDeleteResponseUnion, err error)
- func (r *CaptionService) Get(ctx context.Context, identifier string, query CaptionGetParams, ...) (res *[]Caption, err error)
- func (r *CaptionService) Update(ctx context.Context, identifier string, language string, ...) (res *CaptionUpdateResponseUnion, err error)
- type CaptionUpdateParams
- type CaptionUpdateResponseEnvelope
- type CaptionUpdateResponseEnvelopeSuccess
- type CaptionUpdateResponseUnion
- type Clip
- type ClipNewParams
- type ClipNewParamsWatermark
- type ClipNewResponseEnvelope
- type ClipNewResponseEnvelopeSuccess
- type ClipPlayback
- type ClipService
- type ClipStatus
- type ClipWatermark
- type CloudflareTunnel
- type CloudflareTunnelConnection
- type CloudflareTunnelTunType
- type CopyNewParams
- type CopyNewParamsWatermark
- type CopyNewResponseEnvelope
- type CopyNewResponseEnvelopeSuccess
- type CopyService
- type DirectUploadNewParams
- type DirectUploadNewParamsWatermark
- type DirectUploadNewResponse
- type DirectUploadNewResponseEnvelope
- type DirectUploadNewResponseEnvelopeSuccess
- type DirectUploadService
- type DownloadDeleteParams
- type DownloadDeleteResponseEnvelope
- type DownloadDeleteResponseEnvelopeSuccess
- type DownloadDeleteResponseUnion
- type DownloadGetParams
- type DownloadGetResponseEnvelope
- type DownloadGetResponseEnvelopeSuccess
- type DownloadGetResponseUnion
- type DownloadNewParams
- type DownloadNewResponseEnvelope
- type DownloadNewResponseEnvelopeSuccess
- type DownloadNewResponseUnion
- type DownloadService
- func (r *DownloadService) Delete(ctx context.Context, identifier string, body DownloadDeleteParams, ...) (res *DownloadDeleteResponseUnion, err error)
- func (r *DownloadService) Get(ctx context.Context, identifier string, query DownloadGetParams, ...) (res *DownloadGetResponseUnion, err error)
- func (r *DownloadService) New(ctx context.Context, identifier string, params DownloadNewParams, ...) (res *DownloadNewResponseUnion, err error)
- type EmbedGetParams
- type EmbedService
- type Error
- type ErrorData
- type KeyDeleteParams
- type KeyDeleteResponseEnvelope
- type KeyDeleteResponseEnvelopeSuccess
- type KeyDeleteResponseUnion
- type KeyGetParams
- type KeyGetResponse
- type KeyGetResponseEnvelope
- type KeyGetResponseEnvelopeSuccess
- type KeyNewParams
- type KeyNewResponseEnvelope
- type KeyNewResponseEnvelopeSuccess
- type KeyService
- func (r *KeyService) Delete(ctx context.Context, identifier string, params KeyDeleteParams, ...) (res *KeyDeleteResponseUnion, err error)
- func (r *KeyService) Get(ctx context.Context, query KeyGetParams, opts ...option.RequestOption) (res *[]KeyGetResponse, err error)
- func (r *KeyService) New(ctx context.Context, params KeyNewParams, opts ...option.RequestOption) (res *Keys, err error)
- type Keys
- type LiveInput
- type LiveInputDeleteParams
- type LiveInputGetParams
- type LiveInputGetResponseEnvelope
- type LiveInputGetResponseEnvelopeSuccess
- type LiveInputListParams
- type LiveInputListResponse
- type LiveInputListResponseEnvelope
- type LiveInputListResponseEnvelopeSuccess
- type LiveInputListResponseLiveInput
- type LiveInputNewParams
- type LiveInputNewParamsRecording
- type LiveInputNewParamsRecordingMode
- type LiveInputNewResponseEnvelope
- type LiveInputNewResponseEnvelopeSuccess
- type LiveInputOutputDeleteParams
- type LiveInputOutputListParams
- type LiveInputOutputNewParams
- type LiveInputOutputNewResponseEnvelope
- type LiveInputOutputNewResponseEnvelopeSuccess
- type LiveInputOutputService
- func (r *LiveInputOutputService) Delete(ctx context.Context, liveInputIdentifier string, outputIdentifier string, ...) (err error)
- func (r *LiveInputOutputService) List(ctx context.Context, liveInputIdentifier string, ...) (res *pagination.SinglePage[Output], err error)
- func (r *LiveInputOutputService) ListAutoPaging(ctx context.Context, liveInputIdentifier string, ...) *pagination.SinglePageAutoPager[Output]
- func (r *LiveInputOutputService) New(ctx context.Context, liveInputIdentifier string, ...) (res *Output, err error)
- func (r *LiveInputOutputService) Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, ...) (res *Output, err error)
- type LiveInputOutputUpdateParams
- type LiveInputOutputUpdateResponseEnvelope
- type LiveInputOutputUpdateResponseEnvelopeSuccess
- type LiveInputRecording
- type LiveInputRecordingMode
- type LiveInputRtmps
- type LiveInputRtmpsPlayback
- type LiveInputService
- func (r *LiveInputService) Delete(ctx context.Context, liveInputIdentifier string, params LiveInputDeleteParams, ...) (err error)
- func (r *LiveInputService) Get(ctx context.Context, liveInputIdentifier string, query LiveInputGetParams, ...) (res *LiveInput, err error)
- func (r *LiveInputService) List(ctx context.Context, params LiveInputListParams, opts ...option.RequestOption) (res *LiveInputListResponse, err error)
- func (r *LiveInputService) New(ctx context.Context, params LiveInputNewParams, opts ...option.RequestOption) (res *LiveInput, err error)
- func (r *LiveInputService) Update(ctx context.Context, liveInputIdentifier string, params LiveInputUpdateParams, ...) (res *LiveInput, err error)
- type LiveInputSrt
- type LiveInputSrtPlayback
- type LiveInputStatus
- type LiveInputUpdateParams
- type LiveInputUpdateParamsRecording
- type LiveInputUpdateParamsRecordingMode
- type LiveInputUpdateResponseEnvelope
- type LiveInputUpdateResponseEnvelopeSuccess
- type LiveInputWebRtc
- type LiveInputWebRtcPlayback
- type Output
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type ResponseInfo
- type Role
- type StreamDeleteParams
- type StreamGetParams
- type StreamGetResponseEnvelope
- type StreamGetResponseEnvelopeSuccess
- type StreamListParams
- type StreamListParamsStatus
- type StreamNewParams
- type StreamNewParamsTusResumable
- type StreamService
- func (r *StreamService) Delete(ctx context.Context, identifier string, params StreamDeleteParams, ...) (err error)
- func (r *StreamService) Get(ctx context.Context, identifier string, query StreamGetParams, ...) (res *Video, err error)
- func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Video], err error)
- func (r *StreamService) ListAutoPaging(ctx context.Context, params StreamListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Video]
- func (r *StreamService) New(ctx context.Context, params StreamNewParams, opts ...option.RequestOption) (err error)
- type TokenNewParams
- type TokenNewParamsAccessRule
- type TokenNewParamsAccessRulesAction
- type TokenNewParamsAccessRulesType
- type TokenNewResponse
- type TokenNewResponseEnvelope
- type TokenNewResponseEnvelopeSuccess
- type TokenService
- type User
- type UserParam
- type UserRole
- type UserRoleParam
- type UserRolesPermissions
- type UserRolesPermissionsParam
- type UserUser
- type UserUserParam
- type Video
- type VideoInput
- type VideoPlayback
- type VideoService
- type VideoStatus
- type VideoStatusState
- type VideoStorageUsageParams
- type VideoStorageUsageResponse
- type VideoStorageUsageResponseEnvelope
- type VideoStorageUsageResponseEnvelopeSuccess
- type Watermaks
- type WatermarkDeleteParams
- type WatermarkDeleteResponseEnvelope
- type WatermarkDeleteResponseEnvelopeSuccess
- type WatermarkDeleteResponseUnion
- type WatermarkGetParams
- type WatermarkGetResponseEnvelope
- type WatermarkGetResponseEnvelopeSuccess
- type WatermarkGetResponseUnion
- type WatermarkListParams
- type WatermarkNewParams
- type WatermarkNewResponseEnvelope
- type WatermarkNewResponseEnvelopeSuccess
- type WatermarkNewResponseUnion
- type WatermarkService
- func (r *WatermarkService) Delete(ctx context.Context, identifier string, params WatermarkDeleteParams, ...) (res *WatermarkDeleteResponseUnion, err error)
- func (r *WatermarkService) Get(ctx context.Context, identifier string, query WatermarkGetParams, ...) (res *WatermarkGetResponseUnion, err error)
- func (r *WatermarkService) List(ctx context.Context, query WatermarkListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Watermaks], err error)
- func (r *WatermarkService) ListAutoPaging(ctx context.Context, query WatermarkListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Watermaks]
- func (r *WatermarkService) New(ctx context.Context, params WatermarkNewParams, opts ...option.RequestOption) (res *WatermarkNewResponseUnion, err error)
- type WebhookDeleteParams
- type WebhookDeleteResponseEnvelope
- type WebhookDeleteResponseEnvelopeSuccess
- type WebhookDeleteResponseUnion
- type WebhookGetParams
- type WebhookGetResponseEnvelope
- type WebhookGetResponseEnvelopeSuccess
- type WebhookGetResponseUnion
- type WebhookService
- func (r *WebhookService) Delete(ctx context.Context, params WebhookDeleteParams, opts ...option.RequestOption) (res *WebhookDeleteResponseUnion, err error)
- func (r *WebhookService) Get(ctx context.Context, query WebhookGetParams, opts ...option.RequestOption) (res *WebhookGetResponseUnion, err error)
- func (r *WebhookService) Update(ctx context.Context, params WebhookUpdateParams, opts ...option.RequestOption) (res *WebhookUpdateResponseUnion, err error)
- type WebhookUpdateParams
- type WebhookUpdateResponseEnvelope
- type WebhookUpdateResponseEnvelopeSuccess
- type WebhookUpdateResponseUnion
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedOrigins ¶
type AllowedOrigins = string
type AllowedOriginsParam ¶
type AllowedOriginsParam = string
type Audio ¶
type Audio struct { // Denotes whether the audio track will be played by default in a player. Default bool `json:"default"` // A string to uniquely identify the track amongst other audio track labels for the // specified video. Label string `json:"label"` // Specifies the processing status of the video. Status AudioStatus `json:"status"` // A Cloudflare-generated unique identifier for a media item. UID string `json:"uid"` JSON audioJSON `json:"-"` }
func (*Audio) UnmarshalJSON ¶
type AudioStatus ¶
type AudioStatus string
Specifies the processing status of the video.
const ( AudioStatusQueued AudioStatus = "queued" AudioStatusReady AudioStatus = "ready" AudioStatusError AudioStatus = "error" )
func (AudioStatus) IsKnown ¶
func (r AudioStatus) IsKnown() bool
type AudioTrackCopyParams ¶
type AudioTrackCopyParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // A string to uniquely identify the track amongst other audio track labels for the // specified video. Label param.Field[string] `json:"label,required"` // An audio track URL. The server must be publicly routable and support `HTTP HEAD` // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` // requests with a `content-range` header that includes the size of the file. URL param.Field[string] `json:"url" format:"uri"` }
func (AudioTrackCopyParams) MarshalJSON ¶
func (r AudioTrackCopyParams) MarshalJSON() (data []byte, err error)
type AudioTrackCopyResponseEnvelope ¶
type AudioTrackCopyResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Audio `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 AudioTrackCopyResponseEnvelopeSuccess ¶
type AudioTrackCopyResponseEnvelopeSuccess bool
Whether the API call was successful
const (
AudioTrackCopyResponseEnvelopeSuccessTrue AudioTrackCopyResponseEnvelopeSuccess = true
)
func (AudioTrackCopyResponseEnvelopeSuccess) IsKnown ¶
func (r AudioTrackCopyResponseEnvelopeSuccess) IsKnown() bool
type AudioTrackDeleteParams ¶
type AudioTrackDeleteResponseEnvelope ¶
type AudioTrackDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result AudioTrackDeleteResponseUnion `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 AudioTrackDeleteResponseEnvelopeSuccess ¶
type AudioTrackDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
AudioTrackDeleteResponseEnvelopeSuccessTrue AudioTrackDeleteResponseEnvelopeSuccess = true
)
func (AudioTrackDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r AudioTrackDeleteResponseEnvelopeSuccess) IsKnown() bool
type AudioTrackDeleteResponseUnion ¶
type AudioTrackDeleteResponseUnion interface {
ImplementsStreamAudioTrackDeleteResponseUnion()
}
Union satisfied by stream.AudioTrackDeleteResponseUnknown or shared.UnionString.
type AudioTrackEditParams ¶
type AudioTrackEditParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // Denotes whether the audio track will be played by default in a player. Default param.Field[bool] `json:"default"` // A string to uniquely identify the track amongst other audio track labels for the // specified video. Label param.Field[string] `json:"label"` }
func (AudioTrackEditParams) MarshalJSON ¶
func (r AudioTrackEditParams) MarshalJSON() (data []byte, err error)
type AudioTrackEditResponseEnvelope ¶
type AudioTrackEditResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Audio `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 AudioTrackEditResponseEnvelopeSuccess ¶
type AudioTrackEditResponseEnvelopeSuccess bool
Whether the API call was successful
const (
AudioTrackEditResponseEnvelopeSuccessTrue AudioTrackEditResponseEnvelopeSuccess = true
)
func (AudioTrackEditResponseEnvelopeSuccess) IsKnown ¶
func (r AudioTrackEditResponseEnvelopeSuccess) IsKnown() bool
type AudioTrackGetParams ¶
type AudioTrackGetResponseEnvelope ¶
type AudioTrackGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result []Audio `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 AudioTrackGetResponseEnvelopeSuccess ¶
type AudioTrackGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
AudioTrackGetResponseEnvelopeSuccessTrue AudioTrackGetResponseEnvelopeSuccess = true
)
func (AudioTrackGetResponseEnvelopeSuccess) IsKnown ¶
func (r AudioTrackGetResponseEnvelopeSuccess) IsKnown() bool
type AudioTrackService ¶
type AudioTrackService struct {
Options []option.RequestOption
}
AudioTrackService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAudioTrackService method instead.
func NewAudioTrackService ¶
func NewAudioTrackService(opts ...option.RequestOption) (r *AudioTrackService)
NewAudioTrackService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AudioTrackService) Copy ¶
func (r *AudioTrackService) Copy(ctx context.Context, identifier string, params AudioTrackCopyParams, opts ...option.RequestOption) (res *Audio, err error)
Adds an additional audio track to a video using the provided audio track URL.
func (*AudioTrackService) Delete ¶
func (r *AudioTrackService) Delete(ctx context.Context, identifier string, audioIdentifier string, body AudioTrackDeleteParams, opts ...option.RequestOption) (res *AudioTrackDeleteResponseUnion, err error)
Deletes additional audio tracks on a video. Deleting a default audio track is not allowed. You must assign another audio track as default prior to deletion.
func (*AudioTrackService) Edit ¶
func (r *AudioTrackService) Edit(ctx context.Context, identifier string, audioIdentifier string, params AudioTrackEditParams, opts ...option.RequestOption) (res *Audio, err error)
Edits additional audio tracks on a video. Editing the default status of an audio track to `true` will mark all other audio tracks on the video default status to `false`.
func (*AudioTrackService) Get ¶
func (r *AudioTrackService) Get(ctx context.Context, identifier string, query AudioTrackGetParams, opts ...option.RequestOption) (res *[]Audio, err error)
Lists additional audio tracks on a video. Note this API will not return information for audio attached to the video upload.
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type Caption ¶
type Caption struct { // 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 captionJSON `json:"-"` }
func (*Caption) UnmarshalJSON ¶
type CaptionDeleteParams ¶
type CaptionDeleteParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (CaptionDeleteParams) MarshalJSON ¶
func (r CaptionDeleteParams) MarshalJSON() (data []byte, err error)
type CaptionDeleteResponseArray ¶
type CaptionDeleteResponseArray []interface{}
func (CaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponseUnion ¶
func (r CaptionDeleteResponseArray) ImplementsStreamCaptionDeleteResponseUnion()
type CaptionDeleteResponseEnvelope ¶
type CaptionDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result CaptionDeleteResponseUnion `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 CaptionDeleteResponseEnvelopeSuccess ¶
type CaptionDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
CaptionDeleteResponseEnvelopeSuccessTrue CaptionDeleteResponseEnvelopeSuccess = true
)
func (CaptionDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r CaptionDeleteResponseEnvelopeSuccess) IsKnown() bool
type CaptionDeleteResponseUnion ¶
type CaptionDeleteResponseUnion interface {
ImplementsStreamCaptionDeleteResponseUnion()
}
Union satisfied by stream.CaptionDeleteResponseUnknown, stream.CaptionDeleteResponseArray or shared.UnionString.
type CaptionGetParams ¶
type CaptionGetResponseEnvelope ¶
type CaptionGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result []Caption `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 CaptionGetResponseEnvelopeSuccess ¶
type CaptionGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
CaptionGetResponseEnvelopeSuccessTrue CaptionGetResponseEnvelopeSuccess = true
)
func (CaptionGetResponseEnvelopeSuccess) IsKnown ¶
func (r CaptionGetResponseEnvelopeSuccess) IsKnown() bool
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, params CaptionDeleteParams, opts ...option.RequestOption) (res *CaptionDeleteResponseUnion, 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 *[]Caption, 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 *CaptionUpdateResponseUnion, 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 CaptionUpdateResponseEnvelope ¶
type CaptionUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result CaptionUpdateResponseUnion `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 CaptionUpdateResponseEnvelopeSuccess ¶
type CaptionUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
CaptionUpdateResponseEnvelopeSuccessTrue CaptionUpdateResponseEnvelopeSuccess = true
)
func (CaptionUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r CaptionUpdateResponseEnvelopeSuccess) IsKnown() bool
type CaptionUpdateResponseUnion ¶
type CaptionUpdateResponseUnion interface {
ImplementsStreamCaptionUpdateResponseUnion()
}
Union satisfied by stream.CaptionUpdateResponseUnknown or shared.UnionString.
type Clip ¶
type Clip struct { // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. AllowedOrigins []AllowedOrigins `json:"allowedOrigins"` // The unique video identifier (UID). ClippedFromVideoUID string `json:"clippedFromVideoUID"` // The date and time the clip was created. Created time.Time `json:"created" format:"date-time"` // A user-defined identifier for the media creator. Creator string `json:"creator"` // Specifies the end time for the video clip in seconds. EndTimeSeconds int64 `json:"endTimeSeconds"` // The maximum duration in seconds for a video upload. Can be set for a video that // is not yet uploaded to limit its duration. Uploads that exceed the specified // duration will fail during processing. A value of `-1` means the value is // unknown. MaxDurationSeconds int64 `json:"maxDurationSeconds"` // A user modifiable key-value store used to reference other systems of record for // managing videos. Meta interface{} `json:"meta"` // The date and time the live input was last modified. Modified time.Time `json:"modified" format:"date-time"` Playback ClipPlayback `json:"playback"` // The video's preview page URI. This field is omitted until encoding is complete. Preview string `json:"preview" format:"uri"` // Indicates whether the video can be a accessed using the UID. When set to `true`, // a signed token must be generated with a signing key to view the video. RequireSignedURLs bool `json:"requireSignedURLs"` // Specifies the start time for the video clip in seconds. StartTimeSeconds int64 `json:"startTimeSeconds"` // Specifies the processing status for all quality levels for a video. Status ClipStatus `json:"status"` // The timestamp for a thumbnail image calculated as a percentage value of the // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"` Watermark ClipWatermark `json:"watermark"` JSON clipJSON `json:"-"` }
func (*Clip) UnmarshalJSON ¶
type ClipNewParams ¶
type ClipNewParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // The unique video identifier (UID). ClippedFromVideoUID param.Field[string] `json:"clippedFromVideoUID,required"` // Specifies the end time for the video clip in seconds. EndTimeSeconds param.Field[int64] `json:"endTimeSeconds,required"` // Specifies the start time for the video clip in seconds. StartTimeSeconds param.Field[int64] `json:"startTimeSeconds,required"` // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowedOrigins"` // A user-defined identifier for the media creator. Creator param.Field[string] `json:"creator"` // The maximum duration in seconds for a video upload. Can be set for a video that // is not yet uploaded to limit its duration. Uploads that exceed the specified // duration will fail during processing. A value of `-1` means the value is // unknown. MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds"` // Indicates whether the video can be a accessed using the UID. When set to `true`, // a signed token must be generated with a signing key to view the video. RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"` // The timestamp for a thumbnail image calculated as a percentage value of the // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` Watermark param.Field[ClipNewParamsWatermark] `json:"watermark"` }
func (ClipNewParams) MarshalJSON ¶
func (r ClipNewParams) MarshalJSON() (data []byte, err error)
type ClipNewParamsWatermark ¶
type ClipNewParamsWatermark struct { // The unique identifier for the watermark profile. UID param.Field[string] `json:"uid"` }
func (ClipNewParamsWatermark) MarshalJSON ¶
func (r ClipNewParamsWatermark) MarshalJSON() (data []byte, err error)
type ClipNewResponseEnvelope ¶
type ClipNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Clip `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 ClipNewResponseEnvelopeSuccess ¶
type ClipNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ClipNewResponseEnvelopeSuccessTrue ClipNewResponseEnvelopeSuccess = true
)
func (ClipNewResponseEnvelopeSuccess) IsKnown ¶
func (r ClipNewResponseEnvelopeSuccess) IsKnown() bool
type ClipPlayback ¶
type ClipPlayback struct { // DASH Media Presentation Description for the video. Dash string `json:"dash"` // The HLS manifest for the video. Hls string `json:"hls"` JSON clipPlaybackJSON `json:"-"` }
func (*ClipPlayback) UnmarshalJSON ¶
func (r *ClipPlayback) UnmarshalJSON(data []byte) (err error)
type ClipService ¶
type ClipService struct {
Options []option.RequestOption
}
ClipService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClipService method instead.
func NewClipService ¶
func NewClipService(opts ...option.RequestOption) (r *ClipService)
NewClipService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ClipService) New ¶
func (r *ClipService) New(ctx context.Context, params ClipNewParams, opts ...option.RequestOption) (res *Clip, err error)
Clips a video based on the specified start and end times provided in seconds.
type ClipStatus ¶
type ClipStatus string
Specifies the processing status for all quality levels for a video.
const ( ClipStatusPendingupload ClipStatus = "pendingupload" ClipStatusDownloading ClipStatus = "downloading" ClipStatusQueued ClipStatus = "queued" ClipStatusInprogress ClipStatus = "inprogress" ClipStatusReady ClipStatus = "ready" ClipStatusError ClipStatus = "error" )
func (ClipStatus) IsKnown ¶
func (r ClipStatus) IsKnown() bool
type ClipWatermark ¶
type ClipWatermark struct { // The unique identifier for the watermark profile. UID string `json:"uid"` JSON clipWatermarkJSON `json:"-"` }
func (*ClipWatermark) UnmarshalJSON ¶
func (r *ClipWatermark) UnmarshalJSON(data []byte) (err error)
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type CopyNewParams ¶
type CopyNewParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // A video's URL. The server must be publicly routable and support `HTTP HEAD` // requests and `HTTP GET` range requests. The server should respond to `HTTP HEAD` // requests with a `content-range` header that includes the size of the file. URL param.Field[string] `json:"url,required" format:"uri"` // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowedOrigins"` // A user-defined identifier for the media creator. Creator param.Field[string] `json:"creator"` // A user modifiable key-value store used to reference other systems of record for // managing videos. Meta param.Field[interface{}] `json:"meta"` // Indicates whether the video can be a accessed using the UID. When set to `true`, // a signed token must be generated with a signing key to view the video. RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"` // Indicates the date and time at which the video will be deleted. Omit the field // to indicate no change, or include with a `null` value to remove an existing // scheduled deletion. If specified, must be at least 30 days from upload time. ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"` // The timestamp for a thumbnail image calculated as a percentage value of the // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` Watermark param.Field[CopyNewParamsWatermark] `json:"watermark"` // A user-defined identifier for the media creator. UploadCreator param.Field[string] `header:"Upload-Creator"` // Comma-separated key-value pairs following the TUS protocol specification. Values // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`, // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`. UploadMetadata param.Field[string] `header:"Upload-Metadata"` }
func (CopyNewParams) MarshalJSON ¶
func (r CopyNewParams) MarshalJSON() (data []byte, err error)
type CopyNewParamsWatermark ¶
type CopyNewParamsWatermark struct { // The unique identifier for the watermark profile. UID param.Field[string] `json:"uid"` }
func (CopyNewParamsWatermark) MarshalJSON ¶
func (r CopyNewParamsWatermark) MarshalJSON() (data []byte, err error)
type CopyNewResponseEnvelope ¶
type CopyNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Video `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 CopyNewResponseEnvelopeSuccess ¶
type CopyNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
CopyNewResponseEnvelopeSuccessTrue CopyNewResponseEnvelopeSuccess = true
)
func (CopyNewResponseEnvelopeSuccess) IsKnown ¶
func (r CopyNewResponseEnvelopeSuccess) IsKnown() bool
type CopyService ¶
type CopyService struct {
Options []option.RequestOption
}
CopyService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCopyService method instead.
func NewCopyService ¶
func NewCopyService(opts ...option.RequestOption) (r *CopyService)
NewCopyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*CopyService) New ¶
func (r *CopyService) New(ctx context.Context, params CopyNewParams, opts ...option.RequestOption) (res *Video, err error)
Uploads a video to Stream from a provided URL.
type DirectUploadNewParams ¶
type DirectUploadNewParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // The maximum duration in seconds for a video upload. Can be set for a video that // is not yet uploaded to limit its duration. Uploads that exceed the specified // duration will fail during processing. A value of `-1` means the value is // unknown. MaxDurationSeconds param.Field[int64] `json:"maxDurationSeconds,required"` // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. AllowedOrigins param.Field[[]AllowedOriginsParam] `json:"allowedOrigins"` // A user-defined identifier for the media creator. Creator param.Field[string] `json:"creator"` // The date and time after upload when videos will not be accepted. Expiry param.Field[time.Time] `json:"expiry" format:"date-time"` // A user modifiable key-value store used to reference other systems of record for // managing videos. Meta param.Field[interface{}] `json:"meta"` // Indicates whether the video can be a accessed using the UID. When set to `true`, // a signed token must be generated with a signing key to view the video. RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"` // Indicates the date and time at which the video will be deleted. Omit the field // to indicate no change, or include with a `null` value to remove an existing // scheduled deletion. If specified, must be at least 30 days from upload time. ScheduledDeletion param.Field[time.Time] `json:"scheduledDeletion" format:"date-time"` // The timestamp for a thumbnail image calculated as a percentage value of the // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. ThumbnailTimestampPct param.Field[float64] `json:"thumbnailTimestampPct"` Watermark param.Field[DirectUploadNewParamsWatermark] `json:"watermark"` // A user-defined identifier for the media creator. UploadCreator param.Field[string] `header:"Upload-Creator"` }
func (DirectUploadNewParams) MarshalJSON ¶
func (r DirectUploadNewParams) MarshalJSON() (data []byte, err error)
type DirectUploadNewParamsWatermark ¶
type DirectUploadNewParamsWatermark struct { // The unique identifier for the watermark profile. UID param.Field[string] `json:"uid"` }
func (DirectUploadNewParamsWatermark) MarshalJSON ¶
func (r DirectUploadNewParamsWatermark) MarshalJSON() (data []byte, err error)
type DirectUploadNewResponse ¶
type DirectUploadNewResponse struct { // Indicates the date and time at which the video will be deleted. Omit the field // to indicate no change, or include with a `null` value to remove an existing // scheduled deletion. If specified, must be at least 30 days from upload time. ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"` // A Cloudflare-generated unique identifier for a media item. UID string `json:"uid"` // The URL an unauthenticated upload can use for a single // `HTTP POST multipart/form-data` request. UploadURL string `json:"uploadURL"` Watermark Watermaks `json:"watermark"` JSON directUploadNewResponseJSON `json:"-"` }
func (*DirectUploadNewResponse) UnmarshalJSON ¶
func (r *DirectUploadNewResponse) UnmarshalJSON(data []byte) (err error)
type DirectUploadNewResponseEnvelope ¶
type DirectUploadNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` 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 DirectUploadNewResponseEnvelopeSuccess ¶
type DirectUploadNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DirectUploadNewResponseEnvelopeSuccessTrue DirectUploadNewResponseEnvelopeSuccess = true
)
func (DirectUploadNewResponseEnvelopeSuccess) IsKnown ¶
func (r DirectUploadNewResponseEnvelopeSuccess) IsKnown() bool
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 ¶
func (r *DirectUploadService) New(ctx context.Context, params DirectUploadNewParams, opts ...option.RequestOption) (res *DirectUploadNewResponse, err error)
Creates a direct upload that allows video uploads without an API key.
type DownloadDeleteParams ¶
type DownloadDeleteResponseEnvelope ¶
type DownloadDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result DownloadDeleteResponseUnion `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 DownloadDeleteResponseEnvelopeSuccess ¶
type DownloadDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DownloadDeleteResponseEnvelopeSuccessTrue DownloadDeleteResponseEnvelopeSuccess = true
)
func (DownloadDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r DownloadDeleteResponseEnvelopeSuccess) IsKnown() bool
type DownloadDeleteResponseUnion ¶
type DownloadDeleteResponseUnion interface {
ImplementsStreamDownloadDeleteResponseUnion()
}
Union satisfied by stream.DownloadDeleteResponseUnknown or shared.UnionString.
type DownloadGetParams ¶
type DownloadGetResponseEnvelope ¶
type DownloadGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result DownloadGetResponseUnion `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 DownloadGetResponseEnvelopeSuccess ¶
type DownloadGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DownloadGetResponseEnvelopeSuccessTrue DownloadGetResponseEnvelopeSuccess = true
)
func (DownloadGetResponseEnvelopeSuccess) IsKnown ¶
func (r DownloadGetResponseEnvelopeSuccess) IsKnown() bool
type DownloadGetResponseUnion ¶
type DownloadGetResponseUnion interface {
ImplementsStreamDownloadGetResponseUnion()
}
Union satisfied by stream.DownloadGetResponseUnknown or shared.UnionString.
type DownloadNewParams ¶
type DownloadNewParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (DownloadNewParams) MarshalJSON ¶
func (r DownloadNewParams) MarshalJSON() (data []byte, err error)
type DownloadNewResponseEnvelope ¶
type DownloadNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result DownloadNewResponseUnion `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 DownloadNewResponseEnvelopeSuccess ¶
type DownloadNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
DownloadNewResponseEnvelopeSuccessTrue DownloadNewResponseEnvelopeSuccess = true
)
func (DownloadNewResponseEnvelopeSuccess) IsKnown ¶
func (r DownloadNewResponseEnvelopeSuccess) IsKnown() bool
type DownloadNewResponseUnion ¶
type DownloadNewResponseUnion interface {
ImplementsStreamDownloadNewResponseUnion()
}
Union satisfied by stream.DownloadNewResponseUnknown or shared.UnionString.
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 *DownloadDeleteResponseUnion, 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 *DownloadGetResponseUnion, err error)
Lists the downloads created for a video.
func (*DownloadService) New ¶
func (r *DownloadService) New(ctx context.Context, identifier string, params DownloadNewParams, opts ...option.RequestOption) (res *DownloadNewResponseUnion, err error)
Creates a download for a video when a video is ready to view.
type EmbedGetParams ¶
type EmbedService ¶
type EmbedService struct {
Options []option.RequestOption
}
EmbedService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewEmbedService method instead.
func NewEmbedService ¶
func NewEmbedService(opts ...option.RequestOption) (r *EmbedService)
NewEmbedService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*EmbedService) Get ¶
func (r *EmbedService) Get(ctx context.Context, identifier string, query EmbedGetParams, opts ...option.RequestOption) (res *string, err error)
Fetches an HTML code snippet to embed a video in a web page delivered through Cloudflare. On success, returns an HTML fragment for use on web pages to display a video. On failure, returns a JSON response body.
type KeyDeleteParams ¶
type KeyDeleteParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (KeyDeleteParams) MarshalJSON ¶
func (r KeyDeleteParams) MarshalJSON() (data []byte, err error)
type KeyDeleteResponseEnvelope ¶
type KeyDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result KeyDeleteResponseUnion `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 KeyDeleteResponseEnvelopeSuccess ¶
type KeyDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
KeyDeleteResponseEnvelopeSuccessTrue KeyDeleteResponseEnvelopeSuccess = true
)
func (KeyDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r KeyDeleteResponseEnvelopeSuccess) IsKnown() bool
type KeyDeleteResponseUnion ¶
type KeyDeleteResponseUnion interface {
ImplementsStreamKeyDeleteResponseUnion()
}
Union satisfied by stream.KeyDeleteResponseUnknown or shared.UnionString.
type KeyGetParams ¶
type KeyGetResponse ¶
type KeyGetResponse struct { // Identifier ID string `json:"id"` // The date and time a signing key was created. Created time.Time `json:"created" format:"date-time"` JSON keyGetResponseJSON `json:"-"` }
func (*KeyGetResponse) UnmarshalJSON ¶
func (r *KeyGetResponse) UnmarshalJSON(data []byte) (err error)
type KeyGetResponseEnvelope ¶
type KeyGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` 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 KeyGetResponseEnvelopeSuccess ¶
type KeyGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
KeyGetResponseEnvelopeSuccessTrue KeyGetResponseEnvelopeSuccess = true
)
func (KeyGetResponseEnvelopeSuccess) IsKnown ¶
func (r KeyGetResponseEnvelopeSuccess) IsKnown() bool
type KeyNewParams ¶
type KeyNewParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (KeyNewParams) MarshalJSON ¶
func (r KeyNewParams) MarshalJSON() (data []byte, err error)
type KeyNewResponseEnvelope ¶
type KeyNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Keys `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 KeyNewResponseEnvelopeSuccess ¶
type KeyNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
KeyNewResponseEnvelopeSuccessTrue KeyNewResponseEnvelopeSuccess = true
)
func (KeyNewResponseEnvelopeSuccess) IsKnown ¶
func (r KeyNewResponseEnvelopeSuccess) IsKnown() bool
type KeyService ¶
type KeyService struct {
Options []option.RequestOption
}
KeyService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewKeyService method instead.
func NewKeyService ¶
func NewKeyService(opts ...option.RequestOption) (r *KeyService)
NewKeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*KeyService) Delete ¶
func (r *KeyService) Delete(ctx context.Context, identifier string, params KeyDeleteParams, opts ...option.RequestOption) (res *KeyDeleteResponseUnion, err error)
Deletes signing keys and revokes all signed URLs generated with the key.
func (*KeyService) Get ¶
func (r *KeyService) Get(ctx context.Context, query KeyGetParams, opts ...option.RequestOption) (res *[]KeyGetResponse, err error)
Lists the video ID and creation date and time when a signing key was created.
func (*KeyService) New ¶
func (r *KeyService) New(ctx context.Context, params KeyNewParams, opts ...option.RequestOption) (res *Keys, err error)
Creates an RSA private key in PEM and JWK formats. Key files are only displayed once after creation. Keys are created, used, and deleted independently of videos, and every key can sign any video.
type Keys ¶
type Keys struct { // Identifier ID string `json:"id"` // The date and time a signing key was created. Created time.Time `json:"created" format:"date-time"` // The signing key in JWK format. Jwk string `json:"jwk"` // The signing key in PEM format. Pem string `json:"pem"` JSON keysJSON `json:"-"` }
func (*Keys) UnmarshalJSON ¶
type LiveInput ¶
type LiveInput struct { // The date and time the live input was created. Created time.Time `json:"created" format:"date-time"` // Indicates the number of days after which the live inputs recordings will be // deleted. When a stream completes and the recording is ready, the value is used // to calculate a scheduled deletion date for that recording. Omit the field to // indicate no change, or include with a `null` value to remove an existing // scheduled deletion. DeleteRecordingAfterDays float64 `json:"deleteRecordingAfterDays"` // A user modifiable key-value store used to reference other systems of record for // managing live inputs. Meta interface{} `json:"meta"` // The date and time the live input was last modified. Modified time.Time `json:"modified" format:"date-time"` // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. Recording LiveInputRecording `json:"recording"` // Details for streaming to an live input using RTMPS. Rtmps LiveInputRtmps `json:"rtmps"` // Details for playback from an live input using RTMPS. RtmpsPlayback LiveInputRtmpsPlayback `json:"rtmpsPlayback"` // Details for streaming to a live input using SRT. Srt LiveInputSrt `json:"srt"` // Details for playback from an live input using SRT. SrtPlayback LiveInputSrtPlayback `json:"srtPlayback"` // The connection status of a live input. Status LiveInputStatus `json:"status,nullable"` // A unique identifier for a live input. UID string `json:"uid"` // Details for streaming to a live input using WebRTC. WebRtc LiveInputWebRtc `json:"webRTC"` // Details for playback from a live input using WebRTC. WebRtcPlayback LiveInputWebRtcPlayback `json:"webRTCPlayback"` JSON liveInputJSON `json:"-"` }
Details about a live input.
func (*LiveInput) UnmarshalJSON ¶
type LiveInputDeleteParams ¶
type LiveInputDeleteParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (LiveInputDeleteParams) MarshalJSON ¶
func (r LiveInputDeleteParams) MarshalJSON() (data []byte, err error)
type LiveInputGetParams ¶
type LiveInputGetResponseEnvelope ¶
type LiveInputGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Details about a live input. Result LiveInput `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 LiveInputGetResponseEnvelopeSuccess ¶
type LiveInputGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LiveInputGetResponseEnvelopeSuccessTrue LiveInputGetResponseEnvelopeSuccess = true
)
func (LiveInputGetResponseEnvelopeSuccess) IsKnown ¶
func (r LiveInputGetResponseEnvelopeSuccess) IsKnown() bool
type LiveInputListParams ¶
type LiveInputListParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // Includes the total number of videos associated with the submitted query // parameters. IncludeCounts param.Field[bool] `query:"include_counts"` }
func (LiveInputListParams) URLQuery ¶
func (r LiveInputListParams) URLQuery() (v url.Values)
URLQuery serializes LiveInputListParams's query parameters as `url.Values`.
type LiveInputListResponse ¶
type LiveInputListResponse struct { LiveInputs []LiveInputListResponseLiveInput `json:"liveInputs"` // The total number of remaining live inputs based on cursor position. Range int64 `json:"range"` // The total number of live inputs that match the provided filters. Total int64 `json:"total"` JSON liveInputListResponseJSON `json:"-"` }
func (*LiveInputListResponse) UnmarshalJSON ¶
func (r *LiveInputListResponse) UnmarshalJSON(data []byte) (err error)
type LiveInputListResponseEnvelope ¶
type LiveInputListResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` 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 LiveInputListResponseEnvelopeSuccess ¶
type LiveInputListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LiveInputListResponseEnvelopeSuccessTrue LiveInputListResponseEnvelopeSuccess = true
)
func (LiveInputListResponseEnvelopeSuccess) IsKnown ¶
func (r LiveInputListResponseEnvelopeSuccess) IsKnown() bool
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" )
func (LiveInputNewParamsRecordingMode) IsKnown ¶
func (r LiveInputNewParamsRecordingMode) IsKnown() bool
type LiveInputNewResponseEnvelope ¶
type LiveInputNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Details about a live input. Result LiveInput `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 LiveInputNewResponseEnvelopeSuccess ¶
type LiveInputNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LiveInputNewResponseEnvelopeSuccessTrue LiveInputNewResponseEnvelopeSuccess = true
)
func (LiveInputNewResponseEnvelopeSuccess) IsKnown ¶
func (r LiveInputNewResponseEnvelopeSuccess) IsKnown() bool
type LiveInputOutputDeleteParams ¶
type LiveInputOutputDeleteParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (LiveInputOutputDeleteParams) MarshalJSON ¶
func (r LiveInputOutputDeleteParams) MarshalJSON() (data []byte, err error)
type LiveInputOutputNewParams ¶
type LiveInputOutputNewParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // The streamKey used to authenticate against an output's target. StreamKey param.Field[string] `json:"streamKey,required"` // The URL an output uses to restream. URL param.Field[string] `json:"url,required"` // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely // when you start and stop simulcasting to specific destinations like YouTube and // Twitch. Enabled param.Field[bool] `json:"enabled"` }
func (LiveInputOutputNewParams) MarshalJSON ¶
func (r LiveInputOutputNewParams) MarshalJSON() (data []byte, err error)
type LiveInputOutputNewResponseEnvelope ¶
type LiveInputOutputNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Output `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 LiveInputOutputNewResponseEnvelopeSuccess ¶
type LiveInputOutputNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LiveInputOutputNewResponseEnvelopeSuccessTrue LiveInputOutputNewResponseEnvelopeSuccess = true
)
func (LiveInputOutputNewResponseEnvelopeSuccess) IsKnown ¶
func (r LiveInputOutputNewResponseEnvelopeSuccess) IsKnown() bool
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, params LiveInputOutputDeleteParams, opts ...option.RequestOption) (err error)
Deletes an output and removes it from the associated live input.
func (*LiveInputOutputService) List ¶
func (r *LiveInputOutputService) List(ctx context.Context, liveInputIdentifier string, query LiveInputOutputListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Output], err error)
Retrieves all outputs associated with a specified live input.
func (*LiveInputOutputService) ListAutoPaging ¶
func (r *LiveInputOutputService) ListAutoPaging(ctx context.Context, liveInputIdentifier string, query LiveInputOutputListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Output]
Retrieves all outputs associated with a specified live input.
func (*LiveInputOutputService) New ¶
func (r *LiveInputOutputService) New(ctx context.Context, liveInputIdentifier string, params LiveInputOutputNewParams, opts ...option.RequestOption) (res *Output, err error)
Creates a new output that can be used to simulcast or restream live video to other RTMP or SRT destinations. Outputs are always linked to a specific live input — one live input can have many outputs.
func (*LiveInputOutputService) Update ¶
func (r *LiveInputOutputService) Update(ctx context.Context, liveInputIdentifier string, outputIdentifier string, params LiveInputOutputUpdateParams, opts ...option.RequestOption) (res *Output, err error)
Updates the state of an output.
type LiveInputOutputUpdateParams ¶
type LiveInputOutputUpdateParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely // when you start and stop simulcasting to specific destinations like YouTube and // Twitch. Enabled param.Field[bool] `json:"enabled,required"` }
func (LiveInputOutputUpdateParams) MarshalJSON ¶
func (r LiveInputOutputUpdateParams) MarshalJSON() (data []byte, err error)
type LiveInputOutputUpdateResponseEnvelope ¶
type LiveInputOutputUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Output `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 LiveInputOutputUpdateResponseEnvelopeSuccess ¶
type LiveInputOutputUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LiveInputOutputUpdateResponseEnvelopeSuccessTrue LiveInputOutputUpdateResponseEnvelopeSuccess = true
)
func (LiveInputOutputUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r LiveInputOutputUpdateResponseEnvelopeSuccess) IsKnown() bool
type LiveInputRecording ¶
type LiveInputRecording struct { // Lists the origins allowed to display videos created with this input. Enter // allowed origin domains in an array and use `*` for wildcard subdomains. An empty // array allows videos to be viewed on any origin. AllowedOrigins []string `json:"allowedOrigins"` // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. Mode LiveInputRecordingMode `json:"mode"` // Indicates if a video using the live input has the `requireSignedURLs` property // set. Also enforces access controls on any video recording of the livestream with // the live input. RequireSignedURLs bool `json:"requireSignedURLs"` // Determines the amount of time a live input configured in `automatic` mode should // wait before a recording transitions from live to on-demand. `0` is recommended // for most use cases and indicates the platform default should be used. TimeoutSeconds int64 `json:"timeoutSeconds"` JSON liveInputRecordingJSON `json:"-"` }
Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.
func (*LiveInputRecording) UnmarshalJSON ¶
func (r *LiveInputRecording) UnmarshalJSON(data []byte) (err error)
type LiveInputRecordingMode ¶
type LiveInputRecordingMode string
Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.
const ( LiveInputRecordingModeOff LiveInputRecordingMode = "off" LiveInputRecordingModeAutomatic LiveInputRecordingMode = "automatic" )
func (LiveInputRecordingMode) IsKnown ¶
func (r LiveInputRecordingMode) IsKnown() bool
type LiveInputRtmps ¶
type LiveInputRtmps struct { // The secret key to use when streaming via RTMPS to a live input. StreamKey string `json:"streamKey"` // The RTMPS URL you provide to the broadcaster, which they stream live video to. URL string `json:"url"` JSON liveInputRtmpsJSON `json:"-"` }
Details for streaming to an live input using RTMPS.
func (*LiveInputRtmps) UnmarshalJSON ¶
func (r *LiveInputRtmps) UnmarshalJSON(data []byte) (err error)
type LiveInputRtmpsPlayback ¶
type LiveInputRtmpsPlayback struct { // The secret key to use for playback via RTMPS. StreamKey string `json:"streamKey"` // The URL used to play live video over RTMPS. URL string `json:"url"` JSON liveInputRtmpsPlaybackJSON `json:"-"` }
Details for playback from an live input using RTMPS.
func (*LiveInputRtmpsPlayback) UnmarshalJSON ¶
func (r *LiveInputRtmpsPlayback) UnmarshalJSON(data []byte) (err error)
type LiveInputService ¶
type LiveInputService struct { Options []option.RequestOption Outputs *LiveInputOutputService }
LiveInputService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLiveInputService method instead.
func NewLiveInputService ¶
func NewLiveInputService(opts ...option.RequestOption) (r *LiveInputService)
NewLiveInputService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*LiveInputService) Delete ¶
func (r *LiveInputService) Delete(ctx context.Context, liveInputIdentifier string, params LiveInputDeleteParams, opts ...option.RequestOption) (err error)
Prevents a live input from being streamed to and makes the live input inaccessible to any future API calls.
func (*LiveInputService) Get ¶
func (r *LiveInputService) Get(ctx context.Context, liveInputIdentifier string, query LiveInputGetParams, opts ...option.RequestOption) (res *LiveInput, err error)
Retrieves details of an existing live input.
func (*LiveInputService) List ¶
func (r *LiveInputService) List(ctx context.Context, params LiveInputListParams, opts ...option.RequestOption) (res *LiveInputListResponse, err error)
Lists the live inputs created for an account. To get the credentials needed to stream to a specific live input, request a single live input.
func (*LiveInputService) New ¶
func (r *LiveInputService) New(ctx context.Context, params LiveInputNewParams, opts ...option.RequestOption) (res *LiveInput, err error)
Creates a live input, and returns credentials that you or your users can use to stream live video to Cloudflare Stream.
func (*LiveInputService) Update ¶
func (r *LiveInputService) Update(ctx context.Context, liveInputIdentifier string, params LiveInputUpdateParams, opts ...option.RequestOption) (res *LiveInput, err error)
Updates a specified live input.
type LiveInputSrt ¶
type LiveInputSrt struct { // The secret key to use when streaming via SRT to a live input. Passphrase string `json:"passphrase"` // The identifier of the live input to use when streaming via SRT. StreamID string `json:"streamId"` // The SRT URL you provide to the broadcaster, which they stream live video to. URL string `json:"url"` JSON liveInputSrtJSON `json:"-"` }
Details for streaming to a live input using SRT.
func (*LiveInputSrt) UnmarshalJSON ¶
func (r *LiveInputSrt) UnmarshalJSON(data []byte) (err error)
type LiveInputSrtPlayback ¶
type LiveInputSrtPlayback struct { // The secret key to use for playback via SRT. Passphrase string `json:"passphrase"` // The identifier of the live input to use for playback via SRT. StreamID string `json:"streamId"` // The URL used to play live video over SRT. URL string `json:"url"` JSON liveInputSrtPlaybackJSON `json:"-"` }
Details for playback from an live input using SRT.
func (*LiveInputSrtPlayback) UnmarshalJSON ¶
func (r *LiveInputSrtPlayback) UnmarshalJSON(data []byte) (err error)
type LiveInputStatus ¶
type LiveInputStatus string
The connection status of a live input.
const ( LiveInputStatusConnected LiveInputStatus = "connected" LiveInputStatusReconnected LiveInputStatus = "reconnected" LiveInputStatusReconnecting LiveInputStatus = "reconnecting" LiveInputStatusClientDisconnect LiveInputStatus = "client_disconnect" LiveInputStatusTTLExceeded LiveInputStatus = "ttl_exceeded" LiveInputStatusFailedToConnect LiveInputStatus = "failed_to_connect" LiveInputStatusFailedToReconnect LiveInputStatus = "failed_to_reconnect" LiveInputStatusNewConfigurationAccepted LiveInputStatus = "new_configuration_accepted" )
func (LiveInputStatus) IsKnown ¶
func (r LiveInputStatus) IsKnown() bool
type LiveInputUpdateParams ¶
type LiveInputUpdateParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // Sets the creator ID asssociated with this live input. DefaultCreator param.Field[string] `json:"defaultCreator"` // Indicates the number of days after which the live inputs recordings will be // deleted. When a stream completes and the recording is ready, the value is used // to calculate a scheduled deletion date for that recording. Omit the field to // indicate no change, or include with a `null` value to remove an existing // scheduled deletion. DeleteRecordingAfterDays param.Field[float64] `json:"deleteRecordingAfterDays"` // A user modifiable key-value store used to reference other systems of record for // managing live inputs. Meta param.Field[interface{}] `json:"meta"` // Records the input to a Cloudflare Stream video. Behavior depends on the mode. In // most cases, the video will initially be viewable as a live video and transition // to on-demand after a condition is satisfied. Recording param.Field[LiveInputUpdateParamsRecording] `json:"recording"` }
func (LiveInputUpdateParams) MarshalJSON ¶
func (r LiveInputUpdateParams) MarshalJSON() (data []byte, err error)
type LiveInputUpdateParamsRecording ¶
type LiveInputUpdateParamsRecording struct { // Lists the origins allowed to display videos created with this input. Enter // allowed origin domains in an array and use `*` for wildcard subdomains. An empty // array allows videos to be viewed on any origin. AllowedOrigins param.Field[[]string] `json:"allowedOrigins"` // Specifies the recording behavior for the live input. Set this value to `off` to // prevent a recording. Set the value to `automatic` to begin a recording and // transition to on-demand after Stream Live stops receiving input. Mode param.Field[LiveInputUpdateParamsRecordingMode] `json:"mode"` // Indicates if a video using the live input has the `requireSignedURLs` property // set. Also enforces access controls on any video recording of the livestream with // the live input. RequireSignedURLs param.Field[bool] `json:"requireSignedURLs"` // Determines the amount of time a live input configured in `automatic` mode should // wait before a recording transitions from live to on-demand. `0` is recommended // for most use cases and indicates the platform default should be used. TimeoutSeconds param.Field[int64] `json:"timeoutSeconds"` }
Records the input to a Cloudflare Stream video. Behavior depends on the mode. In most cases, the video will initially be viewable as a live video and transition to on-demand after a condition is satisfied.
func (LiveInputUpdateParamsRecording) MarshalJSON ¶
func (r LiveInputUpdateParamsRecording) MarshalJSON() (data []byte, err error)
type LiveInputUpdateParamsRecordingMode ¶
type LiveInputUpdateParamsRecordingMode string
Specifies the recording behavior for the live input. Set this value to `off` to prevent a recording. Set the value to `automatic` to begin a recording and transition to on-demand after Stream Live stops receiving input.
const ( LiveInputUpdateParamsRecordingModeOff LiveInputUpdateParamsRecordingMode = "off" LiveInputUpdateParamsRecordingModeAutomatic LiveInputUpdateParamsRecordingMode = "automatic" )
func (LiveInputUpdateParamsRecordingMode) IsKnown ¶
func (r LiveInputUpdateParamsRecordingMode) IsKnown() bool
type LiveInputUpdateResponseEnvelope ¶
type LiveInputUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` // Details about a live input. Result LiveInput `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 LiveInputUpdateResponseEnvelopeSuccess ¶
type LiveInputUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
LiveInputUpdateResponseEnvelopeSuccessTrue LiveInputUpdateResponseEnvelopeSuccess = true
)
func (LiveInputUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r LiveInputUpdateResponseEnvelopeSuccess) IsKnown() bool
type LiveInputWebRtc ¶
type LiveInputWebRtc struct { // The WebRTC URL you provide to the broadcaster, which they stream live video to. URL string `json:"url"` JSON liveInputWebRtcJSON `json:"-"` }
Details for streaming to a live input using WebRTC.
func (*LiveInputWebRtc) UnmarshalJSON ¶
func (r *LiveInputWebRtc) UnmarshalJSON(data []byte) (err error)
type LiveInputWebRtcPlayback ¶
type LiveInputWebRtcPlayback struct { // The URL used to play live video over WebRTC. URL string `json:"url"` JSON liveInputWebRtcPlaybackJSON `json:"-"` }
Details for playback from a live input using WebRTC.
func (*LiveInputWebRtcPlayback) UnmarshalJSON ¶
func (r *LiveInputWebRtcPlayback) UnmarshalJSON(data []byte) (err error)
type Output ¶
type Output struct { // When enabled, live video streamed to the associated live input will be sent to // the output URL. When disabled, live video will not be sent to the output URL, // even when streaming to the associated live input. Use this to control precisely // when you start and stop simulcasting to specific destinations like YouTube and // Twitch. Enabled bool `json:"enabled"` // The streamKey used to authenticate against an output's target. StreamKey string `json:"streamKey"` // A unique identifier for the output. UID string `json:"uid"` // The URL an output uses to restream. URL string `json:"url"` JSON outputJSON `json:"-"` }
func (*Output) UnmarshalJSON ¶
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type StreamDeleteParams ¶
type StreamDeleteParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (StreamDeleteParams) MarshalJSON ¶
func (r StreamDeleteParams) MarshalJSON() (data []byte, err error)
type StreamGetParams ¶
type StreamGetResponseEnvelope ¶
type StreamGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result Video `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 StreamGetResponseEnvelopeSuccess ¶
type StreamGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
StreamGetResponseEnvelopeSuccessTrue StreamGetResponseEnvelopeSuccess = true
)
func (StreamGetResponseEnvelopeSuccess) IsKnown ¶
func (r StreamGetResponseEnvelopeSuccess) IsKnown() bool
type StreamListParams ¶
type StreamListParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // Lists videos in ascending order of creation. Asc param.Field[bool] `query:"asc"` // A user-defined identifier for the media creator. Creator param.Field[string] `query:"creator"` // Lists videos created before the specified date. End param.Field[time.Time] `query:"end" format:"date-time"` // Includes the total number of videos associated with the submitted query // parameters. IncludeCounts param.Field[bool] `query:"include_counts"` // Searches over the `name` key in the `meta` field. This field can be set with or // after the upload request. Search param.Field[string] `query:"search"` // Lists videos created after the specified date. Start param.Field[time.Time] `query:"start" format:"date-time"` // Specifies the processing status for all quality levels for a video. Status param.Field[StreamListParamsStatus] `query:"status"` // Specifies whether the video is `vod` or `live`. Type param.Field[string] `query:"type"` }
func (StreamListParams) URLQuery ¶
func (r StreamListParams) URLQuery() (v url.Values)
URLQuery serializes StreamListParams's query parameters as `url.Values`.
type StreamListParamsStatus ¶
type StreamListParamsStatus string
Specifies the processing status for all quality levels for a video.
const ( StreamListParamsStatusPendingupload StreamListParamsStatus = "pendingupload" StreamListParamsStatusDownloading StreamListParamsStatus = "downloading" StreamListParamsStatusQueued StreamListParamsStatus = "queued" StreamListParamsStatusInprogress StreamListParamsStatus = "inprogress" StreamListParamsStatusReady StreamListParamsStatus = "ready" StreamListParamsStatusError StreamListParamsStatus = "error" )
func (StreamListParamsStatus) IsKnown ¶
func (r StreamListParamsStatus) IsKnown() bool
type StreamNewParams ¶
type StreamNewParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` // Specifies the TUS protocol version. This value must be included in every upload // request. Notes: The only supported version of TUS protocol is 1.0.0. TusResumable param.Field[StreamNewParamsTusResumable] `header:"Tus-Resumable,required"` // Indicates the size of the entire upload in bytes. The value must be a // non-negative integer. UploadLength param.Field[int64] `header:"Upload-Length,required"` // A user-defined identifier for the media creator. UploadCreator param.Field[string] `header:"Upload-Creator"` // Comma-separated key-value pairs following the TUS protocol specification. Values // are Base-64 encoded. Supported keys: `name`, `requiresignedurls`, // `allowedorigins`, `thumbnailtimestamppct`, `watermark`, `scheduleddeletion`. UploadMetadata param.Field[string] `header:"Upload-Metadata"` }
func (StreamNewParams) MarshalJSON ¶
func (r StreamNewParams) MarshalJSON() (data []byte, err error)
type StreamNewParamsTusResumable ¶
type StreamNewParamsTusResumable string
Specifies the TUS protocol version. This value must be included in every upload request. Notes: The only supported version of TUS protocol is 1.0.0.
const (
StreamNewParamsTusResumable1_0_0 StreamNewParamsTusResumable = "1.0.0"
)
func (StreamNewParamsTusResumable) IsKnown ¶
func (r StreamNewParamsTusResumable) IsKnown() bool
type StreamService ¶
type StreamService struct { Options []option.RequestOption AudioTracks *AudioTrackService Videos *VideoService Clip *ClipService Copy *CopyService DirectUpload *DirectUploadService Keys *KeyService LiveInputs *LiveInputService Watermarks *WatermarkService Webhooks *WebhookService Captions *CaptionService Downloads *DownloadService Embed *EmbedService Token *TokenService }
StreamService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStreamService method instead.
func NewStreamService ¶
func NewStreamService(opts ...option.RequestOption) (r *StreamService)
NewStreamService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*StreamService) Delete ¶
func (r *StreamService) Delete(ctx context.Context, identifier string, params StreamDeleteParams, opts ...option.RequestOption) (err error)
Deletes a video and its copies from Cloudflare Stream.
func (*StreamService) Get ¶
func (r *StreamService) Get(ctx context.Context, identifier string, query StreamGetParams, opts ...option.RequestOption) (res *Video, err error)
Fetches details for a single video.
func (*StreamService) List ¶
func (r *StreamService) List(ctx context.Context, params StreamListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Video], err error)
Lists up to 1000 videos from a single request. For a specific range, refer to the optional parameters.
func (*StreamService) ListAutoPaging ¶
func (r *StreamService) ListAutoPaging(ctx context.Context, params StreamListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Video]
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 TokenNewParams ¶
type TokenNewParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // The optional ID of a Stream signing key. If present, the `pem` field is also // required. ID param.Field[string] `json:"id"` // The optional list of access rule constraints on the token. Access can be blocked // or allowed based on an IP, IP range, or by country. Access rules are evaluated // from first to last. If a rule matches, the associated action is applied and no // further rules are evaluated. AccessRules param.Field[[]TokenNewParamsAccessRule] `json:"accessRules"` // The optional boolean value that enables using signed tokens to access MP4 // download links for a video. Downloadable param.Field[bool] `json:"downloadable"` // The optional unix epoch timestamp that specficies the time after a token is not // accepted. The maximum time specification is 24 hours from issuing time. If this // field is not set, the default is one hour after issuing. Exp param.Field[int64] `json:"exp"` // The optional unix epoch timestamp that specifies the time before a the token is // not accepted. If this field is not set, the default is one hour before issuing. Nbf param.Field[int64] `json:"nbf"` // The optional base64 encoded private key in PEM format associated with a Stream // signing key. If present, the `id` field is also required. Pem param.Field[string] `json:"pem"` }
func (TokenNewParams) MarshalJSON ¶
func (r TokenNewParams) MarshalJSON() (data []byte, err error)
type TokenNewParamsAccessRule ¶
type TokenNewParamsAccessRule struct { // The action to take when a request matches a rule. If the action is `block`, the // signed token blocks views for viewers matching the rule. Action param.Field[TokenNewParamsAccessRulesAction] `json:"action"` // An array of 2-letter country codes in ISO 3166-1 Alpha-2 format used to match // requests. Country param.Field[[]string] `json:"country"` // An array of IPv4 or IPV6 addresses or CIDRs used to match requests. IP param.Field[[]string] `json:"ip"` // Lists available rule types to match for requests. An `any` type matches all // requests and can be used as a wildcard to apply default actions after other // rules. Type param.Field[TokenNewParamsAccessRulesType] `json:"type"` }
Defines rules for fine-grained control over content than signed URL tokens alone. Access rules primarily make tokens conditionally valid based on user information. Access Rules are specified on token payloads as the `accessRules` property containing an array of Rule objects.
func (TokenNewParamsAccessRule) MarshalJSON ¶
func (r TokenNewParamsAccessRule) MarshalJSON() (data []byte, err error)
type TokenNewParamsAccessRulesAction ¶
type TokenNewParamsAccessRulesAction string
The action to take when a request matches a rule. If the action is `block`, the signed token blocks views for viewers matching the rule.
const ( TokenNewParamsAccessRulesActionAllow TokenNewParamsAccessRulesAction = "allow" TokenNewParamsAccessRulesActionBlock TokenNewParamsAccessRulesAction = "block" )
func (TokenNewParamsAccessRulesAction) IsKnown ¶
func (r TokenNewParamsAccessRulesAction) IsKnown() bool
type TokenNewParamsAccessRulesType ¶
type TokenNewParamsAccessRulesType string
Lists available rule types to match for requests. An `any` type matches all requests and can be used as a wildcard to apply default actions after other rules.
const ( TokenNewParamsAccessRulesTypeAny TokenNewParamsAccessRulesType = "any" TokenNewParamsAccessRulesTypeIPSrc TokenNewParamsAccessRulesType = "ip.src" TokenNewParamsAccessRulesTypeIPGeoipCountry TokenNewParamsAccessRulesType = "ip.geoip.country" )
func (TokenNewParamsAccessRulesType) IsKnown ¶
func (r TokenNewParamsAccessRulesType) IsKnown() bool
type TokenNewResponse ¶
type TokenNewResponse struct { // The signed token used with the signed URLs feature. Token string `json:"token"` JSON tokenNewResponseJSON `json:"-"` }
func (*TokenNewResponse) UnmarshalJSON ¶
func (r *TokenNewResponse) UnmarshalJSON(data []byte) (err error)
type TokenNewResponseEnvelope ¶
type TokenNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` 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 TokenNewResponseEnvelopeSuccess ¶
type TokenNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
TokenNewResponseEnvelopeSuccessTrue TokenNewResponseEnvelopeSuccess = true
)
func (TokenNewResponseEnvelopeSuccess) IsKnown ¶
func (r TokenNewResponseEnvelopeSuccess) IsKnown() bool
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 UserRoleParam ¶
type UserRoleParam = shared.UserRoleParam
This is an alias to an internal type.
type UserRolesPermissions ¶
type UserRolesPermissions = shared.UserRolesPermissions
This is an alias to an internal type.
type UserRolesPermissionsParam ¶
type UserRolesPermissionsParam = shared.UserRolesPermissionsParam
This is an alias to an internal type.
type UserUserParam ¶
type UserUserParam = shared.UserUserParam
This is an alias to an internal type.
type Video ¶
type Video struct { // Lists the origins allowed to display the video. Enter allowed origin domains in // an array and use `*` for wildcard subdomains. Empty arrays allow the video to be // viewed on any origin. AllowedOrigins []AllowedOrigins `json:"allowedOrigins"` // The date and time the media item was created. Created time.Time `json:"created" format:"date-time"` // A user-defined identifier for the media creator. Creator string `json:"creator"` // The duration of the video in seconds. A value of `-1` means the duration is // unknown. The duration becomes available after the upload and before the video is // ready. Duration float64 `json:"duration"` Input VideoInput `json:"input"` // The live input ID used to upload a video with Stream Live. LiveInput string `json:"liveInput"` // The maximum duration in seconds for a video upload. Can be set for a video that // is not yet uploaded to limit its duration. Uploads that exceed the specified // duration will fail during processing. A value of `-1` means the value is // unknown. MaxDurationSeconds int64 `json:"maxDurationSeconds"` // A user modifiable key-value store used to reference other systems of record for // managing videos. Meta interface{} `json:"meta"` // The date and time the media item was last modified. Modified time.Time `json:"modified" format:"date-time"` Playback VideoPlayback `json:"playback"` // The video's preview page URI. This field is omitted until encoding is complete. Preview string `json:"preview" format:"uri"` // Indicates whether the video is playable. The field is empty if the video is not // ready for viewing or the live stream is still in progress. ReadyToStream bool `json:"readyToStream"` // Indicates the time at which the video became playable. The field is empty if the // video is not ready for viewing or the live stream is still in progress. ReadyToStreamAt time.Time `json:"readyToStreamAt" format:"date-time"` // Indicates whether the video can be a accessed using the UID. When set to `true`, // a signed token must be generated with a signing key to view the video. RequireSignedURLs bool `json:"requireSignedURLs"` // Indicates the date and time at which the video will be deleted. Omit the field // to indicate no change, or include with a `null` value to remove an existing // scheduled deletion. If specified, must be at least 30 days from upload time. ScheduledDeletion time.Time `json:"scheduledDeletion" format:"date-time"` // The size of the media item in bytes. Size float64 `json:"size"` // Specifies a detailed status for a video. If the `state` is `inprogress` or // `error`, the `step` field returns `encoding` or `manifest`. If the `state` is // `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the // approximate percent of completion. If the `state` is `error`, `errorReasonCode` // and `errorReasonText` provide additional details. Status VideoStatus `json:"status"` // The media item's thumbnail URI. This field is omitted until encoding is // complete. Thumbnail string `json:"thumbnail" format:"uri"` // The timestamp for a thumbnail image calculated as a percentage value of the // video's duration. To convert from a second-wise timestamp to a percentage, // divide the desired timestamp by the total duration of the video. If this value // is not set, the default thumbnail image is taken from 0s of the video. ThumbnailTimestampPct float64 `json:"thumbnailTimestampPct"` // A Cloudflare-generated unique identifier for a media item. UID string `json:"uid"` // The date and time the media item was uploaded. Uploaded time.Time `json:"uploaded" format:"date-time"` // The date and time when the video upload URL is no longer valid for direct user // uploads. UploadExpiry time.Time `json:"uploadExpiry" format:"date-time"` Watermark Watermaks `json:"watermark"` JSON videoJSON `json:"-"` }
func (*Video) UnmarshalJSON ¶
type VideoInput ¶
type VideoInput struct { // The video height in pixels. A value of `-1` means the height is unknown. The // value becomes available after the upload and before the video is ready. Height int64 `json:"height"` // The video width in pixels. A value of `-1` means the width is unknown. The value // becomes available after the upload and before the video is ready. Width int64 `json:"width"` JSON videoInputJSON `json:"-"` }
func (*VideoInput) UnmarshalJSON ¶
func (r *VideoInput) UnmarshalJSON(data []byte) (err error)
type VideoPlayback ¶
type VideoPlayback struct { // DASH Media Presentation Description for the video. Dash string `json:"dash"` // The HLS manifest for the video. Hls string `json:"hls"` JSON videoPlaybackJSON `json:"-"` }
func (*VideoPlayback) UnmarshalJSON ¶
func (r *VideoPlayback) UnmarshalJSON(data []byte) (err error)
type VideoService ¶
type VideoService struct {
Options []option.RequestOption
}
VideoService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVideoService method instead.
func NewVideoService ¶
func NewVideoService(opts ...option.RequestOption) (r *VideoService)
NewVideoService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VideoService) StorageUsage ¶
func (r *VideoService) StorageUsage(ctx context.Context, params VideoStorageUsageParams, opts ...option.RequestOption) (res *VideoStorageUsageResponse, err error)
Returns information about an account's storage use.
type VideoStatus ¶
type VideoStatus struct { // Specifies why the video failed to encode. This field is empty if the video is // not in an `error` state. Preferred for programmatic use. ErrorReasonCode string `json:"errorReasonCode"` // Specifies why the video failed to encode using a human readable error message in // English. This field is empty if the video is not in an `error` state. ErrorReasonText string `json:"errorReasonText"` // Indicates the size of the entire upload in bytes. The value must be a // non-negative integer. PctComplete string `json:"pctComplete"` // Specifies the processing status for all quality levels for a video. State VideoStatusState `json:"state"` JSON videoStatusJSON `json:"-"` }
Specifies a detailed status for a video. If the `state` is `inprogress` or `error`, the `step` field returns `encoding` or `manifest`. If the `state` is `inprogress`, `pctComplete` returns a number between 0 and 100 to indicate the approximate percent of completion. If the `state` is `error`, `errorReasonCode` and `errorReasonText` provide additional details.
func (*VideoStatus) UnmarshalJSON ¶
func (r *VideoStatus) UnmarshalJSON(data []byte) (err error)
type VideoStatusState ¶
type VideoStatusState string
Specifies the processing status for all quality levels for a video.
const ( VideoStatusStatePendingupload VideoStatusState = "pendingupload" VideoStatusStateDownloading VideoStatusState = "downloading" VideoStatusStateQueued VideoStatusState = "queued" VideoStatusStateInprogress VideoStatusState = "inprogress" VideoStatusStateReady VideoStatusState = "ready" VideoStatusStateError VideoStatusState = "error" )
func (VideoStatusState) IsKnown ¶
func (r VideoStatusState) IsKnown() bool
type VideoStorageUsageParams ¶
type VideoStorageUsageParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` // A user-defined identifier for the media creator. Creator param.Field[string] `query:"creator"` }
func (VideoStorageUsageParams) URLQuery ¶
func (r VideoStorageUsageParams) URLQuery() (v url.Values)
URLQuery serializes VideoStorageUsageParams's query parameters as `url.Values`.
type VideoStorageUsageResponse ¶
type VideoStorageUsageResponse struct { // A user-defined identifier for the media creator. Creator string `json:"creator"` // The total minutes of video content stored in the account. TotalStorageMinutes int64 `json:"totalStorageMinutes"` // The storage capacity alloted for the account. TotalStorageMinutesLimit int64 `json:"totalStorageMinutesLimit"` // The total count of videos associated with the account. VideoCount int64 `json:"videoCount"` JSON videoStorageUsageResponseJSON `json:"-"` }
func (*VideoStorageUsageResponse) UnmarshalJSON ¶
func (r *VideoStorageUsageResponse) UnmarshalJSON(data []byte) (err error)
type VideoStorageUsageResponseEnvelope ¶
type VideoStorageUsageResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` 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 VideoStorageUsageResponseEnvelopeSuccess ¶
type VideoStorageUsageResponseEnvelopeSuccess bool
Whether the API call was successful
const (
VideoStorageUsageResponseEnvelopeSuccessTrue VideoStorageUsageResponseEnvelopeSuccess = true
)
func (VideoStorageUsageResponseEnvelopeSuccess) IsKnown ¶
func (r VideoStorageUsageResponseEnvelopeSuccess) IsKnown() bool
type Watermaks ¶
type Watermaks 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 watermaksJSON `json:"-"` }
func (*Watermaks) UnmarshalJSON ¶
type WatermarkDeleteParams ¶
type WatermarkDeleteParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (WatermarkDeleteParams) MarshalJSON ¶
func (r WatermarkDeleteParams) MarshalJSON() (data []byte, err error)
type WatermarkDeleteResponseEnvelope ¶
type WatermarkDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result WatermarkDeleteResponseUnion `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 WatermarkDeleteResponseEnvelopeSuccess ¶
type WatermarkDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WatermarkDeleteResponseEnvelopeSuccessTrue WatermarkDeleteResponseEnvelopeSuccess = true
)
func (WatermarkDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r WatermarkDeleteResponseEnvelopeSuccess) IsKnown() bool
type WatermarkDeleteResponseUnion ¶
type WatermarkDeleteResponseUnion interface {
ImplementsStreamWatermarkDeleteResponseUnion()
}
Union satisfied by stream.WatermarkDeleteResponseUnknown or shared.UnionString.
type WatermarkGetParams ¶
type WatermarkGetResponseEnvelope ¶
type WatermarkGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result WatermarkGetResponseUnion `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 WatermarkGetResponseEnvelopeSuccess ¶
type WatermarkGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WatermarkGetResponseEnvelopeSuccessTrue WatermarkGetResponseEnvelopeSuccess = true
)
func (WatermarkGetResponseEnvelopeSuccess) IsKnown ¶
func (r WatermarkGetResponseEnvelopeSuccess) IsKnown() bool
type WatermarkGetResponseUnion ¶
type WatermarkGetResponseUnion interface {
ImplementsStreamWatermarkGetResponseUnion()
}
Union satisfied by stream.WatermarkGetResponseUnknown or shared.UnionString.
type WatermarkListParams ¶
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 WatermarkNewResponseEnvelope ¶
type WatermarkNewResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result WatermarkNewResponseUnion `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 WatermarkNewResponseEnvelopeSuccess ¶
type WatermarkNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WatermarkNewResponseEnvelopeSuccessTrue WatermarkNewResponseEnvelopeSuccess = true
)
func (WatermarkNewResponseEnvelopeSuccess) IsKnown ¶
func (r WatermarkNewResponseEnvelopeSuccess) IsKnown() bool
type WatermarkNewResponseUnion ¶
type WatermarkNewResponseUnion interface {
ImplementsStreamWatermarkNewResponseUnion()
}
Union satisfied by stream.WatermarkNewResponseUnknown or shared.UnionString.
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, params WatermarkDeleteParams, opts ...option.RequestOption) (res *WatermarkDeleteResponseUnion, err error)
Deletes a watermark profile.
func (*WatermarkService) Get ¶
func (r *WatermarkService) Get(ctx context.Context, identifier string, query WatermarkGetParams, opts ...option.RequestOption) (res *WatermarkGetResponseUnion, err error)
Retrieves details for a single watermark profile.
func (*WatermarkService) List ¶
func (r *WatermarkService) List(ctx context.Context, query WatermarkListParams, opts ...option.RequestOption) (res *pagination.SinglePage[Watermaks], err error)
Lists all watermark profiles for an account.
func (*WatermarkService) ListAutoPaging ¶
func (r *WatermarkService) ListAutoPaging(ctx context.Context, query WatermarkListParams, opts ...option.RequestOption) *pagination.SinglePageAutoPager[Watermaks]
Lists all watermark profiles for an account.
func (*WatermarkService) New ¶
func (r *WatermarkService) New(ctx context.Context, params WatermarkNewParams, opts ...option.RequestOption) (res *WatermarkNewResponseUnion, err error)
Creates watermark profiles using a single `HTTP POST multipart/form-data` request.
type WebhookDeleteParams ¶
type WebhookDeleteParams struct { // The account identifier tag. AccountID param.Field[string] `path:"account_id,required"` Body interface{} `json:"body,required"` }
func (WebhookDeleteParams) MarshalJSON ¶
func (r WebhookDeleteParams) MarshalJSON() (data []byte, err error)
type WebhookDeleteResponseEnvelope ¶
type WebhookDeleteResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result WebhookDeleteResponseUnion `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 WebhookDeleteResponseEnvelopeSuccess ¶
type WebhookDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WebhookDeleteResponseEnvelopeSuccessTrue WebhookDeleteResponseEnvelopeSuccess = true
)
func (WebhookDeleteResponseEnvelopeSuccess) IsKnown ¶
func (r WebhookDeleteResponseEnvelopeSuccess) IsKnown() bool
type WebhookDeleteResponseUnion ¶
type WebhookDeleteResponseUnion interface {
ImplementsStreamWebhookDeleteResponseUnion()
}
Union satisfied by stream.WebhookDeleteResponseUnknown or shared.UnionString.
type WebhookGetParams ¶
type WebhookGetResponseEnvelope ¶
type WebhookGetResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result WebhookGetResponseUnion `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 WebhookGetResponseEnvelopeSuccess ¶
type WebhookGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WebhookGetResponseEnvelopeSuccessTrue WebhookGetResponseEnvelopeSuccess = true
)
func (WebhookGetResponseEnvelopeSuccess) IsKnown ¶
func (r WebhookGetResponseEnvelopeSuccess) IsKnown() bool
type WebhookGetResponseUnion ¶
type WebhookGetResponseUnion interface {
ImplementsStreamWebhookGetResponseUnion()
}
Union satisfied by stream.WebhookGetResponseUnknown or shared.UnionString.
type WebhookService ¶
type WebhookService struct {
Options []option.RequestOption
}
WebhookService contains methods and other services that help with interacting with the cloudflare API. Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookService method instead.
func NewWebhookService ¶
func NewWebhookService(opts ...option.RequestOption) (r *WebhookService)
NewWebhookService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WebhookService) Delete ¶
func (r *WebhookService) Delete(ctx context.Context, params WebhookDeleteParams, opts ...option.RequestOption) (res *WebhookDeleteResponseUnion, err error)
Deletes a webhook.
func (*WebhookService) Get ¶
func (r *WebhookService) Get(ctx context.Context, query WebhookGetParams, opts ...option.RequestOption) (res *WebhookGetResponseUnion, err error)
Retrieves a list of webhooks.
func (*WebhookService) Update ¶
func (r *WebhookService) Update(ctx context.Context, params WebhookUpdateParams, opts ...option.RequestOption) (res *WebhookUpdateResponseUnion, err error)
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 WebhookUpdateResponseEnvelope ¶
type WebhookUpdateResponseEnvelope struct { Errors []shared.ResponseInfo `json:"errors,required"` Messages []shared.ResponseInfo `json:"messages,required"` Result WebhookUpdateResponseUnion `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 WebhookUpdateResponseEnvelopeSuccess ¶
type WebhookUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
WebhookUpdateResponseEnvelopeSuccessTrue WebhookUpdateResponseEnvelopeSuccess = true
)
func (WebhookUpdateResponseEnvelopeSuccess) IsKnown ¶
func (r WebhookUpdateResponseEnvelopeSuccess) IsKnown() bool
type WebhookUpdateResponseUnion ¶
type WebhookUpdateResponseUnion interface {
ImplementsStreamWebhookUpdateResponseUnion()
}
Union satisfied by stream.WebhookUpdateResponseUnknown or shared.UnionString.