// Code generated by glex; DO NOT EDIT. // Lexicon schema: place.stream.media.getUploadStatus package placestream import ( "context" "io" glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type MediaGetUploadStatus_Output struct { LexiconTypeID string `json:"$type,omitempty"` // durationMs: Duration of the processed video in milliseconds. Present when status is 'done'. DurationMs *int64 `json:"durationMs,omitempty"` // error: Error message. Present when status is 'error'. Error *string `json:"error,omitempty"` // progress: Processing progress percentage (0-100). Only meaningful when status is 'processing'. Progress *int64 `json:"progress,omitempty"` // status: Current processing status of the upload. Status string `json:"status"` // tracks: Published track records. Present when status is 'done'. Tracks []MediaGetUploadStatus_TrackRef `json:"tracks,omitempty"` } // RecordTypeID implements glex.Record. func (t *MediaGetUploadStatus_Output) RecordTypeID() string { return "place.stream.media.getUploadStatus" } func (t *MediaGetUploadStatus_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.media.getUploadStatus" return glex.MarshalCBOR(w, &cp) } func (t *MediaGetUploadStatus_Output) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) } // MediaGetUploadStatus calls the XRPC method "place.stream.media.getUploadStatus". // // Get the processing status of a previously created upload. Only accessible by the DID that created the upload. // // uploadId: The upload ID returned by place.stream.media.createUpload. func MediaGetUploadStatus(ctx context.Context, c glex.LexClient, uploadId string) (*MediaGetUploadStatus_Output, error) { var out MediaGetUploadStatus_Output params := map[string]interface{}{} params["uploadId"] = uploadId if err := c.LexDo(ctx, glex.Query, "", "place.stream.media.getUploadStatus", params, nil, &out); err != nil { return nil, err } return &out, nil } // MediaGetUploadStatus_TrackRef is a "trackRef" in the place.stream.media.getUploadStatus schema. type MediaGetUploadStatus_TrackRef struct { LexiconTypeID string `json:"$type,omitempty"` Cid string `json:"cid"` Uri string `json:"uri"` } // RecordTypeID implements glex.Record. func (t *MediaGetUploadStatus_TrackRef) RecordTypeID() string { return "place.stream.media.getUploadStatus#trackRef" } func (t *MediaGetUploadStatus_TrackRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } // stamp $type on a copy so marshal never mutates the record cp := *t cp.LexiconTypeID = "place.stream.media.getUploadStatus#trackRef" return glex.MarshalCBOR(w, &cp) } func (t *MediaGetUploadStatus_TrackRef) UnmarshalCBOR(r io.Reader) error { return glex.UnmarshalCBOR(r, t) }