From d840488f92c2ca9e6d91cc15c4a9358ba383be15 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 1 Jul 2024 00:29:54 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.322.3 --- .speakeasy/gen.lock | 555 ++++----- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- README.md | 374 +----- RELEASES.md | 12 +- USAGE.md | 69 +- accesscontrol.go | 32 +- asset.go | 304 ++--- codeSamples.yaml | 1031 +++++++++-------- docs/models/components/asset.md | 41 +- docs/models/components/assetipfs.md | 2 +- docs/models/components/assetpatchpayload.md | 2 +- docs/models/components/assetspec.md | 4 +- docs/models/components/assetstatus.md | 13 - docs/models/components/attestation.md | 6 +- docs/models/components/attestations.md | 4 +- docs/models/components/clip.md | 6 +- docs/models/components/clippayload.md | 6 +- docs/models/components/clipstrategy.md | 4 +- docs/models/components/custom.md | 4 +- docs/models/components/dvrplayback.md | 6 +- docs/models/components/encoder.md | 5 +- docs/models/components/ffmpegprofile.md | 12 +- .../models/components/ffmpegprofileencoder.md | 8 + .../models/components/ffmpegprofileprofile.md | 11 + docs/models/components/getroomuserresponse.md | 6 +- docs/models/components/hash.md | 4 +- docs/models/components/hrn.md | 13 +- docs/models/components/input2.md | 6 +- docs/models/components/ipfs.md | 4 +- docs/models/components/ipfsfileinfo.md | 4 +- docs/models/components/ismobile.md | 4 +- docs/models/components/lastfailure.md | 4 +- docs/models/components/message.md | 4 +- docs/models/components/meta.md | 6 +- docs/models/components/multistreamtarget.md | 6 +- .../components/multistreamtargetinput.md | 4 +- .../multistreamtargetpatchpayload.md | 4 +- .../components/newassetfromurlpayload.md | 14 +- docs/models/components/newassetpayload.md | 10 +- docs/models/components/newassetpayloadipfs.md | 4 +- .../models/components/newassetpayloadipfs1.md | 8 - docs/models/components/newstreampayload.md | 8 +- .../newstreampayloadrecordingspec.md | 8 + docs/models/components/one.md | 12 +- docs/models/components/output.md | 4 +- docs/models/components/outputs.md | 4 +- docs/models/components/params.md | 4 +- docs/models/components/participants.md | 4 +- docs/models/components/playbackinfo.md | 4 +- docs/models/components/playbackinfohrn.md | 13 +- docs/models/components/playbackinfosource.md | 10 +- docs/models/components/playbackpolicy.md | 6 +- docs/models/components/pull.md | 4 +- docs/models/components/recordingspec.md | 6 +- docs/models/components/request.md | 6 +- docs/models/components/room.md | 6 +- docs/models/components/roomuserpayload.md | 4 +- docs/models/components/session.md | 54 +- docs/models/components/signingkey.md | 10 +- docs/models/components/source1.md | 6 +- docs/models/components/source3.md | 8 +- docs/models/components/spec.md | 4 +- docs/models/components/status.md | 12 +- docs/models/components/storage1.md | 6 +- docs/models/components/storage2.md | 4 +- docs/models/components/storagestatus.md | 2 +- docs/models/components/stream.md | 70 +- docs/models/components/streamismobile.md | 4 +- docs/models/components/streamismobile1.md | 12 + docs/models/components/streampatchpayload.md | 5 +- docs/models/components/streampull.md | 4 +- docs/models/components/streamrecordingspec.md | 6 +- docs/models/components/target.md | 6 +- docs/models/components/targetaddpayload.md | 6 +- docs/models/components/targetoutput.md | 4 +- docs/models/components/task.md | 10 +- docs/models/components/taskexportdata.md | 4 +- docs/models/components/taskipfs.md | 8 +- docs/models/components/tasks.md | 4 +- docs/models/components/taskstatus.md | 6 +- docs/models/components/taskupload.md | 13 +- docs/models/components/tracks.md | 14 +- docs/models/components/transcodefile.md | 8 +- docs/models/components/transcodepayload.md | 8 +- docs/models/components/transcodeprofile.md | 12 +- .../components/transcodeprofileencoder.md | 11 - .../components/transcodeprofileprofile.md | 11 - docs/models/components/two.md | 4 +- docs/models/components/upload.md | 13 +- docs/models/components/usagemetric.md | 4 +- docs/models/components/videospec.md | 4 +- docs/models/components/viewershipmetric.md | 28 +- docs/models/components/webhook.md | 12 +- docs/models/components/webhookinput.md | 6 +- docs/models/components/webhooklog.md | 10 +- docs/models/components/webhookstatus.md | 11 + docs/models/operations/breakdownby.md | 19 +- ...rviewershipmetricsqueryparambreakdownby.md | 18 + ...atorviewershipmetricsqueryparamtimestep.md | 14 + .../getcreatorviewershipmetricsrequest.md | 18 +- .../getpublicviewershipmetricsdata.md | 6 +- .../getusagemetricsqueryparambreakdownby.md | 8 - .../getusagemetricsqueryparamtimestep.md | 12 - .../operations/getusagemetricsrequest.md | 14 +- .../operations/getviewershipmetricsrequest.md | 4 +- .../operations/queryparambreakdownby.md | 5 +- docs/models/operations/requestuploaddata.md | 6 +- docs/models/operations/timestep.md | 12 +- docs/models/sdkerrors/error.md | 2 + docs/sdks/accesscontrol/README.md | 26 +- docs/sdks/asset/README.md | 344 +++--- docs/sdks/metrics/README.md | 86 +- docs/sdks/multistream/README.md | 62 +- docs/sdks/room/README.md | 138 +-- docs/sdks/session/README.md | 38 +- docs/sdks/stream/README.md | 467 ++++---- docs/sdks/transcode/README.md | 38 +- docs/sdks/webhook/README.md | 76 +- internal/utils/contenttype.go | 4 + livepeer.go | 48 +- metrics.go | 78 +- models/components/asset.go | 578 ++++----- models/components/assetpatchpayload.go | 12 +- models/components/attestation.go | 116 +- models/components/clippayload.go | 36 +- models/components/exporttaskparams.go | 20 +- models/components/ffmpegprofile.go | 118 +- models/components/getroomuserresponse.go | 24 +- models/components/ipfsfileinfo.go | 12 +- models/components/multistreamtarget.go | 36 +- models/components/multistreamtargetinput.go | 22 +- .../multistreamtargetpatchpayload.go | 22 +- models/components/newassetfromurlpayload.go | 72 +- models/components/newassetpayload.go | 110 +- models/components/newstreampayload.go | 60 +- models/components/playbackinfo.go | 286 ++--- models/components/playbackpolicy.go | 38 +- models/components/pull.go | 64 +- models/components/recordingspec.go | 10 +- models/components/room.go | 50 +- models/components/roomuserpayload.go | 18 +- models/components/session.go | 164 +-- models/components/signingkey.go | 54 +- models/components/spec.go | 30 +- models/components/storage.go | 28 +- models/components/storagestatus.go | 40 +- models/components/stream.go | 580 +++++----- models/components/streampatchpayload.go | 42 +- models/components/target.go | 32 +- models/components/targetaddpayload.go | 32 +- models/components/targetoutput.go | 18 +- models/components/task.go | 734 ++++++------ models/components/transcodepayload.go | 374 +++--- models/components/transcodeprofile.go | 116 +- models/components/usagemetric.go | 24 +- models/components/viewershipmetric.go | 162 +-- models/components/webhook.go | 124 +- models/components/webhooklog.go | 78 +- .../operations/getcreatorviewershipmetrics.go | 62 +- .../operations/getpublicviewershipmetrics.go | 24 +- models/operations/getusagemetrics.go | 36 +- models/operations/getviewershipmetrics.go | 68 +- models/operations/requestupload.go | 32 +- models/sdkerrors/error.go | 1 + multistream.go | 84 +- room.go | 182 +-- session.go | 50 +- stream.go | 298 ++--- webhook.go | 54 +- 170 files changed, 4853 insertions(+), 5072 deletions(-) delete mode 100644 docs/models/components/assetstatus.md create mode 100644 docs/models/components/ffmpegprofileencoder.md create mode 100644 docs/models/components/ffmpegprofileprofile.md delete mode 100644 docs/models/components/newassetpayloadipfs1.md create mode 100644 docs/models/components/newstreampayloadrecordingspec.md create mode 100644 docs/models/components/streamismobile1.md delete mode 100644 docs/models/components/transcodeprofileencoder.md delete mode 100644 docs/models/components/transcodeprofileprofile.md create mode 100644 docs/models/components/webhookstatus.md create mode 100644 docs/models/operations/getcreatorviewershipmetricsqueryparambreakdownby.md create mode 100644 docs/models/operations/getcreatorviewershipmetricsqueryparamtimestep.md delete mode 100644 docs/models/operations/getusagemetricsqueryparambreakdownby.md delete mode 100644 docs/models/operations/getusagemetricsqueryparamtimestep.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 20c73ec..2aeade8 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 17bba98d-ccbf-4675-8dd5-54aa47cbeeb4 management: - docChecksum: a20a2b61185fa86d7fba41119e953873 + docChecksum: 6c59d7f1dd85a77d4179f4842fe6f332 docVersion: 1.0.0 - speakeasyVersion: 1.305.0 - generationVersion: 2.340.3 - releaseVersion: 0.1.11 - configChecksum: bd53ce4810c9a4c3b87d432a94820c11 + speakeasyVersion: 1.322.3 + generationVersion: 2.354.2 + releaseVersion: 0.1.12 + configChecksum: 2a12c51e224949245969932308d35510 repoURL: https://github.com/livepeer/livepeer-go.git installationURL: https://github.com/livepeer/livepeer-go features: @@ -14,7 +14,7 @@ features: additionalDependencies: 0.1.0 additionalProperties: 0.1.2 constsAndDefaults: 0.1.4 - core: 3.4.11 + core: 3.4.14 deprecations: 2.81.1 flattening: 2.81.1 globalSecurity: 2.82.9 @@ -29,17 +29,17 @@ features: sdkHooks: 0.1.0 unions: 2.85.8 generatedFiles: + - accesscontrol.go + - asset.go - stream.go + - metrics.go - multistream.go - - webhook.go - - asset.go - - session.go + - playback.go - room.go - - metrics.go - - accesscontrol.go + - session.go - task.go - transcode.go - - playback.go + - webhook.go - livepeer.go - go.mod - models/sdkerrors/sdkerror.go @@ -58,96 +58,98 @@ generatedFiles: - internal/utils/retries.go - internal/utils/security.go - internal/utils/utils.go - - /models/operations/createstream.go + - /models/operations/getsigningkeys.go + - /models/operations/createsigningkey.go + - /models/operations/deletesigningkey.go + - /models/operations/getsigningkey.go + - /models/operations/updatesigningkey.go + - /models/operations/getassets.go + - /models/operations/deleteasset.go + - /models/operations/getasset.go + - /models/operations/updateasset.go + - /models/operations/requestupload.go + - /models/operations/uploadasset.go + - /models/operations/createclip.go - /models/operations/getstreams.go + - /models/operations/createstream.go + - /models/operations/deletestream.go - /models/operations/getstream.go - /models/operations/updatestream.go - - /models/operations/deletestream.go - - /models/operations/terminatestream.go - - /models/operations/startpullstream.go - - /models/operations/createclip.go - /models/operations/getclips.go - /models/operations/addmultistreamtarget.go - /models/operations/removemultistreamtarget.go + - /models/operations/startpullstream.go + - /models/operations/terminatestream.go + - /models/operations/getusagemetrics.go + - /models/operations/getviewershipmetrics.go + - /models/operations/getcreatorviewershipmetrics.go + - /models/operations/getpublicviewershipmetrics.go - /models/operations/getmultistreamtargets.go - /models/operations/createmultistreamtarget.go + - /models/operations/deletemultistreamtarget.go - /models/operations/getmultistreamtarget.go - /models/operations/updatemultistreamtarget.go - - /models/operations/deletemultistreamtarget.go - - /models/operations/getwebhooks.go - - /models/operations/createwebhook.go - - /models/operations/getwebhook.go - - /models/operations/updatewebhook.go - - /models/operations/deletewebhook.go - - /models/operations/getwebhooklogs.go - - /models/operations/getwebhooklog.go - - /models/operations/resendwebhook.go - - /models/operations/getassets.go - - /models/operations/requestupload.go - - /models/operations/uploadasset.go - - /models/operations/getasset.go - - /models/operations/updateasset.go - - /models/operations/deleteasset.go - - /models/operations/getsessionclips.go - - /models/operations/getsessions.go - - /models/operations/getsession.go - - /models/operations/getrecordedsessions.go + - /models/operations/getplaybackinfo.go - /models/operations/createroom.go - - /models/operations/getroom.go - /models/operations/deleteroom.go - - /models/operations/startroomegress.go + - /models/operations/getroom.go - /models/operations/stoproomegress.go + - /models/operations/startroomegress.go - /models/operations/createroomuser.go + - /models/operations/deleteroomuser.go - /models/operations/getroomuser.go - /models/operations/updateroomuser.go - - /models/operations/deleteroomuser.go - - /models/operations/getviewershipmetrics.go - - /models/operations/getcreatorviewershipmetrics.go - - /models/operations/getpublicviewershipmetrics.go - - /models/operations/getusagemetrics.go - - /models/operations/createsigningkey.go - - /models/operations/getsigningkeys.go - - /models/operations/deletesigningkey.go - - /models/operations/getsigningkey.go - - /models/operations/updatesigningkey.go + - /models/operations/getsessions.go + - /models/operations/getsession.go + - /models/operations/getsessionclips.go + - /models/operations/getrecordedsessions.go - /models/operations/gettasks.go - /models/operations/gettask.go - /models/operations/transcodevideo.go - - /models/operations/getplaybackinfo.go + - /models/operations/getwebhooks.go + - /models/operations/createwebhook.go + - /models/operations/deletewebhook.go + - /models/operations/getwebhook.go + - /models/operations/updatewebhook.go + - /models/operations/getwebhooklogs.go + - /models/operations/getwebhooklog.go + - /models/operations/resendwebhook.go - /models/sdkerrors/error.go - - /models/components/stream.go - - /models/components/targetoutput.go - - /models/components/ffmpegprofile.go + - /models/components/signingkey.go + - /models/components/httpmetadata.go + - /models/components/asset.go + - /models/components/storagestatus.go + - /models/components/ipfsfileinfo.go + - /models/components/encryptionoutput.go + - /models/components/transcodeprofile.go - /models/components/playbackpolicy.go - /models/components/creatorid.go - - /models/components/httpmetadata.go + - /models/components/assetpatchpayload.go + - /models/components/storage.go + - /models/components/spec.go + - /models/components/inputcreatorid.go + - /models/components/newassetpayload.go + - /models/components/newassetfromurlpayload.go + - /models/components/encryption.go + - /models/components/clippayload.go + - /models/components/stream.go + - /models/components/ffmpegprofile.go + - /models/components/targetoutput.go - /models/components/newstreampayload.go - /models/components/usertags.go + - /models/components/pull.go - /models/components/multistream.go - /models/components/target.go - - /models/components/recordingspec.go - - /models/components/inputcreatorid.go - - /models/components/pull.go - /models/components/streampatchpayload.go - - /models/components/asset.go - - /models/components/storagestatus.go - - /models/components/ipfsfileinfo.go - - /models/components/encryptionoutput.go - - /models/components/clippayload.go + - /models/components/recordingspec.go - /models/components/targetaddpayload.go + - /models/components/usagemetric.go + - /models/components/viewershipmetric.go - /models/components/multistreamtarget.go - /models/components/multistreamtargetinput.go - /models/components/multistreamtargetpatchpayload.go - - /models/components/webhook.go - - /models/components/webhooklog.go - - /models/components/newassetpayload.go - - /models/components/transcodeprofile.go - - /models/components/spec.go - - /models/components/newassetfromurlpayload.go - - /models/components/encryption.go - - /models/components/storage.go - - /models/components/assetpatchpayload.go - - /models/components/session.go + - /models/components/playbackinfo.go + - /models/components/attestation.go - /models/components/createroomresponse.go - /models/components/room.go - /models/components/roomegresspayload.go @@ -155,171 +157,136 @@ generatedFiles: - /models/components/roomuserpayload.go - /models/components/getroomuserresponse.go - /models/components/roomuserupdatepayload.go - - /models/components/viewershipmetric.go - - /models/components/usagemetric.go - - /models/components/signingkey.go + - /models/components/session.go - /models/components/task.go - /models/components/ipfsexportparams.go - /models/components/exporttaskparams.go - /models/components/transcodepayload.go - - /models/components/playbackinfo.go - - /models/components/attestation.go + - /models/components/webhook.go + - /models/components/webhooklog.go - /models/components/security.go - - docs/models/operations/createstreamresponse.md + - docs/models/operations/getsigningkeysresponse.md + - docs/models/operations/createsigningkeyresponse.md + - docs/models/operations/deletesigningkeyrequest.md + - docs/models/operations/deletesigningkeyresponse.md + - docs/models/operations/getsigningkeyrequest.md + - docs/models/operations/getsigningkeyresponse.md + - docs/models/operations/updatesigningkeyrequestbody.md + - docs/models/operations/updatesigningkeyrequest.md + - docs/models/operations/updatesigningkeyresponse.md + - docs/models/operations/getassetsresponse.md + - docs/models/operations/deleteassetrequest.md + - docs/models/operations/deleteassetresponse.md + - docs/models/operations/getassetrequest.md + - docs/models/operations/getassetresponse.md + - docs/models/operations/updateassetrequest.md + - docs/models/operations/updateassetresponse.md + - docs/models/operations/task.md + - docs/models/operations/requestuploaddata.md + - docs/models/operations/requestuploadresponse.md + - docs/models/operations/uploadassetassettask.md + - docs/models/operations/uploadassetdataoutput.md + - docs/models/operations/uploadassettask.md + - docs/models/operations/uploadassetdata.md + - docs/models/operations/uploadassetresponse.md + - docs/models/operations/createcliptask.md + - docs/models/operations/createclipdata.md + - docs/models/operations/createclipresponse.md - docs/models/operations/getstreamsrequest.md - docs/models/operations/getstreamsresponse.md + - docs/models/operations/createstreamresponse.md + - docs/models/operations/deletestreamrequest.md + - docs/models/operations/deletestreamresponse.md - docs/models/operations/getstreamrequest.md - docs/models/operations/getstreamresponse.md - docs/models/operations/updatestreamrequest.md - docs/models/operations/updatestreamresponse.md - - docs/models/operations/deletestreamrequest.md - - docs/models/operations/deletestreamresponse.md - - docs/models/operations/terminatestreamrequest.md - - docs/models/operations/terminatestreamresponse.md - - docs/models/operations/startpullstreamrequest.md - - docs/models/operations/startpullstreamresponse.md - - docs/models/operations/createcliptask.md - - docs/models/operations/createclipdata.md - - docs/models/operations/createclipresponse.md - docs/models/operations/getclipsrequest.md - docs/models/operations/getclipsresponse.md - docs/models/operations/addmultistreamtargetrequest.md - docs/models/operations/addmultistreamtargetresponse.md - docs/models/operations/removemultistreamtargetrequest.md - docs/models/operations/removemultistreamtargetresponse.md + - docs/models/operations/startpullstreamrequest.md + - docs/models/operations/startpullstreamresponse.md + - docs/models/operations/terminatestreamrequest.md + - docs/models/operations/terminatestreamresponse.md + - docs/models/operations/timestep.md + - docs/models/operations/breakdownby.md + - docs/models/operations/getusagemetricsrequest.md + - docs/models/operations/getusagemetricsresponse.md + - docs/models/operations/from.md + - docs/models/operations/to.md + - docs/models/operations/queryparamtimestep.md + - docs/models/operations/queryparambreakdownby.md + - docs/models/operations/getviewershipmetricsrequest.md + - docs/models/operations/getviewershipmetricsresponse.md + - docs/models/operations/queryparamfrom.md + - docs/models/operations/queryparamto.md + - docs/models/operations/getcreatorviewershipmetricsqueryparamtimestep.md + - docs/models/operations/getcreatorviewershipmetricsqueryparambreakdownby.md + - docs/models/operations/getcreatorviewershipmetricsrequest.md + - docs/models/operations/getcreatorviewershipmetricsresponse.md + - docs/models/operations/getpublicviewershipmetricsrequest.md + - docs/models/operations/getpublicviewershipmetricsdata.md + - docs/models/operations/getpublicviewershipmetricsresponse.md - docs/models/operations/getmultistreamtargetsresponse.md - docs/models/operations/createmultistreamtargetresponse.md + - docs/models/operations/deletemultistreamtargetrequest.md + - docs/models/operations/deletemultistreamtargetresponse.md - docs/models/operations/getmultistreamtargetrequest.md - docs/models/operations/getmultistreamtargetresponse.md - docs/models/operations/updatemultistreamtargetrequest.md - docs/models/operations/updatemultistreamtargetresponse.md - - docs/models/operations/deletemultistreamtargetrequest.md - - docs/models/operations/deletemultistreamtargetresponse.md + - docs/models/operations/getplaybackinforequest.md + - docs/models/operations/getplaybackinforesponse.md + - docs/models/operations/createroomresponse.md + - docs/models/operations/deleteroomrequest.md + - docs/models/operations/deleteroomresponse.md + - docs/models/operations/getroomrequest.md + - docs/models/operations/getroomresponse.md + - docs/models/operations/stoproomegressrequest.md + - docs/models/operations/stoproomegressresponse.md + - docs/models/operations/startroomegressrequest.md + - docs/models/operations/startroomegressresponse.md + - docs/models/operations/createroomuserrequest.md + - docs/models/operations/createroomuserresponse.md + - docs/models/operations/deleteroomuserrequest.md + - docs/models/operations/deleteroomuserresponse.md + - docs/models/operations/getroomuserrequest.md + - docs/models/operations/getroomuserresponse.md + - docs/models/operations/updateroomuserrequest.md + - docs/models/operations/updateroomuserresponse.md + - docs/models/operations/getsessionsresponse.md + - docs/models/operations/getsessionrequest.md + - docs/models/operations/getsessionresponse.md + - docs/models/operations/getsessionclipsrequest.md + - docs/models/operations/getsessionclipsresponse.md + - docs/models/operations/record.md + - docs/models/operations/getrecordedsessionsrequest.md + - docs/models/operations/getrecordedsessionsresponse.md + - docs/models/operations/gettasksresponse.md + - docs/models/operations/gettaskrequest.md + - docs/models/operations/gettaskresponse.md + - docs/models/operations/transcodevideoresponse.md - docs/models/operations/getwebhooksresponse.md - docs/models/operations/createwebhookresponse.md + - docs/models/operations/deletewebhookrequest.md + - docs/models/operations/deletewebhookresponse.md - docs/models/operations/getwebhookrequest.md - docs/models/operations/getwebhookresponse.md - docs/models/operations/updatewebhookrequest.md - docs/models/operations/updatewebhookresponse.md - - docs/models/operations/deletewebhookrequest.md - - docs/models/operations/deletewebhookresponse.md - docs/models/operations/getwebhooklogsrequest.md - docs/models/operations/getwebhooklogsresponse.md - docs/models/operations/getwebhooklogrequest.md - docs/models/operations/getwebhooklogresponse.md - docs/models/operations/resendwebhookrequest.md - docs/models/operations/resendwebhookresponse.md - - docs/models/operations/getassetsresponse.md - - docs/models/operations/task.md - - docs/models/operations/requestuploaddata.md - - docs/models/operations/requestuploadresponse.md - - docs/models/operations/uploadassetassettask.md - - docs/models/operations/uploadassetdataoutput.md - - docs/models/operations/uploadassettask.md - - docs/models/operations/uploadassetdata.md - - docs/models/operations/uploadassetresponse.md - - docs/models/operations/getassetrequest.md - - docs/models/operations/getassetresponse.md - - docs/models/operations/updateassetrequest.md - - docs/models/operations/updateassetresponse.md - - docs/models/operations/deleteassetrequest.md - - docs/models/operations/deleteassetresponse.md - - docs/models/operations/getsessionclipsrequest.md - - docs/models/operations/getsessionclipsresponse.md - - docs/models/operations/getsessionsresponse.md - - docs/models/operations/getsessionrequest.md - - docs/models/operations/getsessionresponse.md - - docs/models/operations/record.md - - docs/models/operations/getrecordedsessionsrequest.md - - docs/models/operations/getrecordedsessionsresponse.md - - docs/models/operations/createroomresponse.md - - docs/models/operations/getroomrequest.md - - docs/models/operations/getroomresponse.md - - docs/models/operations/deleteroomrequest.md - - docs/models/operations/deleteroomresponse.md - - docs/models/operations/startroomegressrequest.md - - docs/models/operations/startroomegressresponse.md - - docs/models/operations/stoproomegressrequest.md - - docs/models/operations/stoproomegressresponse.md - - docs/models/operations/createroomuserrequest.md - - docs/models/operations/createroomuserresponse.md - - docs/models/operations/getroomuserrequest.md - - docs/models/operations/getroomuserresponse.md - - docs/models/operations/updateroomuserrequest.md - - docs/models/operations/updateroomuserresponse.md - - docs/models/operations/deleteroomuserrequest.md - - docs/models/operations/deleteroomuserresponse.md - - docs/models/operations/from.md - - docs/models/operations/to.md - - docs/models/operations/timestep.md - - docs/models/operations/breakdownby.md - - docs/models/operations/getviewershipmetricsrequest.md - - docs/models/operations/getviewershipmetricsresponse.md - - docs/models/operations/queryparamfrom.md - - docs/models/operations/queryparamto.md - - docs/models/operations/queryparamtimestep.md - - docs/models/operations/queryparambreakdownby.md - - docs/models/operations/getcreatorviewershipmetricsrequest.md - - docs/models/operations/getcreatorviewershipmetricsresponse.md - - docs/models/operations/getpublicviewershipmetricsrequest.md - - docs/models/operations/getpublicviewershipmetricsdata.md - - docs/models/operations/getpublicviewershipmetricsresponse.md - - docs/models/operations/getusagemetricsqueryparamtimestep.md - - docs/models/operations/getusagemetricsqueryparambreakdownby.md - - docs/models/operations/getusagemetricsrequest.md - - docs/models/operations/getusagemetricsresponse.md - - docs/models/operations/createsigningkeyresponse.md - - docs/models/operations/getsigningkeysresponse.md - - docs/models/operations/deletesigningkeyrequest.md - - docs/models/operations/deletesigningkeyresponse.md - - docs/models/operations/getsigningkeyrequest.md - - docs/models/operations/getsigningkeyresponse.md - - docs/models/operations/updatesigningkeyrequestbody.md - - docs/models/operations/updatesigningkeyrequest.md - - docs/models/operations/updatesigningkeyresponse.md - - docs/models/operations/gettasksresponse.md - - docs/models/operations/gettaskrequest.md - - docs/models/operations/gettaskresponse.md - - docs/models/operations/transcodevideoresponse.md - - docs/models/operations/getplaybackinforequest.md - - docs/models/operations/getplaybackinforesponse.md - docs/models/sdkerrors/error.md - - docs/models/components/three.md - - docs/models/components/streamusertags.md - - docs/models/components/ismobile1.md - - docs/models/components/streamismobile.md - - docs/models/components/streamlocation.md - - docs/models/components/streampull.md - - docs/models/components/streamrecordingspec.md - - docs/models/components/streammultistream.md - - docs/models/components/renditions.md - - docs/models/components/stream.md - - docs/models/components/targetoutput.md - - docs/models/components/profile.md - - docs/models/components/encoder.md - - docs/models/components/ffmpegprofile.md - - docs/models/components/type.md - - docs/models/components/playbackpolicy.md - - docs/models/components/creatoridtype.md - - docs/models/components/creatorid1.md - - docs/models/components/creatorid.md + - docs/models/components/signingkey.md - docs/models/components/httpmetadata.md - - docs/models/components/newstreampayload.md - - docs/models/components/usertags3.md - - docs/models/components/usertags.md - - docs/models/components/multistream.md - - docs/models/components/targetspec.md - - docs/models/components/target.md - - docs/models/components/recordingspec.md - - docs/models/components/inputcreatoridtype.md - - docs/models/components/inputcreatorid1.md - - docs/models/components/inputcreatorid.md - - docs/models/components/one.md - - docs/models/components/ismobile.md - - docs/models/components/location.md - - docs/models/components/pull.md - - docs/models/components/streampatchpayload.md - - docs/models/components/assettype.md + - docs/models/components/hash.md - docs/models/components/assetsource3type.md - docs/models/components/source3.md - docs/models/components/assetsourcetype.md @@ -327,14 +294,14 @@ generatedFiles: - docs/models/components/sourcetype.md - docs/models/components/source1.md - docs/models/components/source.md - - docs/models/components/assetnftmetadatatemplate.md + - docs/models/components/assetphase.md + - docs/models/components/status.md - docs/models/components/assetnftmetadata.md + - docs/models/components/assetnftmetadatatemplate.md - docs/models/components/assetspec.md - docs/models/components/assetipfs.md - docs/models/components/assetstorage.md - - docs/models/components/assetphase.md - - docs/models/components/assetstatus.md - - docs/models/components/hash.md + - docs/models/components/assettype.md - docs/models/components/assetvideospectype.md - docs/models/components/tracks.md - docs/models/components/videospec.md @@ -344,39 +311,86 @@ generatedFiles: - docs/models/components/storagestatus.md - docs/models/components/ipfsfileinfo.md - docs/models/components/encryptionoutput.md + - docs/models/components/encoder.md + - docs/models/components/profile.md + - docs/models/components/transcodeprofile.md + - docs/models/components/type.md + - docs/models/components/playbackpolicy.md + - docs/models/components/creatoridtype.md + - docs/models/components/creatorid1.md + - docs/models/components/creatorid.md + - docs/models/components/assetpatchpayload.md + - docs/models/components/one.md + - docs/models/components/ipfs.md + - docs/models/components/storage.md + - docs/models/components/nftmetadata.md + - docs/models/components/nftmetadatatemplate.md + - docs/models/components/spec.md + - docs/models/components/inputcreatoridtype.md + - docs/models/components/inputcreatorid1.md + - docs/models/components/inputcreatorid.md + - docs/models/components/newassetpayloadencryption.md + - docs/models/components/ipfs1.md + - docs/models/components/newassetpayloadipfs.md + - docs/models/components/newassetpayloadstorage.md + - docs/models/components/newassetpayload.md + - docs/models/components/newassetfromurlpayload.md + - docs/models/components/encryption.md - docs/models/components/clippayload.md + - docs/models/components/streammultistream.md + - docs/models/components/streamismobile1.md + - docs/models/components/streamismobile.md + - docs/models/components/streamlocation.md + - docs/models/components/streampull.md + - docs/models/components/streamrecordingspec.md + - docs/models/components/renditions.md + - docs/models/components/three.md + - docs/models/components/streamusertags.md + - docs/models/components/stream.md + - docs/models/components/ffmpegprofileencoder.md + - docs/models/components/ffmpegprofileprofile.md + - docs/models/components/ffmpegprofile.md + - docs/models/components/targetoutput.md + - docs/models/components/newstreampayloadrecordingspec.md + - docs/models/components/newstreampayload.md + - docs/models/components/usertags3.md + - docs/models/components/usertags.md + - docs/models/components/ismobile1.md + - docs/models/components/ismobile.md + - docs/models/components/location.md + - docs/models/components/pull.md + - docs/models/components/multistream.md + - docs/models/components/targetspec.md + - docs/models/components/target.md + - docs/models/components/streampatchpayload.md + - docs/models/components/recordingspec.md - docs/models/components/targetaddpayloadspec.md - docs/models/components/targetaddpayload.md + - docs/models/components/usagemetric.md + - docs/models/components/viewershipmetric.md - docs/models/components/multistreamtarget.md - docs/models/components/multistreamtargetinput.md - docs/models/components/multistreamtargetpatchpayload.md - - docs/models/components/events.md - - docs/models/components/lastfailure.md - - docs/models/components/status.md - - docs/models/components/webhook.md - - docs/models/components/webhookinput.md - - docs/models/components/request.md - - docs/models/components/response.md - - docs/models/components/webhooklog.md - - docs/models/components/newassetpayloadipfs1.md - - docs/models/components/newassetpayloadipfs.md - - docs/models/components/newassetpayloadstorage.md - - docs/models/components/newassetpayloadencryption.md - - docs/models/components/newassetpayload.md - - docs/models/components/transcodeprofileprofile.md - - docs/models/components/transcodeprofileencoder.md - - docs/models/components/transcodeprofile.md - - docs/models/components/nftmetadatatemplate.md - - docs/models/components/nftmetadata.md - - docs/models/components/spec.md - - docs/models/components/newassetfromurlpayload.md - - docs/models/components/encryption.md - - docs/models/components/ipfs1.md - - docs/models/components/ipfs.md - - docs/models/components/storage.md - - docs/models/components/assetpatchpayload.md - - docs/models/components/recordingstatus.md - - docs/models/components/session.md + - docs/models/components/hrn.md + - docs/models/components/playbackinfometadvrplaybacktype.md + - docs/models/components/dvrplayback.md + - docs/models/components/live.md + - docs/models/components/playbackinfohrn.md + - docs/models/components/playbackinfometatype.md + - docs/models/components/playbackinfosource.md + - docs/models/components/meta.md + - docs/models/components/playbackinfotype.md + - docs/models/components/playbackinfo.md + - docs/models/components/name.md + - docs/models/components/version.md + - docs/models/components/domain.md + - docs/models/components/attestations.md + - docs/models/components/message.md + - docs/models/components/primarytype.md + - docs/models/components/signaturetype.md + - docs/models/components/attestationipfs.md + - docs/models/components/attestationstorage.md + - docs/models/components/attestation.md - docs/models/components/createroomresponse.md - docs/models/components/participants.md - docs/models/components/room.md @@ -385,31 +399,30 @@ generatedFiles: - docs/models/components/roomuserpayload.md - docs/models/components/getroomuserresponse.md - docs/models/components/roomuserupdatepayload.md - - docs/models/components/viewershipmetric.md - - docs/models/components/usagemetric.md - - docs/models/components/signingkey.md - - docs/models/components/tasktype.md + - docs/models/components/recordingstatus.md + - docs/models/components/session.md + - docs/models/components/taskipfs.md + - docs/models/components/export.md + - docs/models/components/taskoutputipfs.md + - docs/models/components/exportdata.md - docs/models/components/upload.md + - docs/models/components/output.md + - docs/models/components/catalystpipelinestrategy.md + - docs/models/components/clipstrategy.md + - docs/models/components/clip.md - docs/models/components/content.md - docs/models/components/taskexportdata.md - docs/models/components/taskinput.md - - docs/models/components/taskstorage.md - docs/models/components/taskhls.md - docs/models/components/taskmp4.md - docs/models/components/taskoutputs.md + - docs/models/components/taskstorage.md - docs/models/components/transcodefile.md - - docs/models/components/clipstrategy.md - - docs/models/components/catalystpipelinestrategy.md - - docs/models/components/clip.md + - docs/models/components/taskupload.md - docs/models/components/params.md - docs/models/components/taskphase.md - docs/models/components/taskstatus.md - - docs/models/components/taskupload.md - - docs/models/components/taskipfs.md - - docs/models/components/export.md - - docs/models/components/taskoutputipfs.md - - docs/models/components/exportdata.md - - docs/models/components/output.md + - docs/models/components/tasktype.md - docs/models/components/task.md - docs/models/components/pinata2.md - docs/models/components/pinata1.md @@ -419,56 +432,44 @@ generatedFiles: - docs/models/components/custom.md - docs/models/components/exporttaskparams1.md - docs/models/components/exporttaskparams.md - - docs/models/components/inputtype.md - docs/models/components/credentials.md + - docs/models/components/inputtype.md - docs/models/components/input2.md - docs/models/components/input1.md - docs/models/components/input.md - - docs/models/components/transcodepayloadstoragetype.md + - docs/models/components/fmp4.md + - docs/models/components/hls.md + - docs/models/components/mp4.md + - docs/models/components/outputs.md - docs/models/components/transcodepayloadstoragecredentials.md + - docs/models/components/transcodepayloadstoragetype.md - docs/models/components/storage2.md - - docs/models/components/storagetype.md - docs/models/components/storagecredentials.md + - docs/models/components/storagetype.md - docs/models/components/storage1.md - docs/models/components/transcodepayloadstorage.md - - docs/models/components/hls.md - - docs/models/components/mp4.md - - docs/models/components/fmp4.md - - docs/models/components/outputs.md - docs/models/components/transcodepayload.md - - docs/models/components/playbackinfotype.md - - docs/models/components/live.md - - docs/models/components/hrn.md - - docs/models/components/playbackinfometatype.md - - docs/models/components/playbackinfosource.md - - docs/models/components/playbackinfohrn.md - - docs/models/components/playbackinfometadvrplaybacktype.md - - docs/models/components/dvrplayback.md - - docs/models/components/meta.md - - docs/models/components/playbackinfo.md - - docs/models/components/primarytype.md - - docs/models/components/name.md - - docs/models/components/version.md - - docs/models/components/domain.md - - docs/models/components/attestations.md - - docs/models/components/message.md - - docs/models/components/signaturetype.md - - docs/models/components/attestationipfs.md - - docs/models/components/attestationstorage.md - - docs/models/components/attestation.md + - docs/models/components/events.md + - docs/models/components/lastfailure.md + - docs/models/components/webhookstatus.md + - docs/models/components/webhook.md + - docs/models/components/webhookinput.md + - docs/models/components/request.md + - docs/models/components/response.md + - docs/models/components/webhooklog.md - docs/models/components/security.md - docs/sdks/livepeer/README.md + - docs/sdks/accesscontrol/README.md + - docs/sdks/asset/README.md - docs/sdks/stream/README.md + - docs/sdks/metrics/README.md - docs/sdks/multistream/README.md - - docs/sdks/webhook/README.md - - docs/sdks/asset/README.md - - docs/sdks/session/README.md + - docs/sdks/playback/README.md - docs/sdks/room/README.md - - docs/sdks/metrics/README.md - - docs/sdks/accesscontrol/README.md + - docs/sdks/session/README.md - docs/sdks/task/README.md - docs/sdks/transcode/README.md - - docs/sdks/playback/README.md + - docs/sdks/webhook/README.md - USAGE.md - .gitattributes - internal/hooks/hooks.go diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 84d20c5..e172c17 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.1.11 + version: 0.1.12 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0700426..ab5bb0e 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.306.0 +speakeasyVersion: 1.322.3 sources: livepeer-studio-api: sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:a866401a9687455ad46a5ece16a0317b269083617f6b779c6e820f8988f07d81 - sourceBlobDigest: sha256:007bb69b933f0a8a214469ae277e790afb3e2ab601577684da172abb8eb25a69 + sourceRevisionDigest: sha256:dd6b8ce115fbfee43ddf568035ef70313a0c689bed06b61226dae1648e253115 + sourceBlobDigest: sha256:63e4974701821fc5b4e707c5eeb7666335e0ebe8ca208c64892ca6f53db7926d tags: - latest - main @@ -11,8 +11,8 @@ targets: livepeer-go: source: livepeer-studio-api sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:a866401a9687455ad46a5ece16a0317b269083617f6b779c6e820f8988f07d81 - sourceBlobDigest: sha256:007bb69b933f0a8a214469ae277e790afb3e2ab601577684da172abb8eb25a69 + sourceRevisionDigest: sha256:dd6b8ce115fbfee43ddf568035ef70313a0c689bed06b61226dae1648e253115 + sourceBlobDigest: sha256:63e4974701821fc5b4e707c5eeb7666335e0ebe8ca208c64892ca6f53db7926d outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/README.md b/README.md index b08677b..c822143 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,6 @@ package main import ( "context" livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "log" ) @@ -214,75 +213,13 @@ func main() { livepeergo.WithServerIndex(0), livepeergo.WithSecurity(""), ) - request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, - }, - }, - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - }, - }, - }, - } + ctx := context.Background() - res, err := s.Stream.Create(ctx, request) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.Data != nil { // handle response } } @@ -299,7 +236,6 @@ package main import ( "context" livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "log" ) @@ -308,75 +244,13 @@ func main() { livepeergo.WithServerURL("https://livepeer.studio/api"), livepeergo.WithSecurity(""), ) - request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, - }, - }, - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - }, - }, - }, - } + ctx := context.Background() - res, err := s.Stream.Create(ctx, request) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.Data != nil { // handle response } } @@ -431,7 +305,6 @@ package main import ( "context" livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "log" ) @@ -439,75 +312,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, - }, - }, - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - }, - }, - }, - } + ctx := context.Background() - res, err := s.Stream.Create(ctx, request) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.Data != nil { // handle response } } @@ -540,7 +351,6 @@ package main import ( "context" livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "log" ) @@ -548,75 +358,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, - }, - }, - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - }, - }, - }, - } + ctx := context.Background() - res, err := s.Stream.Create(ctx, request) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.Data != nil { // handle response } } @@ -627,81 +375,74 @@ func main() { ## Available Resources and Operations +### [AccessControl](docs/sdks/accesscontrol/README.md) + +* [GetAll](docs/sdks/accesscontrol/README.md#getall) - Retrieves signing keys +* [Create](docs/sdks/accesscontrol/README.md#create) - Create a signing key +* [Delete](docs/sdks/accesscontrol/README.md#delete) - Delete Signing Key +* [Get](docs/sdks/accesscontrol/README.md#get) - Retrieves a signing key +* [Update](docs/sdks/accesscontrol/README.md#update) - Update a signing key + +### [Asset](docs/sdks/asset/README.md) + +* [GetAll](docs/sdks/asset/README.md#getall) - Retrieve assets +* [Delete](docs/sdks/asset/README.md#delete) - Delete an asset +* [Get](docs/sdks/asset/README.md#get) - Retrieves an asset +* [Update](docs/sdks/asset/README.md#update) - Patch an asset +* [Create](docs/sdks/asset/README.md#create) - Upload an asset +* [CreateViaURL](docs/sdks/asset/README.md#createviaurl) - Upload asset via URL + ### [Stream](docs/sdks/stream/README.md) -* [Create](docs/sdks/stream/README.md#create) - Create a stream +* [CreateClip](docs/sdks/stream/README.md#createclip) - Create a clip * [GetAll](docs/sdks/stream/README.md#getall) - Retrieve streams +* [Create](docs/sdks/stream/README.md#create) - Create a stream +* [Delete](docs/sdks/stream/README.md#delete) - Delete a stream * [Get](docs/sdks/stream/README.md#get) - Retrieve a stream * [Update](docs/sdks/stream/README.md#update) - Update a stream -* [Delete](docs/sdks/stream/README.md#delete) - Delete a stream -* [Terminate](docs/sdks/stream/README.md#terminate) - Terminates a live stream -* [StartPull](docs/sdks/stream/README.md#startpull) - Start ingest for a pull stream -* [CreateClip](docs/sdks/stream/README.md#createclip) - Create a clip * [GetClips](docs/sdks/stream/README.md#getclips) - Retrieve clips of a livestream * [AddMultistreamTarget](docs/sdks/stream/README.md#addmultistreamtarget) - Add a multistream target * [RemoveMultistreamTarget](docs/sdks/stream/README.md#removemultistreamtarget) - Remove a multistream target +* [StartPull](docs/sdks/stream/README.md#startpull) - Start ingest for a pull stream +* [Terminate](docs/sdks/stream/README.md#terminate) - Terminates a live stream + +### [Metrics](docs/sdks/metrics/README.md) + +* [GetUsage](docs/sdks/metrics/README.md#getusage) - Query usage metrics +* [GetViewership](docs/sdks/metrics/README.md#getviewership) - Query viewership metrics +* [GetCreatorViewership](docs/sdks/metrics/README.md#getcreatorviewership) - Query creator viewership metrics +* [GetPublicViewership](docs/sdks/metrics/README.md#getpublicviewership) - Query public total views metrics ### [Multistream](docs/sdks/multistream/README.md) * [GetAll](docs/sdks/multistream/README.md#getall) - Retrieve Multistream Targets * [Create](docs/sdks/multistream/README.md#create) - Create a multistream target +* [Delete](docs/sdks/multistream/README.md#delete) - Delete a multistream target * [Get](docs/sdks/multistream/README.md#get) - Retrieve a multistream target * [Update](docs/sdks/multistream/README.md#update) - Update Multistream Target -* [Delete](docs/sdks/multistream/README.md#delete) - Delete a multistream target - -### [Webhook](docs/sdks/webhook/README.md) - -* [GetAll](docs/sdks/webhook/README.md#getall) - Retrieve a Webhook -* [Create](docs/sdks/webhook/README.md#create) - Create a webhook -* [Get](docs/sdks/webhook/README.md#get) - Retrieve a webhook -* [Update](docs/sdks/webhook/README.md#update) - Update a webhook -* [Delete](docs/sdks/webhook/README.md#delete) - Delete a webhook -* [GetLogs](docs/sdks/webhook/README.md#getlogs) - Retrieve webhook logs -* [GetLog](docs/sdks/webhook/README.md#getlog) - Retrieve a webhook log -* [ResendLog](docs/sdks/webhook/README.md#resendlog) - Resend a webhook - -### [Asset](docs/sdks/asset/README.md) - -* [GetAll](docs/sdks/asset/README.md#getall) - Retrieve assets -* [Create](docs/sdks/asset/README.md#create) - Upload an asset -* [CreateViaURL](docs/sdks/asset/README.md#createviaurl) - Upload asset via URL -* [Get](docs/sdks/asset/README.md#get) - Retrieves an asset -* [Update](docs/sdks/asset/README.md#update) - Patch an asset -* [Delete](docs/sdks/asset/README.md#delete) - Delete an asset -### [Session](docs/sdks/session/README.md) +### [Playback](docs/sdks/playback/README.md) -* [GetClips](docs/sdks/session/README.md#getclips) - Retrieve clips of a session -* [GetAll](docs/sdks/session/README.md#getall) - Retrieve sessions -* [Get](docs/sdks/session/README.md#get) - Retrieve a session -* [GetRecorded](docs/sdks/session/README.md#getrecorded) - Retrieve Recorded Sessions +* [Get](docs/sdks/playback/README.md#get) - Retrieve Playback Info ### [Room](docs/sdks/room/README.md) * [~~Create~~](docs/sdks/room/README.md#create) - Create a room :warning: **Deprecated** -* [~~Get~~](docs/sdks/room/README.md#get) - Retrieve a room :warning: **Deprecated** * [~~Delete~~](docs/sdks/room/README.md#delete) - Delete a room :warning: **Deprecated** -* [~~StartEgress~~](docs/sdks/room/README.md#startegress) - Start room RTMP egress :warning: **Deprecated** +* [~~Get~~](docs/sdks/room/README.md#get) - Retrieve a room :warning: **Deprecated** * [~~StopEgress~~](docs/sdks/room/README.md#stopegress) - Stop room RTMP egress :warning: **Deprecated** +* [~~StartEgress~~](docs/sdks/room/README.md#startegress) - Start room RTMP egress :warning: **Deprecated** * [~~CreateUser~~](docs/sdks/room/README.md#createuser) - Create a room user :warning: **Deprecated** +* [~~DeleteUser~~](docs/sdks/room/README.md#deleteuser) - Remove a user from the room :warning: **Deprecated** * [~~GetUser~~](docs/sdks/room/README.md#getuser) - Get user details :warning: **Deprecated** * [~~UpdateUser~~](docs/sdks/room/README.md#updateuser) - Update a room user :warning: **Deprecated** -* [~~DeleteUser~~](docs/sdks/room/README.md#deleteuser) - Remove a user from the room :warning: **Deprecated** -### [Metrics](docs/sdks/metrics/README.md) - -* [GetViewership](docs/sdks/metrics/README.md#getviewership) - Query viewership metrics -* [GetCreatorViewership](docs/sdks/metrics/README.md#getcreatorviewership) - Query creator viewership metrics -* [GetPublicViewership](docs/sdks/metrics/README.md#getpublicviewership) - Query public total views metrics -* [GetUsage](docs/sdks/metrics/README.md#getusage) - Query usage metrics - -### [AccessControl](docs/sdks/accesscontrol/README.md) +### [Session](docs/sdks/session/README.md) -* [Create](docs/sdks/accesscontrol/README.md#create) - Create a signing key -* [GetAll](docs/sdks/accesscontrol/README.md#getall) - Retrieves signing keys -* [Delete](docs/sdks/accesscontrol/README.md#delete) - Delete Signing Key -* [Get](docs/sdks/accesscontrol/README.md#get) - Retrieves a signing key -* [Update](docs/sdks/accesscontrol/README.md#update) - Update a signing key +* [GetAll](docs/sdks/session/README.md#getall) - Retrieve sessions +* [Get](docs/sdks/session/README.md#get) - Retrieve a session +* [GetClips](docs/sdks/session/README.md#getclips) - Retrieve clips of a session +* [GetRecorded](docs/sdks/session/README.md#getrecorded) - Retrieve Recorded Sessions ### [Task](docs/sdks/task/README.md) @@ -712,9 +453,16 @@ func main() { * [Create](docs/sdks/transcode/README.md#create) - Transcode a video -### [Playback](docs/sdks/playback/README.md) +### [Webhook](docs/sdks/webhook/README.md) -* [Get](docs/sdks/playback/README.md#get) - Retrieve Playback Info +* [GetAll](docs/sdks/webhook/README.md#getall) - Retrieve a Webhook +* [Create](docs/sdks/webhook/README.md#create) - Create a webhook +* [Delete](docs/sdks/webhook/README.md#delete) - Delete a webhook +* [Get](docs/sdks/webhook/README.md#get) - Retrieve a webhook +* [Update](docs/sdks/webhook/README.md#update) - Update a webhook +* [GetLogs](docs/sdks/webhook/README.md#getlogs) - Retrieve webhook logs +* [GetLog](docs/sdks/webhook/README.md#getlog) - Retrieve a webhook log +* [ResendLog](docs/sdks/webhook/README.md#resendlog) - Resend a webhook diff --git a/RELEASES.md b/RELEASES.md index 7d1a40e..86651b7 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -38,4 +38,14 @@ Based on: ### Generated - [go v0.1.11] . ### Releases -- [Go v0.1.11] https://github.com/livepeer/livepeer-go/releases/tag/v0.1.11 - . \ No newline at end of file +- [Go v0.1.11] https://github.com/livepeer/livepeer-go/releases/tag/v0.1.11 - . + +## 2024-07-01 00:28:59 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.322.3 (2.354.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.1.12] . +### Releases +- [Go v0.1.12] https://github.com/livepeer/livepeer-go/releases/tag/v0.1.12 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 880f5b2..c0db301 100644 --- a/USAGE.md +++ b/USAGE.md @@ -5,7 +5,6 @@ package main import ( "context" livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "log" ) @@ -13,75 +12,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, - }, - }, - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - }, - }, - }, - } + ctx := context.Background() - res, err := s.Stream.Create(ctx, request) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.Data != nil { // handle response } } diff --git a/accesscontrol.go b/accesscontrol.go index c909810..ab8f9bf 100644 --- a/accesscontrol.go +++ b/accesscontrol.go @@ -27,13 +27,11 @@ func newAccessControl(sdkConfig sdkConfiguration) *AccessControl { } } -// Create a signing key -// The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. -// Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one. -func (s *AccessControl) Create(ctx context.Context) (*operations.CreateSigningKeyResponse, error) { +// GetAll - Retrieves signing keys +func (s *AccessControl) GetAll(ctx context.Context) (*operations.GetSigningKeysResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "createSigningKey", + OperationID: "getSigningKeys", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } @@ -44,7 +42,7 @@ func (s *AccessControl) Create(ctx context.Context) (*operations.CreateSigningKe return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -84,7 +82,7 @@ func (s *AccessControl) Create(ctx context.Context) (*operations.CreateSigningKe } } - res := &operations.CreateSigningKeyResponse{ + res := &operations.GetSigningKeysResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -102,12 +100,12 @@ func (s *AccessControl) Create(ctx context.Context) (*operations.CreateSigningKe case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.SigningKey + var out []components.SigningKey if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.SigningKey = &out + res.Data = out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -133,11 +131,13 @@ func (s *AccessControl) Create(ctx context.Context) (*operations.CreateSigningKe } -// GetAll - Retrieves signing keys -func (s *AccessControl) GetAll(ctx context.Context) (*operations.GetSigningKeysResponse, error) { +// Create a signing key +// The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. +// Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one. +func (s *AccessControl) Create(ctx context.Context) (*operations.CreateSigningKeyResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getSigningKeys", + OperationID: "createSigningKey", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } @@ -148,7 +148,7 @@ func (s *AccessControl) GetAll(ctx context.Context) (*operations.GetSigningKeysR return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -188,7 +188,7 @@ func (s *AccessControl) GetAll(ctx context.Context) (*operations.GetSigningKeysR } } - res := &operations.GetSigningKeysResponse{ + res := &operations.CreateSigningKeyResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -206,12 +206,12 @@ func (s *AccessControl) GetAll(ctx context.Context) (*operations.GetSigningKeysR case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out []components.SigningKey + var out components.SigningKey if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Data = out + res.SigningKey = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/asset.go b/asset.go index 54e7569..4f3fdf0 100644 --- a/asset.go +++ b/asset.go @@ -131,103 +131,31 @@ func (s *Asset) GetAll(ctx context.Context) (*operations.GetAssetsResponse, erro } -// Create - Upload an asset -// To upload an asset, your first need to request for a direct upload URL -// and only then actually upload the contents of the asset. -// \ -// \ -// Once you created a upload link, you have 2 options, resumable or direct -// upload. For a more reliable experience, you should use resumable uploads -// which will work better for users with unreliable or slow network -// connections. If you want a simpler implementation though, you should -// just use a direct upload. -// -// ## Direct Upload -// For a direct upload, make a PUT request to the URL received in the url -// field of the response above, with the raw video file as the request -// body. response above: -// -// ## Resumable Upload -// Livepeer supports resumable uploads via Tus. This section provides a -// simple example of how to use tus-js-client to upload a video file. -// \ -// \ -// From the previous section, we generated a URL to upload a video file to -// Livepeer on POST /api/asset/request-upload. You should use the -// tusEndpoint field of the response to upload the video file and track the -// progress: -// -// ``` -// # This assumes there is an `input` element of `type="file"` with id -// `fileInput` in the HTML -// -// const input = document.getElementById('fileInput'); -// -// const file = input.files[0]; -// -// const upload = new tus.Upload(file, { -// endpoint: tusEndpoint, // URL from `tusEndpoint` field in the -// -// `/request-upload` response -// -// metadata: { -// filename, -// filetype: 'video/mp4', -// }, -// uploadSize: file.size, -// onError(err) { -// console.error('Error uploading file:', err); -// }, -// onProgress(bytesUploaded, bytesTotal) { -// const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2); -// console.log('Uploaded ' + percentage + '%'); -// }, -// onSuccess() { -// console.log('Upload finished:', upload.url); -// }, -// }); -// -// const previousUploads = await upload.findPreviousUploads(); -// -// if (previousUploads.length > 0) { -// upload.resumeFromPreviousUpload(previousUploads[0]); -// } -// -// upload.start(); -// -// ``` -// -// > Note: If you are using tus from node.js, you need to add a custom URL -// storage to enable resuming from previous uploads. On the browser, this -// is enabled by default using local storage. In node.js, add urlStorage: -// new tus.FileUrlStorage("path/to/tmp/file"), to the UploadFile object -// definition above. -func (s *Asset) Create(ctx context.Context, request components.NewAssetPayload) (*operations.RequestUploadResponse, error) { +// Delete an asset +func (s *Asset) Delete(ctx context.Context, assetID string) (*operations.DeleteAssetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "requestUpload", + OperationID: "deleteAsset", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/asset/request-upload") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) + request := operations.DeleteAssetRequest{ + AssetID: assetID, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/asset/{assetId}", request, nil) if err != nil { - return nil, err + return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -262,7 +190,7 @@ func (s *Asset) Create(ctx context.Context, request components.NewAssetPayload) } } - res := &operations.RequestUploadResponse{ + res := &operations.DeleteAssetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -277,18 +205,7 @@ func (s *Asset) Create(ctx context.Context, request components.NewAssetPayload) httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out operations.RequestUploadData - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Data = &out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 204: case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -311,33 +228,31 @@ func (s *Asset) Create(ctx context.Context, request components.NewAssetPayload) } -// CreateViaURL - Upload asset via URL -func (s *Asset) CreateViaURL(ctx context.Context, request components.NewAssetFromURLPayload) (*operations.UploadAssetResponse, error) { +// Get - Retrieves an asset +func (s *Asset) Get(ctx context.Context, assetID string) (*operations.GetAssetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "uploadAsset", + OperationID: "getAsset", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/asset/upload/url") - if err != nil { - return nil, fmt.Errorf("error generating URL: %w", err) + request := operations.GetAssetRequest{ + AssetID: assetID, } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + opURL, err := utils.GenerateURL(ctx, baseURL, "/asset/{assetId}", request, nil) if err != nil { - return nil, err + return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -372,7 +287,7 @@ func (s *Asset) CreateViaURL(ctx context.Context, request components.NewAssetFro } } - res := &operations.UploadAssetResponse{ + res := &operations.GetAssetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -390,24 +305,12 @@ func (s *Asset) CreateViaURL(ctx context.Context, request components.NewAssetFro case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out operations.UploadAssetData - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.TwoHundredApplicationJSONData = &out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } - case httpRes.StatusCode == 201: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out operations.UploadAssetDataOutput + var out components.Asset if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.TwoHundredAndOneApplicationJSONData = &out + res.Asset = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -433,17 +336,18 @@ func (s *Asset) CreateViaURL(ctx context.Context, request components.NewAssetFro } -// Get - Retrieves an asset -func (s *Asset) Get(ctx context.Context, assetID string) (*operations.GetAssetResponse, error) { +// Update - Patch an asset +func (s *Asset) Update(ctx context.Context, assetID string, assetPatchPayload components.AssetPatchPayload) (*operations.UpdateAssetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getAsset", + OperationID: "updateAsset", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetAssetRequest{ - AssetID: assetID, + request := operations.UpdateAssetRequest{ + AssetID: assetID, + AssetPatchPayload: assetPatchPayload, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -452,12 +356,18 @@ func (s *Asset) Get(ctx context.Context, assetID string) (*operations.GetAssetRe return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "AssetPatchPayload", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -492,7 +402,7 @@ func (s *Asset) Get(ctx context.Context, assetID string) (*operations.GetAssetRe } } - res := &operations.GetAssetResponse{ + res := &operations.UpdateAssetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -541,32 +451,97 @@ func (s *Asset) Get(ctx context.Context, assetID string) (*operations.GetAssetRe } -// Update - Patch an asset -func (s *Asset) Update(ctx context.Context, assetID string, assetPatchPayload components.AssetPatchPayload) (*operations.UpdateAssetResponse, error) { +// Create - Upload an asset +// To upload an asset, your first need to request for a direct upload URL +// and only then actually upload the contents of the asset. +// \ +// \ +// Once you created a upload link, you have 2 options, resumable or direct +// upload. For a more reliable experience, you should use resumable uploads +// which will work better for users with unreliable or slow network +// connections. If you want a simpler implementation though, you should +// just use a direct upload. +// +// ## Direct Upload +// For a direct upload, make a PUT request to the URL received in the url +// field of the response above, with the raw video file as the request +// body. response above: +// +// ## Resumable Upload +// Livepeer supports resumable uploads via Tus. This section provides a +// simple example of how to use tus-js-client to upload a video file. +// \ +// \ +// From the previous section, we generated a URL to upload a video file to +// Livepeer on POST /api/asset/request-upload. You should use the +// tusEndpoint field of the response to upload the video file and track the +// progress: +// +// ``` +// # This assumes there is an `input` element of `type="file"` with id +// `fileInput` in the HTML +// +// const input = document.getElementById('fileInput'); +// +// const file = input.files[0]; +// +// const upload = new tus.Upload(file, { +// endpoint: tusEndpoint, // URL from `tusEndpoint` field in the +// +// `/request-upload` response +// +// metadata: { +// filename, +// filetype: 'video/mp4', +// }, +// uploadSize: file.size, +// onError(err) { +// console.error('Error uploading file:', err); +// }, +// onProgress(bytesUploaded, bytesTotal) { +// const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2); +// console.log('Uploaded ' + percentage + '%'); +// }, +// onSuccess() { +// console.log('Upload finished:', upload.url); +// }, +// }); +// +// const previousUploads = await upload.findPreviousUploads(); +// +// if (previousUploads.length > 0) { +// upload.resumeFromPreviousUpload(previousUploads[0]); +// } +// +// upload.start(); +// +// ``` +// +// > Note: If you are using tus from node.js, you need to add a custom URL +// storage to enable resuming from previous uploads. On the browser, this +// is enabled by default using local storage. In node.js, add urlStorage: +// new tus.FileUrlStorage("path/to/tmp/file"), to the UploadFile object +// definition above. +func (s *Asset) Create(ctx context.Context, request components.NewAssetPayload) (*operations.RequestUploadResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "updateAsset", + OperationID: "requestUpload", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.UpdateAssetRequest{ - AssetID: assetID, - AssetPatchPayload: assetPatchPayload, - } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/asset/{assetId}", request, nil) + opURL, err := url.JoinPath(baseURL, "/asset/request-upload") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "AssetPatchPayload", "json", `request:"mediaType=application/json"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err } - req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -607,7 +582,7 @@ func (s *Asset) Update(ctx context.Context, assetID string, assetPatchPayload co } } - res := &operations.UpdateAssetResponse{ + res := &operations.RequestUploadResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -625,12 +600,12 @@ func (s *Asset) Update(ctx context.Context, assetID string, assetPatchPayload co case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.Asset + var out operations.RequestUploadData if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Asset = &out + res.Data = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -656,31 +631,33 @@ func (s *Asset) Update(ctx context.Context, assetID string, assetPatchPayload co } -// Delete an asset -func (s *Asset) Delete(ctx context.Context, assetID string) (*operations.DeleteAssetResponse, error) { +// CreateViaURL - Upload asset via URL +func (s *Asset) CreateViaURL(ctx context.Context, request components.NewAssetFromURLPayload) (*operations.UploadAssetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "deleteAsset", + OperationID: "uploadAsset", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.DeleteAssetRequest{ - AssetID: assetID, - } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/asset/{assetId}", request, nil) + opURL, err := url.JoinPath(baseURL, "/asset/upload/url") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -715,7 +692,7 @@ func (s *Asset) Delete(ctx context.Context, assetID string) (*operations.DeleteA } } - res := &operations.DeleteAssetResponse{ + res := &operations.UploadAssetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -730,7 +707,30 @@ func (s *Asset) Delete(ctx context.Context, assetID string) (*operations.DeleteA httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 204: + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out operations.UploadAssetData + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TwoHundredApplicationJSONData = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 201: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out operations.UploadAssetDataOutput + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.TwoHundredAndOneApplicationJSONData = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: diff --git a/codeSamples.yaml b/codeSamples.yaml index 6ec993e..1457809 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,41 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: + - target: $["paths"]["/clip"]["post"] + update: + x-codeSamples: + - lang: go + label: createClip + source: |- + package main + + import( + livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" + "context" + "log" + ) + + func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) + request := components.ClipPayload{ + EndTime: livepeergo.Float64(1587667174725), + Name: livepeergo.String("My Clip"), + PlaybackID: "eaw4nk06ts2d0mzb", + SessionID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), + StartTime: 1587667174725, + } + ctx := context.Background() + res, err := s.Stream.CreateClip(ctx, request) + if err != nil { + log.Fatal(err) + } + if res.Data != nil { + // handle response + } + } - target: $["paths"]["/stream"]["post"] update: x-codeSamples: @@ -23,64 +58,64 @@ actions: livepeergo.WithSecurity(""), ) request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, + Multistream: &components.Multistream{ + Targets: []components.Target{ + components.Target{ + ID: livepeergo.String("PUSH123"), + Profile: "720p", + Spec: &components.TargetSpec{ + Name: livepeergo.String("My target"), + URL: "rtmps://live.my-service.tv/channel/secretKey", + }, + VideoOnly: livepeergo.Bool(false), + }, }, }, + Name: "test_stream", PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, - RefreshInterval: livepeergo.Float64(600), + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), }, Profiles: []components.FfmpegProfile{ components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, Bitrate: 3000000, Fps: 30, FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), + Height: 486589, + Name: "720p", + Profile: components.FfmpegProfileProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: 1280, }, }, + Pull: &components.Pull{ + Headers: map[string]string{ + "Authorization": "Bearer 123", + }, + Location: &components.Location{ + Lat: 39.739, + Lon: -104.988, + }, + Source: "https://myservice.com/live/stream.flv", + }, Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, + RecordingSpec: &components.NewStreamPayloadRecordingSpec{ + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ Bitrate: 3000000, - Fps: 30, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), }, }, }, @@ -94,11 +129,11 @@ actions: // handle response } } - - target: $["paths"]["/asset/upload/url"]["post"] + - target: $["paths"]["/stream/{id}"]["patch"] update: x-codeSamples: - lang: go - label: uploadAsset + label: updateStream source: |- package main @@ -113,51 +148,80 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.NewAssetFromURLPayload{ - Name: "filename.mp4", - StaticMp4: livepeergo.Bool(true), + var id string = "" + + streamPatchPayload := components.StreamPatchPayload{ + Multistream: &components.Multistream{ + Targets: []components.Target{ + components.Target{ + ID: livepeergo.String("PUSH123"), + Profile: "720p", + Spec: &components.TargetSpec{ + Name: livepeergo.String("My target"), + URL: "rtmps://live.my-service.tv/channel/secretKey", + }, + VideoOnly: livepeergo.Bool(false), + }, + }, + }, PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, - RefreshInterval: livepeergo.Float64(600), + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), }, - URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", - Profiles: []components.TranscodeProfile{ - components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), + Profiles: []components.FfmpegProfile{ + components.FfmpegProfile{ Bitrate: 3000000, - Quality: livepeergo.Int64(23), - Fps: livepeergo.Int64(30), + Fps: 30, FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), - Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), - Encoder: components.TranscodeProfileEncoderH264.ToPointer(), + Height: 857478, + Name: "720p", + Profile: components.FfmpegProfileProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: 1280, + }, + }, + Record: livepeergo.Bool(false), + RecordingSpec: &components.RecordingSpec{ + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Bitrate: 3000000, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), + FpsDen: livepeergo.Int64(1), + Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), + }, }, }, } ctx := context.Background() - res, err := s.Asset.CreateViaURL(ctx, request) + res, err := s.Stream.Update(ctx, id, streamPatchPayload) if err != nil { log.Fatal(err) } - if res.TwoHundredApplicationJSONData != nil { + if res != nil { // handle response } } - - target: $["paths"]["/session"]["get"] + - target: $["paths"]["/multistream/target/{id}"]["patch"] update: x-codeSamples: - lang: go - label: getSessions + label: updateMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -166,21 +230,25 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) + var id string = "" + multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{ + URL: "rtmps://live.my-service.tv/channel/secretKey", + } ctx := context.Background() - res, err := s.Session.GetAll(ctx) + res, err := s.Multistream.Update(ctx, id, multistreamTargetPatchPayload) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/room/{id}/egress"]["delete"] + - target: $["paths"]["/stream/{id}"]["delete"] update: x-codeSamples: - lang: go - label: stopRoomEgress + label: deleteStream source: |- package main @@ -196,7 +264,7 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Room.StopEgress(ctx, id) + res, err := s.Stream.Delete(ctx, id) if err != nil { log.Fatal(err) } @@ -204,17 +272,16 @@ actions: // handle response } } - - target: $["paths"]["/room/{id}/user/{userId}"]["put"] + - target: $["paths"]["/room/{id}"]["delete"] update: x-codeSamples: - lang: go - label: updateRoomUser + label: deleteRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -224,15 +291,8 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" - - var userID string = "" - - roomUserUpdatePayload := components.RoomUserUpdatePayload{ - CanPublish: livepeergo.Bool(true), - CanPublishData: livepeergo.Bool(true), - } ctx := context.Background() - res, err := s.Room.UpdateUser(ctx, id, userID, roomUserUpdatePayload) + res, err := s.Room.Delete(ctx, id) if err != nil { log.Fatal(err) } @@ -240,16 +300,17 @@ actions: // handle response } } - - target: $["paths"]["/access-control/signing-key"]["get"] + - target: $["paths"]["/room/{id}/user/{userId}"]["put"] update: x-codeSamples: - lang: go - label: getSigningKeys + label: updateRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -258,21 +319,28 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) + var id string = "" + + var userID string = "" + roomUserUpdatePayload := components.RoomUserUpdatePayload{ + CanPublish: livepeergo.Bool(true), + CanPublishData: livepeergo.Bool(true), + } ctx := context.Background() - res, err := s.AccessControl.GetAll(ctx) + res, err := s.Room.UpdateUser(ctx, id, userID, roomUserUpdatePayload) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/playback/{id}"]["get"] + - target: $["paths"]["/asset/{assetId}"]["get"] update: x-codeSamples: - lang: go - label: getPlaybackInfo + label: getAsset source: |- package main @@ -286,26 +354,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + var assetID string = "" ctx := context.Background() - res, err := s.Playback.Get(ctx, id) + res, err := s.Asset.Get(ctx, assetID) if err != nil { log.Fatal(err) } - if res.PlaybackInfo != nil { + if res.Asset != nil { // handle response } } - - target: $["paths"]["/webhook/{id}"]["delete"] + - target: $["paths"]["/asset/{assetId}"]["patch"] update: x-codeSamples: - lang: go - label: deleteWebhook + label: updateAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -314,26 +383,39 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + var assetID string = "" + + assetPatchPayload := components.AssetPatchPayload{ + Name: livepeergo.String("filename.mp4"), + PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), + Type: components.TypeWebhook, + WebhookContext: map[string]any{ + "streamerId": "my-custom-id", + }, + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), + }, + } ctx := context.Background() - res, err := s.Webhook.Delete(ctx, id) + res, err := s.Asset.Update(ctx, assetID, assetPatchPayload) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res.Asset != nil { // handle response } } - - target: $["paths"]["/room/{id}"]["delete"] + - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] update: x-codeSamples: - lang: go - label: deleteRoom + label: addMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -343,8 +425,18 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + targetAddPayload := components.TargetAddPayload{ + ID: livepeergo.String("PUSH123"), + Profile: "720p0", + Spec: &components.TargetAddPayloadSpec{ + Name: livepeergo.String("My target"), + URL: "rtmps://live.my-service.tv/channel/secretKey", + }, + VideoOnly: livepeergo.Bool(false), + } ctx := context.Background() - res, err := s.Room.Delete(ctx, id) + res, err := s.Stream.AddMultistreamTarget(ctx, id, targetAddPayload) if err != nil { log.Fatal(err) } @@ -380,16 +472,17 @@ actions: // handle response } } - - target: $["paths"]["/multistream/target/{id}"]["delete"] + - target: $["paths"]["/webhook"]["post"] update: x-codeSamples: - lang: go - label: deleteMultistreamTarget + label: createWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -398,21 +491,31 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + request := components.WebhookInput{ + Events: []components.Events{ + components.EventsStreamStarted, + components.EventsStreamIdle, + }, + Name: "test_webhook", + ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), + SharedSecret: livepeergo.String("my-secret"), + StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), + URL: "https://my-service.com/webhook", + } ctx := context.Background() - res, err := s.Multistream.Delete(ctx, id) + res, err := s.Webhook.Create(ctx, request) if err != nil { log.Fatal(err) } - if res != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/session/{id}"]["get"] + - target: $["paths"]["/webhook/{id}"]["get"] update: x-codeSamples: - lang: go - label: getSession + label: getWebhook source: |- package main @@ -428,25 +531,24 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Session.Get(ctx, id) + res, err := s.Webhook.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Session != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/data/views/query/creator"]["get"] + - target: $["paths"]["/stream"]["get"] update: x-codeSamples: - lang: go - label: getCreatorViewershipMetrics + label: getStreams source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -455,9 +557,9 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetCreatorViewershipMetricsRequest{} + var streamsonly *string = livepeergo.String("") ctx := context.Background() - res, err := s.Metrics.GetCreatorViewership(ctx, request) + res, err := s.Stream.GetAll(ctx, streamsonly) if err != nil { log.Fatal(err) } @@ -465,16 +567,17 @@ actions: // handle response } } - - target: $["paths"]["/multistream/target/{id}"]["get"] + - target: $["paths"]["/data/usage/query"]["get"] update: x-codeSamples: - lang: go - label: getMultistreamTarget + label: getUsageMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -483,27 +586,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + request := operations.GetUsageMetricsRequest{} ctx := context.Background() - res, err := s.Multistream.Get(ctx, id) + res, err := s.Metrics.GetUsage(ctx, request) if err != nil { log.Fatal(err) } - if res.MultistreamTarget != nil { + if res.UsageMetric != nil { // handle response } } - - target: $["paths"]["/data/views/query"]["get"] + - target: $["paths"]["/session"]["get"] update: x-codeSamples: - lang: go - label: getViewershipMetrics + label: getSessions source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -512,9 +614,9 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetViewershipMetricsRequest{} + ctx := context.Background() - res, err := s.Metrics.GetViewership(ctx, request) + res, err := s.Session.GetAll(ctx) if err != nil { log.Fatal(err) } @@ -522,17 +624,17 @@ actions: // handle response } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] + - target: $["paths"]["/asset/request-upload"]["post"] update: x-codeSamples: - lang: go - label: updateSigningKey + label: requestUpload source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -541,28 +643,51 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var keyID string = "" - - requestBody := operations.UpdateSigningKeyRequestBody{} + request := components.NewAssetPayload{ + Name: "filename.mp4", + PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), + Type: components.TypeWebhook, + WebhookContext: map[string]any{ + "streamerId": "my-custom-id", + }, + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), + }, + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Bitrate: 3000000, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), + FpsDen: livepeergo.Int64(1), + Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), + }, + }, + StaticMp4: livepeergo.Bool(true), + } ctx := context.Background() - res, err := s.AccessControl.Update(ctx, keyID, requestBody) + res, err := s.Asset.Create(ctx, request) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/task/{taskId}"]["get"] + - target: $["paths"]["/multistream/target"]["post"] update: x-codeSamples: - lang: go - label: getTask + label: createMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -571,26 +696,29 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var taskID string = "" + request := components.MultistreamTargetInput{ + URL: "rtmps://live.my-service.tv/channel/secretKey", + } ctx := context.Background() - res, err := s.Task.Get(ctx, taskID) + res, err := s.Multistream.Create(ctx, request) if err != nil { log.Fatal(err) } - if res.Task != nil { + if res.MultistreamTarget != nil { // handle response } } - - target: $["paths"]["/stream/{id}"]["get"] + - target: $["paths"]["/room/{id}/user"]["post"] update: x-codeSamples: - lang: go - label: getStream + label: createRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -600,20 +728,26 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + roomUserPayload := components.RoomUserPayload{ + CanPublish: livepeergo.Bool(true), + CanPublishData: livepeergo.Bool(true), + Name: "name", + } ctx := context.Background() - res, err := s.Stream.Get(ctx, id) + res, err := s.Room.CreateUser(ctx, id, roomUserPayload) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.RoomUserResponse != nil { // handle response } } - - target: $["paths"]["/stream/{id}"]["delete"] + - target: $["paths"]["/session/{id}"]["get"] update: x-codeSamples: - lang: go - label: deleteStream + label: getSession source: |- package main @@ -629,25 +763,24 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Stream.Delete(ctx, id) + res, err := s.Session.Get(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.Session != nil { // handle response } } - - target: $["paths"]["/multistream/target/{id}"]["patch"] + - target: $["paths"]["/task/{taskId}"]["get"] update: x-codeSamples: - lang: go - label: updateMultistreamTarget + label: getTask source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -656,30 +789,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{ - URL: "rtmps://live.my-service.tv/channel/secretKey", - } + var taskID string = "" ctx := context.Background() - res, err := s.Multistream.Update(ctx, id, multistreamTargetPatchPayload) + res, err := s.Task.Get(ctx, taskID) if err != nil { log.Fatal(err) } - if res != nil { + if res.Task != nil { // handle response } } - - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] + - target: $["paths"]["/webhook/{id}"]["put"] update: x-codeSamples: - lang: go - label: getWebhookLog + label: updateWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -690,27 +820,36 @@ actions: ) var id string = "" - var logID string = "" + webhook := components.WebhookInput{ + Events: []components.Events{ + components.EventsStreamStarted, + components.EventsStreamIdle, + }, + Name: "test_webhook", + ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), + SharedSecret: livepeergo.String("my-secret"), + StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), + URL: "https://my-service.com/webhook", + } ctx := context.Background() - res, err := s.Webhook.GetLog(ctx, id, logID) + res, err := s.Webhook.Update(ctx, id, webhook) if err != nil { log.Fatal(err) } - if res.WebhookLog != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/webhook"]["post"] + - target: $["paths"]["/room/{id}/egress"]["delete"] update: x-codeSamples: - lang: go - label: createWebhook + label: stopRoomEgress source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -719,36 +858,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.WebhookInput{ - Name: "test_webhook", - ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), - Events: []components.Events{ - components.EventsStreamStarted, - components.EventsStreamIdle, - }, - URL: "https://my-service.com/webhook", - SharedSecret: livepeergo.String("my-secret"), - StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), - } + var id string = "" ctx := context.Background() - res, err := s.Webhook.Create(ctx, request) + res, err := s.Room.StopEgress(ctx, id) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res != nil { // handle response } } - - target: $["paths"]["/asset/{assetId}"]["get"] + - target: $["paths"]["/stream/{parentId}/sessions"]["get"] update: x-codeSamples: - lang: go - label: getAsset + label: getRecordedSessions source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -757,21 +887,25 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var assetID string = "" + var parentID string = "" + + var record *operations.Record = operations.CreateRecordBoolean( + true, + ) ctx := context.Background() - res, err := s.Asset.Get(ctx, assetID) + res, err := s.Session.GetRecorded(ctx, parentID, record) if err != nil { log.Fatal(err) } - if res.Asset != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] + - target: $["paths"]["/webhook"]["get"] update: x-codeSamples: - lang: go - label: deleteRoomUser + label: getWebhooks source: |- package main @@ -785,23 +919,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - var userID string = "" ctx := context.Background() - res, err := s.Room.DeleteUser(ctx, id, userID) + res, err := s.Webhook.GetAll(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] + - target: $["paths"]["/playback/{id}"]["get"] update: x-codeSamples: - lang: go - label: deleteSigningKey + label: getPlaybackInfo source: |- package main @@ -815,21 +947,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var keyID string = "" + var id string = "" ctx := context.Background() - res, err := s.AccessControl.Delete(ctx, keyID) + res, err := s.Playback.Get(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.PlaybackInfo != nil { // handle response } } - - target: $["paths"]["/stream/{id}/terminate"]["delete"] + - target: $["paths"]["/room"]["post"] update: x-codeSamples: - lang: go - label: terminateStream + label: createRoom source: |- package main @@ -843,21 +975,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + ctx := context.Background() - res, err := s.Stream.Terminate(ctx, id) + res, err := s.Room.Create(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.CreateRoomResponse != nil { // handle response } } - - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] + - target: $["paths"]["/webhook/{id}/log"]["get"] update: x-codeSamples: - lang: go - label: resendWebhook + label: getWebhookLogs source: |- package main @@ -871,23 +1003,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - var logID string = "" + var id string = "" ctx := context.Background() - res, err := s.Webhook.ResendLog(ctx, id, logID) + res, err := s.Webhook.GetLogs(ctx, id) if err != nil { log.Fatal(err) } - if res.WebhookLog != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/session/{id}/clips"]["get"] + - target: $["paths"]["/asset/{assetId}"]["delete"] update: x-codeSamples: - lang: go - label: getSessionClips + label: deleteAsset source: |- package main @@ -901,27 +1031,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + var assetID string = "" ctx := context.Background() - res, err := s.Session.GetClips(ctx, id) + res, err := s.Asset.Delete(ctx, assetID) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/transcode"]["post"] + - target: $["paths"]["/stream/{id}/clips"]["get"] update: x-codeSamples: - lang: go - label: transcodeVideo + label: getClips source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -930,67 +1059,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.TranscodePayload{ - Input: components.CreateInputInput1( - components.Input1{ - URL: "https://s3.amazonaws.com/bucket/file.mp4", - }, - ), - Storage: components.CreateTranscodePayloadStorageStorage1( - components.Storage1{ - Type: components.StorageTypeS3, - Endpoint: "https://gateway.storjshare.io", - Bucket: "outputbucket", - Credentials: components.StorageCredentials{ - AccessKeyID: "AKIAIOSFODNN7EXAMPLE", - SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", - }, - }, - ), - Outputs: components.Outputs{ - Hls: &components.Hls{ - Path: "/samplevideo/hls", - }, - Mp4: &components.Mp4{ - Path: "/samplevideo/mp4", - }, - Fmp4: &components.Fmp4{ - Path: "/samplevideo/fmp4", - }, - }, - Profiles: []components.TranscodeProfile{ - components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), - Bitrate: 3000000, - Quality: livepeergo.Int64(23), - Fps: livepeergo.Int64(30), - FpsDen: livepeergo.Int64(1), - Gop: livepeergo.String("2"), - Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), - Encoder: components.TranscodeProfileEncoderH264.ToPointer(), - }, - }, - } + var id string = "" ctx := context.Background() - res, err := s.Transcode.Create(ctx, request) + res, err := s.Stream.GetClips(ctx, id) if err != nil { log.Fatal(err) } - if res.Task != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/access-control/signing-key"]["post"] + - target: $["paths"]["/data/views/query/creator"]["get"] update: x-codeSamples: - lang: go - label: createSigningKey + label: getCreatorViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -999,27 +1088,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - + request := operations.GetCreatorViewershipMetricsRequest{} ctx := context.Background() - res, err := s.AccessControl.Create(ctx) + res, err := s.Metrics.GetCreatorViewership(ctx, request) if err != nil { log.Fatal(err) } - if res.SigningKey != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/asset/request-upload"]["post"] + - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] update: x-codeSamples: - lang: go - label: requestUpload + label: getPublicViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1028,33 +1116,9 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.NewAssetPayload{ - Name: "filename.mp4", - StaticMp4: livepeergo.Bool(true), - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.TranscodeProfile{ - components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), - Bitrate: 3000000, - Quality: livepeergo.Int64(23), - Fps: livepeergo.Int64(30), - FpsDen: livepeergo.Int64(1), - Gop: livepeergo.String("2"), - Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), - Encoder: components.TranscodeProfileEncoderH264.ToPointer(), - }, - }, - } + var playbackID string = "" ctx := context.Background() - res, err := s.Asset.Create(ctx, request) + res, err := s.Metrics.GetPublicViewership(ctx, playbackID) if err != nil { log.Fatal(err) } @@ -1062,11 +1126,11 @@ actions: // handle response } } - - target: $["paths"]["/room"]["post"] + - target: $["paths"]["/room/{id}/user/{userId}"]["get"] update: x-codeSamples: - lang: go - label: createRoom + label: getRoomUser source: |- package main @@ -1080,26 +1144,29 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) + var id string = "" + var userID string = "" ctx := context.Background() - res, err := s.Room.Create(ctx) + res, err := s.Room.GetUser(ctx, id, userID) if err != nil { log.Fatal(err) } - if res.CreateRoomResponse != nil { + if res.GetRoomUserResponse != nil { // handle response } } - - target: $["paths"]["/room/{id}/user/{userId}"]["get"] + - target: $["paths"]["/data/views/query"]["get"] update: x-codeSamples: - lang: go - label: getRoomUser + label: getViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1108,23 +1175,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - var userID string = "" + request := operations.GetViewershipMetricsRequest{} ctx := context.Background() - res, err := s.Room.GetUser(ctx, id, userID) + res, err := s.Metrics.GetViewership(ctx, request) if err != nil { log.Fatal(err) } - if res.GetRoomUserResponse != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/stream/{id}/start-pull"]["post"] + - target: $["paths"]["/task"]["get"] update: x-codeSamples: - lang: go - label: startPullStream + label: getTasks source: |- package main @@ -1138,21 +1203,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + ctx := context.Background() - res, err := s.Stream.StartPull(ctx, id) + res, err := s.Task.GetAll(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] + - target: $["paths"]["/webhook/{id}"]["delete"] update: x-codeSamples: - lang: go - label: removeMultistreamTarget + label: deleteWebhook source: |- package main @@ -1167,22 +1232,20 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" - - var targetID string = "" ctx := context.Background() - res, err := s.Stream.RemoveMultistreamTarget(ctx, id, targetID) + res, err := s.Webhook.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] + - target: $["paths"]["/access-control/signing-key"]["post"] update: x-codeSamples: - lang: go - label: getPublicViewershipMetrics + label: createSigningKey source: |- package main @@ -1196,27 +1259,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var playbackID string = "" + ctx := context.Background() - res, err := s.Metrics.GetPublicViewership(ctx, playbackID) + res, err := s.AccessControl.Create(ctx) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.SigningKey != nil { // handle response } } - - target: $["paths"]["/data/usage/query"]["get"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] update: x-codeSamples: - lang: go - label: getUsageMetrics + label: deleteSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1225,13 +1287,13 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetUsageMetricsRequest{} + var keyID string = "" ctx := context.Background() - res, err := s.Metrics.GetUsage(ctx, request) + res, err := s.AccessControl.Delete(ctx, keyID) if err != nil { log.Fatal(err) } - if res.UsageMetric != nil { + if res != nil { // handle response } } @@ -1263,11 +1325,11 @@ actions: // handle response } } - - target: $["paths"]["/task"]["get"] + - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] update: x-codeSamples: - lang: go - label: getTasks + label: resendWebhook source: |- package main @@ -1281,21 +1343,23 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) + var id string = "" + var logID string = "" ctx := context.Background() - res, err := s.Task.GetAll(ctx) + res, err := s.Webhook.ResendLog(ctx, id, logID) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.WebhookLog != nil { // handle response } } - - target: $["paths"]["/stream/{id}/clips"]["get"] + - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] update: x-codeSamples: - lang: go - label: getClips + label: deleteRoomUser source: |- package main @@ -1310,20 +1374,22 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + var userID string = "" ctx := context.Background() - res, err := s.Stream.GetClips(ctx, id) + res, err := s.Room.DeleteUser(ctx, id, userID) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/webhook/{id}"]["get"] + - target: $["paths"]["/session/{id}/clips"]["get"] update: x-codeSamples: - lang: go - label: getWebhook + label: getSessionClips source: |- package main @@ -1339,19 +1405,19 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Webhook.Get(ctx, id) + res, err := s.Session.GetClips(ctx, id) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/webhook/{id}"]["put"] + - target: $["paths"]["/transcode"]["post"] update: x-codeSamples: - lang: go - label: updateWebhook + label: transcodeVideo source: |- package main @@ -1366,53 +1432,54 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - webhook := components.WebhookInput{ - Name: "test_webhook", - ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), - Events: []components.Events{ - components.EventsStreamStarted, - components.EventsStreamIdle, + request := components.TranscodePayload{ + Input: components.CreateInputInput1( + components.Input1{ + URL: "https://s3.amazonaws.com/bucket/file.mp4", + }, + ), + Outputs: components.Outputs{ + Fmp4: &components.Fmp4{ + Path: "/samplevideo/fmp4", + }, + Hls: &components.Hls{ + Path: "/samplevideo/hls", + }, + Mp4: &components.Mp4{ + Path: "/samplevideo/mp4", + }, }, - URL: "https://my-service.com/webhook", - SharedSecret: livepeergo.String("my-secret"), - StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), - } - ctx := context.Background() - res, err := s.Webhook.Update(ctx, id, webhook) - if err != nil { - log.Fatal(err) - } - if res.Webhook != nil { - // handle response + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Bitrate: 3000000, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), + FpsDen: livepeergo.Int64(1), + Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), + }, + }, + Storage: components.CreateTranscodePayloadStorageStorage1( + components.Storage1{ + Bucket: "outputbucket", + Credentials: components.StorageCredentials{ + AccessKeyID: "AKIAIOSFODNN7EXAMPLE", + SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + }, + Endpoint: "https://gateway.storjshare.io", + Type: components.StorageTypeS3, + }, + ), } - } - - target: $["paths"]["/webhook/{id}/log"]["get"] - update: - x-codeSamples: - - lang: go - label: getWebhookLogs - source: |- - package main - - import( - livepeergo "github.com/livepeer/livepeer-go" - "context" - "log" - ) - - func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - var id string = "" ctx := context.Background() - res, err := s.Webhook.GetLogs(ctx, id) + res, err := s.Transcode.Create(ctx, request) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.Task != nil { // handle response } } @@ -1444,17 +1511,16 @@ actions: // handle response } } - - target: $["paths"]["/asset/{assetId}"]["patch"] + - target: $["paths"]["/stream/{id}"]["get"] update: x-codeSamples: - lang: go - label: updateAsset + label: getStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1463,39 +1529,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var assetID string = "" - - assetPatchPayload := components.AssetPatchPayload{ - Name: livepeergo.String("filename.mp4"), - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - } + var id string = "" ctx := context.Background() - res, err := s.Asset.Update(ctx, assetID, assetPatchPayload) + res, err := s.Stream.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Asset != nil { + if res.Stream != nil { // handle response } } - - target: $["paths"]["/stream/{id}"]["patch"] + - target: $["paths"]["/stream/{id}/start-pull"]["post"] update: x-codeSamples: - lang: go - label: updateStream + label: startPullStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1505,46 +1558,8 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" - - streamPatchPayload := components.StreamPatchPayload{ - Record: livepeergo.Bool(false), - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - }, - }, - }, - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 857478, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - } ctx := context.Background() - res, err := s.Stream.Update(ctx, id, streamPatchPayload) + res, err := s.Stream.StartPull(ctx, id) if err != nil { log.Fatal(err) } @@ -1552,17 +1567,16 @@ actions: // handle response } } - - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] + - target: $["paths"]["/stream/{id}/terminate"]["delete"] update: x-codeSamples: - lang: go - label: addMultistreamTarget + label: terminateStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1572,18 +1586,8 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" - - targetAddPayload := components.TargetAddPayload{ - Profile: "720p0", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetAddPayloadSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - } ctx := context.Background() - res, err := s.Stream.AddMultistreamTarget(ctx, id, targetAddPayload) + res, err := s.Stream.Terminate(ctx, id) if err != nil { log.Fatal(err) } @@ -1591,11 +1595,11 @@ actions: // handle response } } - - target: $["paths"]["/webhook"]["get"] + - target: $["paths"]["/multistream/target/{id}"]["get"] update: x-codeSamples: - lang: go - label: getWebhooks + label: getMultistreamTarget source: |- package main @@ -1609,27 +1613,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - + var id string = "" ctx := context.Background() - res, err := s.Webhook.GetAll(ctx) + res, err := s.Multistream.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.MultistreamTarget != nil { // handle response } } - - target: $["paths"]["/stream/{parentId}/sessions"]["get"] + - target: $["paths"]["/room/{id}/egress"]["post"] update: x-codeSamples: - lang: go - label: getRecordedSessions + label: startRoomEgress source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1638,25 +1642,25 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var parentID string = "" + var id string = "" - var record *operations.Record = operations.CreateRecordBoolean( - true, - ) + roomEgressPayload := components.RoomEgressPayload{ + StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", + } ctx := context.Background() - res, err := s.Session.GetRecorded(ctx, parentID, record) + res, err := s.Room.StartEgress(ctx, id, roomEgressPayload) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/room/{id}"]["get"] + - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] update: x-codeSamples: - lang: go - label: getRoom + label: getWebhookLog source: |- package main @@ -1671,26 +1675,28 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + var logID string = "" ctx := context.Background() - res, err := s.Room.Get(ctx, id) + res, err := s.Webhook.GetLog(ctx, id, logID) if err != nil { log.Fatal(err) } - if res.Room != nil { + if res.WebhookLog != nil { // handle response } } - - target: $["paths"]["/room/{id}/egress"]["post"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] update: x-codeSamples: - lang: go - label: startRoomEgress + label: updateSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1699,13 +1705,11 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + var keyID string = "" - roomEgressPayload := components.RoomEgressPayload{ - StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", - } + requestBody := operations.UpdateSigningKeyRequestBody{} ctx := context.Background() - res, err := s.Room.StartEgress(ctx, id, roomEgressPayload) + res, err := s.AccessControl.Update(ctx, keyID, requestBody) if err != nil { log.Fatal(err) } @@ -1713,11 +1717,11 @@ actions: // handle response } } - - target: $["paths"]["/room/{id}/user"]["post"] + - target: $["paths"]["/asset/upload/url"]["post"] update: x-codeSamples: - lang: go - label: createRoomUser + label: uploadAsset source: |- package main @@ -1732,27 +1736,46 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - roomUserPayload := components.RoomUserPayload{ - Name: "name", - CanPublish: livepeergo.Bool(true), - CanPublishData: livepeergo.Bool(true), + request := components.NewAssetFromURLPayload{ + Name: "filename.mp4", + PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), + Type: components.TypeWebhook, + WebhookContext: map[string]any{ + "streamerId": "my-custom-id", + }, + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), + }, + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Bitrate: 3000000, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), + FpsDen: livepeergo.Int64(1), + Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), + }, + }, + StaticMp4: livepeergo.Bool(true), + URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", } ctx := context.Background() - res, err := s.Room.CreateUser(ctx, id, roomUserPayload) + res, err := s.Asset.CreateViaURL(ctx, request) if err != nil { log.Fatal(err) } - if res.RoomUserResponse != nil { + if res.TwoHundredApplicationJSONData != nil { // handle response } } - - target: $["paths"]["/stream"]["get"] + - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] update: x-codeSamples: - lang: go - label: getStreams + label: removeMultistreamTarget source: |- package main @@ -1766,27 +1789,28 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var streamsonly *string = livepeergo.String("") + var id string = "" + + var targetID string = "" ctx := context.Background() - res, err := s.Stream.GetAll(ctx, streamsonly) + res, err := s.Stream.RemoveMultistreamTarget(ctx, id, targetID) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/clip"]["post"] + - target: $["paths"]["/multistream/target/{id}"]["delete"] update: x-codeSamples: - lang: go - label: createClip + label: deleteMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1795,33 +1819,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.ClipPayload{ - PlaybackID: "eaw4nk06ts2d0mzb", - StartTime: 1587667174725, - EndTime: livepeergo.Float64(1587667174725), - Name: livepeergo.String("My Clip"), - SessionID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), - } + var id string = "" ctx := context.Background() - res, err := s.Stream.CreateClip(ctx, request) + res, err := s.Multistream.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/multistream/target"]["post"] + - target: $["paths"]["/room/{id}"]["get"] update: x-codeSamples: - lang: go - label: createMultistreamTarget + label: getRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1830,23 +1847,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.MultistreamTargetInput{ - URL: "rtmps://live.my-service.tv/channel/secretKey", - } + var id string = "" ctx := context.Background() - res, err := s.Multistream.Create(ctx, request) + res, err := s.Room.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.MultistreamTarget != nil { + if res.Room != nil { // handle response } } - - target: $["paths"]["/asset/{assetId}"]["delete"] + - target: $["paths"]["/access-control/signing-key"]["get"] update: x-codeSamples: - lang: go - label: deleteAsset + label: getSigningKeys source: |- package main @@ -1860,13 +1875,13 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var assetID string = "" + ctx := context.Background() - res, err := s.Asset.Delete(ctx, assetID) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } diff --git a/docs/models/components/asset.md b/docs/models/components/asset.md index f5b2818..4cb1193 100644 --- a/docs/models/components/asset.md +++ b/docs/models/components/asset.md @@ -3,23 +3,24 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | N/A | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | -| `Type` | [*components.AssetType](../../models/components/assettype.md) | :heavy_minus_sign: | Type of the asset. | video | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | -| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | -| `PlaybackURL` | **string* | :heavy_minus_sign: | URL for HLS playback. **It is recommended to not use this URL**, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8). | https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8 | -| `DownloadURL` | **string* | :heavy_minus_sign: | The URL to directly download the asset, e.g. `https://livepeercdn.com/asset/eawrrk06ts2d0mzb/video`. It is not recommended to use this for playback. | https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video | -| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | -| `Source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | -| `CreatorID` | [*components.CreatorID](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | -| `Storage` | [*components.AssetStorage](../../models/components/assetstorage.md) | :heavy_minus_sign: | N/A | | -| `Status` | [*components.AssetStatus](../../models/components/assetstatus.md) | :heavy_minus_sign: | Status of the asset | | -| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | -| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | -| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which asset was created | 1587667174725 | -| `CreatedByTokenName` | **string* | :heavy_minus_sign: | Name of the token used to create this object | | -| `Size` | **float64* | :heavy_minus_sign: | Size of the asset in bytes | 84934509 | -| `Hash` | [][components.Hash](../../models/components/hash.md) | :heavy_minus_sign: | Hash of the asset | | -| `VideoSpec` | [*components.VideoSpec](../../models/components/videospec.md) | :heavy_minus_sign: | Video metadata | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which asset was created | 1587667174725 | +| `CreatedByTokenName` | **string* | :heavy_minus_sign: | Name of the token used to create this object | | +| `CreatorID` | [*components.CreatorID](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | +| `DownloadURL` | **string* | :heavy_minus_sign: | The URL to directly download the asset, e.g. `https://livepeercdn.com/asset/eawrrk06ts2d0mzb/video`. It is not recommended to use this for playback. | https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video | +| `Hash` | [][components.Hash](../../models/components/hash.md) | :heavy_minus_sign: | Hash of the asset | | +| `ID` | *string* | :heavy_check_mark: | N/A | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | +| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | +| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | +| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | +| `PlaybackURL` | **string* | :heavy_minus_sign: | URL for HLS playback. **It is recommended to not use this URL**, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8). | https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8 | +| `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | Requested profiles for the asset to be transcoded into. Configured
on the upload APIs payload or through the `stream.recordingSpec`
field for recordings. If not specified, default profiles are derived
based on the source input. If this is a recording, the source will
not be present in this list but will be available for playback.
| | +| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | +| `Size` | **float64* | :heavy_minus_sign: | Size of the asset in bytes | 84934509 | +| `Source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | +| `Status` | [*components.Status](../../models/components/status.md) | :heavy_minus_sign: | Status of the asset | | +| `Storage` | [*components.AssetStorage](../../models/components/assetstorage.md) | :heavy_minus_sign: | N/A | | +| `Type` | [*components.AssetType](../../models/components/assettype.md) | :heavy_minus_sign: | Type of the asset. | video | +| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | +| `VideoSpec` | [*components.VideoSpec](../../models/components/videospec.md) | :heavy_minus_sign: | Video metadata | | \ No newline at end of file diff --git a/docs/models/components/assetipfs.md b/docs/models/components/assetipfs.md index 5289667..1da6a28 100644 --- a/docs/models/components/assetipfs.md +++ b/docs/models/components/assetipfs.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `Spec` | [*components.AssetSpec](../../models/components/assetspec.md) | :heavy_minus_sign: | N/A | | | `DollarRef` | *any* | :heavy_minus_sign: | N/A | | | `NftMetadata` | [*components.IpfsFileInfo](../../models/components/ipfsfileinfo.md) | :heavy_minus_sign: | N/A | | +| `Spec` | [*components.AssetSpec](../../models/components/assetspec.md) | :heavy_minus_sign: | N/A | | | `UpdatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which IPFS export task was
updated
| 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/assetpatchpayload.md b/docs/models/components/assetpatchpayload.md index 82552ac..d527e3f 100644 --- a/docs/models/components/assetpatchpayload.md +++ b/docs/models/components/assetpatchpayload.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Name` | **string* | :heavy_minus_sign: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | | `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | +| `Name` | **string* | :heavy_minus_sign: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | | `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `Storage` | [*components.Storage](../../models/components/storage.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/assetspec.md b/docs/models/components/assetspec.md index 291de83..237573d 100644 --- a/docs/models/components/assetspec.md +++ b/docs/models/components/assetspec.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `NftMetadataTemplate` | [*components.AssetNftMetadataTemplate](../../models/components/assetnftmetadatatemplate.md) | :heavy_minus_sign: | Name of the NFT metadata template to export. 'player'
will embed the Livepeer Player on the NFT while 'file'
will reference only the immutable MP4 files.
| -| `NftMetadata` | [*components.AssetNftMetadata](../../models/components/assetnftmetadata.md) | :heavy_minus_sign: | Additional data to add to the NFT metadata exported to
IPFS. Will be deep merged with the default metadata
exported.
| \ No newline at end of file +| `NftMetadata` | [*components.AssetNftMetadata](../../models/components/assetnftmetadata.md) | :heavy_minus_sign: | Additional data to add to the NFT metadata exported to
IPFS. Will be deep merged with the default metadata
exported.
| +| `NftMetadataTemplate` | [*components.AssetNftMetadataTemplate](../../models/components/assetnftmetadatatemplate.md) | :heavy_minus_sign: | Name of the NFT metadata template to export. 'player'
will embed the Livepeer Player on the NFT while 'file'
will reference only the immutable MP4 files.
| \ No newline at end of file diff --git a/docs/models/components/assetstatus.md b/docs/models/components/assetstatus.md deleted file mode 100644 index c32381a..0000000 --- a/docs/models/components/assetstatus.md +++ /dev/null @@ -1,13 +0,0 @@ -# AssetStatus - -Status of the asset - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `Phase` | [components.AssetPhase](../../models/components/assetphase.md) | :heavy_check_mark: | Phase of the asset | | -| `UpdatedAt` | *float64* | :heavy_check_mark: | Timestamp (in milliseconds) at which the asset was last updated | 1587667174725 | -| `Progress` | **float64* | :heavy_minus_sign: | Current progress of the task creating this asset. | | -| `ErrorMessage` | **string* | :heavy_minus_sign: | Error message if the asset creation failed. | | \ No newline at end of file diff --git a/docs/models/components/attestation.md b/docs/models/components/attestation.md index f2460ae..a4def64 100644 --- a/docs/models/components/attestation.md +++ b/docs/models/components/attestation.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 | -| `PrimaryType` | [components.PrimaryType](../../models/components/primarytype.md) | :heavy_check_mark: | Video Metadata EIP-712 primaryType | VideoAttestation | +| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the object was created | 1587667174725 | | `Domain` | [components.Domain](../../models/components/domain.md) | :heavy_check_mark: | Video Metadata EIP-712 domain | | +| `ID` | **string* | :heavy_minus_sign: | N/A | 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 | | `Message` | [components.Message](../../models/components/message.md) | :heavy_check_mark: | Video Metadata EIP-712 message content | | +| `PrimaryType` | [components.PrimaryType](../../models/components/primarytype.md) | :heavy_check_mark: | Video Metadata EIP-712 primaryType | VideoAttestation | | `Signature` | *string* | :heavy_check_mark: | Video Metadata EIP-712 message signature | 1311768467294899700 | -| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the object was created | 1587667174725 | | `SignatureType` | [*components.SignatureType](../../models/components/signaturetype.md) | :heavy_minus_sign: | N/A | eip712 | | `Storage` | [*components.AttestationStorage](../../models/components/attestationstorage.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/attestations.md b/docs/models/components/attestations.md index 7a1b01e..0406656 100644 --- a/docs/models/components/attestations.md +++ b/docs/models/components/attestations.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| `Role` | *string* | :heavy_check_mark: | N/A | creator | -| `Address` | *string* | :heavy_check_mark: | N/A | 1311768467294899700 | \ No newline at end of file +| `Address` | *string* | :heavy_check_mark: | N/A | 1311768467294899700 | +| `Role` | *string* | :heavy_check_mark: | N/A | creator | \ No newline at end of file diff --git a/docs/models/components/clip.md b/docs/models/components/clip.md index 3cf2e95..97493f5 100644 --- a/docs/models/components/clip.md +++ b/docs/models/components/clip.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `URL` | **string* | :heavy_minus_sign: | URL of the asset to "clip" | https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 | -| `ClipStrategy` | [*components.ClipStrategy](../../models/components/clipstrategy.md) | :heavy_minus_sign: | Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. | | | `CatalystPipelineStrategy` | [*components.CatalystPipelineStrategy](../../models/components/catalystpipelinestrategy.md) | :heavy_minus_sign: | Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. | catalyst_ffmpeg | +| `ClipStrategy` | [*components.ClipStrategy](../../models/components/clipstrategy.md) | :heavy_minus_sign: | Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. | | +| `InputID` | **string* | :heavy_minus_sign: | ID of the input asset or stream | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `SessionID` | **string* | :heavy_minus_sign: | ID of the session | d32ae9e6-c459-4931-9898-e86e2f5e7e16 | -| `InputID` | **string* | :heavy_minus_sign: | ID of the input asset or stream | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | \ No newline at end of file +| `URL` | **string* | :heavy_minus_sign: | URL of the asset to "clip" | https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 | \ No newline at end of file diff --git a/docs/models/components/clippayload.md b/docs/models/components/clippayload.md index bb1c8cd..5d4ba52 100644 --- a/docs/models/components/clippayload.md +++ b/docs/models/components/clippayload.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `PlaybackID` | *string* | :heavy_check_mark: | The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. | eaw4nk06ts2d0mzb | -| `StartTime` | *float64* | :heavy_check_mark: | The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ | 1587667174725 | | `EndTime` | **float64* | :heavy_minus_sign: | The end timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ | 1587667174725 | | `Name` | **string* | :heavy_minus_sign: | The optional friendly name of the clip to create. | My Clip | -| `SessionID` | **string* | :heavy_minus_sign: | The optional session ID of the stream to clip. This can be used to clip _recordings_ - if it is not specified, it will clip the ongoing livestream. | de7818e7-610a-4057-8f6f-b785dc1e6f88 | \ No newline at end of file +| `PlaybackID` | *string* | :heavy_check_mark: | The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. | eaw4nk06ts2d0mzb | +| `SessionID` | **string* | :heavy_minus_sign: | The optional session ID of the stream to clip. This can be used to clip _recordings_ - if it is not specified, it will clip the ongoing livestream. | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `StartTime` | *float64* | :heavy_check_mark: | The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ | 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/clipstrategy.md b/docs/models/components/clipstrategy.md index 8d882f5..94935d6 100644 --- a/docs/models/components/clipstrategy.md +++ b/docs/models/components/clipstrategy.md @@ -7,6 +7,6 @@ Strategy to use for clipping the asset. If not specified, the default strategy t | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `StartTime` | **float64* | :heavy_minus_sign: | The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ | 1587667174725 | | `EndTime` | **float64* | :heavy_minus_sign: | The end timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ | 1587667174725 | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. | eaw4nk06ts2d0mzb | \ No newline at end of file +| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. | eaw4nk06ts2d0mzb | +| `StartTime` | **float64* | :heavy_minus_sign: | The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ | 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/custom.md b/docs/models/components/custom.md index f0c8c73..c6270c1 100644 --- a/docs/models/components/custom.md +++ b/docs/models/components/custom.md @@ -7,6 +7,6 @@ custom URL parameters for the export task | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `URL` | *string* | :heavy_check_mark: | URL where to export the asset | https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB | +| `Headers` | map[string]*string* | :heavy_minus_sign: | Headers to add to the export request | | | `Method` | **string* | :heavy_minus_sign: | Method to use on the export request | POST | -| `Headers` | map[string]*string* | :heavy_minus_sign: | Headers to add to the export request | | \ No newline at end of file +| `URL` | *string* | :heavy_check_mark: | URL where to export the asset | https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB | \ No newline at end of file diff --git a/docs/models/components/dvrplayback.md b/docs/models/components/dvrplayback.md index 78a259e..1b55427 100644 --- a/docs/models/components/dvrplayback.md +++ b/docs/models/components/dvrplayback.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `Hrn` | [*components.PlaybackInfoHrn](../../models/components/playbackinfohrn.md) | :heavy_minus_sign: | N/A | MP4 | +| `Error` | **string* | :heavy_minus_sign: | N/A | | +| `Hrn` | [*components.Hrn](../../models/components/hrn.md) | :heavy_minus_sign: | N/A | MP4 | | `Type` | [*components.PlaybackInfoMetaDvrPlaybackType](../../models/components/playbackinfometadvrplaybacktype.md) | :heavy_minus_sign: | N/A | html5/video/mp4 | -| `URL` | **string* | :heavy_minus_sign: | N/A | https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 | -| `Error` | **string* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `URL` | **string* | :heavy_minus_sign: | N/A | https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 | \ No newline at end of file diff --git a/docs/models/components/encoder.md b/docs/models/components/encoder.md index 22701d9..cab5956 100644 --- a/docs/models/components/encoder.md +++ b/docs/models/components/encoder.md @@ -5,4 +5,7 @@ | Name | Value | | ------------- | ------------- | -| `EncoderH264` | H.264 | \ No newline at end of file +| `EncoderH264` | H.264 | +| `EncoderHevc` | HEVC | +| `EncoderVp8` | VP8 | +| `EncoderVp9` | VP9 | \ No newline at end of file diff --git a/docs/models/components/ffmpegprofile.md b/docs/models/components/ffmpegprofile.md index 619e2ab..d41aaad 100644 --- a/docs/models/components/ffmpegprofile.md +++ b/docs/models/components/ffmpegprofile.md @@ -7,13 +7,13 @@ Transcode profile | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Width` | *int64* | :heavy_check_mark: | N/A | 1280 | -| `Name` | *string* | :heavy_check_mark: | N/A | 720p | -| `Height` | *int64* | :heavy_check_mark: | N/A | | | `Bitrate` | *int64* | :heavy_check_mark: | N/A | 3000000 | +| `Encoder` | [*components.FfmpegProfileEncoder](../../models/components/ffmpegprofileencoder.md) | :heavy_minus_sign: | N/A | | | `Fps` | *int64* | :heavy_check_mark: | N/A | 30 | | `FpsDen` | **int64* | :heavy_minus_sign: | N/A | 1 | -| `Quality` | **int64* | :heavy_minus_sign: | Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
| 23 | | `Gop` | **string* | :heavy_minus_sign: | N/A | 2 | -| `Profile` | [*components.Profile](../../models/components/profile.md) | :heavy_minus_sign: | N/A | H264Baseline | -| `Encoder` | [*components.Encoder](../../models/components/encoder.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `Height` | *int64* | :heavy_check_mark: | N/A | | +| `Name` | *string* | :heavy_check_mark: | N/A | 720p | +| `Profile` | [*components.FfmpegProfileProfile](../../models/components/ffmpegprofileprofile.md) | :heavy_minus_sign: | N/A | H264Baseline | +| `Quality` | **int64* | :heavy_minus_sign: | Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
| 23 | +| `Width` | *int64* | :heavy_check_mark: | N/A | 1280 | \ No newline at end of file diff --git a/docs/models/components/ffmpegprofileencoder.md b/docs/models/components/ffmpegprofileencoder.md new file mode 100644 index 0000000..4876c7b --- /dev/null +++ b/docs/models/components/ffmpegprofileencoder.md @@ -0,0 +1,8 @@ +# FfmpegProfileEncoder + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `FfmpegProfileEncoderH264` | H.264 | \ No newline at end of file diff --git a/docs/models/components/ffmpegprofileprofile.md b/docs/models/components/ffmpegprofileprofile.md new file mode 100644 index 0000000..8524cb9 --- /dev/null +++ b/docs/models/components/ffmpegprofileprofile.md @@ -0,0 +1,11 @@ +# FfmpegProfileProfile + + +## Values + +| Name | Value | +| ----------------------------------------- | ----------------------------------------- | +| `FfmpegProfileProfileH264Baseline` | H264Baseline | +| `FfmpegProfileProfileH264Main` | H264Main | +| `FfmpegProfileProfileH264High` | H264High | +| `FfmpegProfileProfileH264ConstrainedHigh` | H264ConstrainedHigh | \ No newline at end of file diff --git a/docs/models/components/getroomuserresponse.md b/docs/models/components/getroomuserresponse.md index 2e481e4..7ad2e24 100644 --- a/docs/models/components/getroomuserresponse.md +++ b/docs/models/components/getroomuserresponse.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | | `ID` | **string* | :heavy_minus_sign: | The ID of the user | d32ae9e6-c459-4931-9898-e86e2f5e7e16 | -| `JoinedAt` | **int64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the user joined | 1687517025261 | -| `Name` | **string* | :heavy_minus_sign: | The display name of the user | name | | `IsPublisher` | **bool* | :heavy_minus_sign: | Whether a user is allowed to publish audio/video tracks | true | -| `Metadata` | **string* | :heavy_minus_sign: | User defined payload to store for the participant | | \ No newline at end of file +| `JoinedAt` | **int64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the user joined | 1687517025261 | +| `Metadata` | **string* | :heavy_minus_sign: | User defined payload to store for the participant | | +| `Name` | **string* | :heavy_minus_sign: | The display name of the user | name | \ No newline at end of file diff --git a/docs/models/components/hash.md b/docs/models/components/hash.md index 8db3b69..a133c30 100644 --- a/docs/models/components/hash.md +++ b/docs/models/components/hash.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `Hash` | **string* | :heavy_minus_sign: | Hash of the asset | 9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57 | -| `Algorithm` | **string* | :heavy_minus_sign: | Hash algorithm used to compute the hash | sha256 | \ No newline at end of file +| `Algorithm` | **string* | :heavy_minus_sign: | Hash algorithm used to compute the hash | sha256 | +| `Hash` | **string* | :heavy_minus_sign: | Hash of the asset | 9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57 | \ No newline at end of file diff --git a/docs/models/components/hrn.md b/docs/models/components/hrn.md index 257a101..a7c2bf4 100644 --- a/docs/models/components/hrn.md +++ b/docs/models/components/hrn.md @@ -1,15 +1,8 @@ # Hrn -Human Readable Name - ## Values -| Name | Value | -| ------------------ | ------------------ | -| `HrnHlsTs` | HLS (TS) | -| `HrnMp4` | MP4 | -| `HrnWebRtcH264` | WebRTC (H264) | -| `HrnFlvH264` | FLV (H264) | -| `HrnThumbnailJpeg` | Thumbnail (JPEG) | -| `HrnThumbnails` | Thumbnails | \ No newline at end of file +| Name | Value | +| ---------- | ---------- | +| `HrnHlsTs` | HLS (TS) | \ No newline at end of file diff --git a/docs/models/components/input2.md b/docs/models/components/input2.md index d158d9a..3aab64f 100644 --- a/docs/models/components/input2.md +++ b/docs/models/components/input2.md @@ -7,8 +7,8 @@ S3-like storage input video | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Type` | [components.InputType](../../models/components/inputtype.md) | :heavy_check_mark: | Type of service. This is optional and defaults to `url` if
ÅšURL field is provided.
| | -| `Endpoint` | *string* | :heavy_check_mark: | Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) | https://gateway.storjshare.io | | `Bucket` | *string* | :heavy_check_mark: | Bucket with input file | inputbucket | +| `Credentials` | [components.Credentials](../../models/components/credentials.md) | :heavy_check_mark: | Credentials for the private input video storage | | +| `Endpoint` | *string* | :heavy_check_mark: | Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) | https://gateway.storjshare.io | | `Path` | *string* | :heavy_check_mark: | Path to the input file inside the bucket | /path/file.mp4 | -| `Credentials` | [components.Credentials](../../models/components/credentials.md) | :heavy_check_mark: | Credentials for the private input video storage | | \ No newline at end of file +| `Type` | [components.InputType](../../models/components/inputtype.md) | :heavy_check_mark: | Type of service. This is optional and defaults to `url` if
ÅšURL field is provided.
| | \ No newline at end of file diff --git a/docs/models/components/ipfs.md b/docs/models/components/ipfs.md index a4da3cf..17f03aa 100644 --- a/docs/models/components/ipfs.md +++ b/docs/models/components/ipfs.md @@ -8,10 +8,10 @@ means to unpin from IPFS, but it's unsupported right now. ## Supported Types -### Ipfs1 +### One ```go -ipfs := components.CreateIpfsIpfs1(components.Ipfs1{/* values here */}) +ipfs := components.CreateIpfsOne(components.One{/* values here */}) ``` ### diff --git a/docs/models/components/ipfsfileinfo.md b/docs/models/components/ipfsfileinfo.md index fd28a5a..c8a1568 100644 --- a/docs/models/components/ipfsfileinfo.md +++ b/docs/models/components/ipfsfileinfo.md @@ -6,5 +6,5 @@ | Field | Type | Required | Description | | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | | `Cid` | *string* | :heavy_check_mark: | CID of the file on IPFS | -| `URL` | **string* | :heavy_minus_sign: | URL with IPFS scheme for the file | -| `GatewayURL` | **string* | :heavy_minus_sign: | URL to access file via HTTP through an IPFS gateway | \ No newline at end of file +| `GatewayURL` | **string* | :heavy_minus_sign: | URL to access file via HTTP through an IPFS gateway | +| `URL` | **string* | :heavy_minus_sign: | URL with IPFS scheme for the file | \ No newline at end of file diff --git a/docs/models/components/ismobile.md b/docs/models/components/ismobile.md index 39cd340..21abd63 100644 --- a/docs/models/components/ismobile.md +++ b/docs/models/components/ismobile.md @@ -5,10 +5,10 @@ Indicates whether the stream will be pulled from a mobile source. ## Supported Types -### One +### IsMobile1 ```go -isMobile := components.CreateIsMobileOne(components.One{/* values here */}) +isMobile := components.CreateIsMobileIsMobile1(components.IsMobile1{/* values here */}) ``` ### diff --git a/docs/models/components/lastfailure.md b/docs/models/components/lastfailure.md index 6629cb1..11b9c8b 100644 --- a/docs/models/components/lastfailure.md +++ b/docs/models/components/lastfailure.md @@ -7,7 +7,7 @@ failure timestamp and error message with status code | Field | Type | Required | Description | Example | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `Timestamp` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the webhook last failed | 1587667174725 | | `Error` | **string* | :heavy_minus_sign: | Webhook failure error message | Error message | | `Response` | **string* | :heavy_minus_sign: | Webhook failure response | Response body | -| `StatusCode` | **float64* | :heavy_minus_sign: | Webhook failure status code | 500 | \ No newline at end of file +| `StatusCode` | **float64* | :heavy_minus_sign: | Webhook failure status code | 500 | +| `Timestamp` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the webhook last failed | 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/message.md b/docs/models/components/message.md index 85bb50b..a459a7b 100644 --- a/docs/models/components/message.md +++ b/docs/models/components/message.md @@ -7,7 +7,7 @@ Video Metadata EIP-712 message content | Field | Type | Required | Description | Example | | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `Video` | *string* | :heavy_check_mark: | N/A | 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 | | `Attestations` | [][components.Attestations](../../models/components/attestations.md) | :heavy_check_mark: | N/A | | | `Signer` | *string* | :heavy_check_mark: | N/A | 1311768467294899700 | -| `Timestamp` | *float64* | :heavy_check_mark: | N/A | 1587667174725 | \ No newline at end of file +| `Timestamp` | *float64* | :heavy_check_mark: | N/A | 1587667174725 | +| `Video` | *string* | :heavy_check_mark: | N/A | 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 | \ No newline at end of file diff --git a/docs/models/components/meta.md b/docs/models/components/meta.md index 04c971e..3bc1ec6 100644 --- a/docs/models/components/meta.md +++ b/docs/models/components/meta.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Attestation` | [*components.Attestation](../../models/components/attestation.md) | :heavy_minus_sign: | N/A | | +| `DvrPlayback` | [][components.DvrPlayback](../../models/components/dvrplayback.md) | :heavy_minus_sign: | N/A | | | `Live` | [*components.Live](../../models/components/live.md) | :heavy_minus_sign: | N/A | 0 | | `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | -| `Source` | [][components.PlaybackInfoSource](../../models/components/playbackinfosource.md) | :heavy_check_mark: | N/A | | -| `DvrPlayback` | [][components.DvrPlayback](../../models/components/dvrplayback.md) | :heavy_minus_sign: | N/A | | -| `Attestation` | [*components.Attestation](../../models/components/attestation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `Source` | [][components.PlaybackInfoSource](../../models/components/playbackinfosource.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/multistreamtarget.md b/docs/models/components/multistreamtarget.md index 776904e..ae110b1 100644 --- a/docs/models/components/multistreamtarget.md +++ b/docs/models/components/multistreamtarget.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which multistream target object was
created
| 1587667174725 | +| `Disabled` | **bool* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | | `ID` | **string* | :heavy_minus_sign: | N/A | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `Name` | **string* | :heavy_minus_sign: | N/A | | -| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | -| `Disabled` | **bool* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | -| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which multistream target object was
created
| 1587667174725 | \ No newline at end of file +| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | \ No newline at end of file diff --git a/docs/models/components/multistreamtargetinput.md b/docs/models/components/multistreamtargetinput.md index cdfc163..b310eef 100644 --- a/docs/models/components/multistreamtargetinput.md +++ b/docs/models/components/multistreamtargetinput.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `Disabled` | **bool* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | | `Name` | **string* | :heavy_minus_sign: | N/A | | -| `URL` | *string* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | -| `Disabled` | **bool* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | \ No newline at end of file +| `URL` | *string* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | \ No newline at end of file diff --git a/docs/models/components/multistreamtargetpatchpayload.md b/docs/models/components/multistreamtargetpatchpayload.md index 9c50174..7b0b799 100644 --- a/docs/models/components/multistreamtargetpatchpayload.md +++ b/docs/models/components/multistreamtargetpatchpayload.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `Disabled` | **bool* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | | `Name` | **string* | :heavy_minus_sign: | N/A | | -| `URL` | *string* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | -| `Disabled` | **bool* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | \ No newline at end of file +| `URL` | *string* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | \ No newline at end of file diff --git a/docs/models/components/newassetfromurlpayload.md b/docs/models/components/newassetfromurlpayload.md index 3f1a16b..4c0e59b 100644 --- a/docs/models/components/newassetfromurlpayload.md +++ b/docs/models/components/newassetfromurlpayload.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | -| `StaticMp4` | **bool* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | true | -| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | +| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | | | `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | -| `Storage` | [*components.Storage](../../models/components/storage.md) | :heavy_minus_sign: | N/A | | -| `URL` | *string* | :heavy_check_mark: | URL where the asset contents can be retrieved, e.g. `https://s3.amazonaws.com/my-bucket/path/filename.mp4`.
For an IPFS source, this should be similar to: `ipfs://{CID}`. For an Arweave
source: `ar://{CID}`.
| https://s3.amazonaws.com/my-bucket/path/filename.mp4 | | `Encryption` | [*components.Encryption](../../models/components/encryption.md) | :heavy_minus_sign: | N/A | | -| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | | +| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | +| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | | -| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | | \ No newline at end of file +| `StaticMp4` | **bool* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | true | +| `Storage` | [*components.Storage](../../models/components/storage.md) | :heavy_minus_sign: | N/A | | +| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | | +| `URL` | *string* | :heavy_check_mark: | URL where the asset contents can be retrieved, e.g. `https://s3.amazonaws.com/my-bucket/path/filename.mp4`.
For an IPFS source, this should be similar to: `ipfs://{CID}`. For an Arweave
source: `ar://{CID}`.
| https://s3.amazonaws.com/my-bucket/path/filename.mp4 | \ No newline at end of file diff --git a/docs/models/components/newassetpayload.md b/docs/models/components/newassetpayload.md index de22751..8840931 100644 --- a/docs/models/components/newassetpayload.md +++ b/docs/models/components/newassetpayload.md @@ -5,12 +5,12 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | -| `StaticMp4` | **bool* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | true | -| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | +| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | | | `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | -| `Storage` | [*components.NewAssetPayloadStorage](../../models/components/newassetpayloadstorage.md) | :heavy_minus_sign: | N/A | | | `Encryption` | [*components.NewAssetPayloadEncryption](../../models/components/newassetpayloadencryption.md) | :heavy_minus_sign: | N/A | | -| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | | +| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | +| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | | +| `StaticMp4` | **bool* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | true | +| `Storage` | [*components.NewAssetPayloadStorage](../../models/components/newassetpayloadstorage.md) | :heavy_minus_sign: | N/A | | | `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | | \ No newline at end of file diff --git a/docs/models/components/newassetpayloadipfs.md b/docs/models/components/newassetpayloadipfs.md index 8402829..3112a10 100644 --- a/docs/models/components/newassetpayloadipfs.md +++ b/docs/models/components/newassetpayloadipfs.md @@ -8,10 +8,10 @@ means to unpin from IPFS, but it's unsupported right now. ## Supported Types -### NewAssetPayloadIpfs1 +### Ipfs1 ```go -newAssetPayloadIpfs := components.CreateNewAssetPayloadIpfsNewAssetPayloadIpfs1(components.NewAssetPayloadIpfs1{/* values here */}) +newAssetPayloadIpfs := components.CreateNewAssetPayloadIpfsIpfs1(components.Ipfs1{/* values here */}) ``` ### diff --git a/docs/models/components/newassetpayloadipfs1.md b/docs/models/components/newassetpayloadipfs1.md deleted file mode 100644 index 0869f49..0000000 --- a/docs/models/components/newassetpayloadipfs1.md +++ /dev/null @@ -1,8 +0,0 @@ -# NewAssetPayloadIpfs1 - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `Spec` | [*components.Spec](../../models/components/spec.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/newstreampayload.md b/docs/models/components/newstreampayload.md index 920b0f1..3250f78 100644 --- a/docs/models/components/newstreampayload.md +++ b/docs/models/components/newstreampayload.md @@ -5,12 +5,12 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Name` | *string* | :heavy_check_mark: | N/A | test_stream | -| `Pull` | [*components.Pull](../../models/components/pull.md) | :heavy_minus_sign: | Configuration for a stream that should be actively pulled from an
external source, rather than pushed to Livepeer. If specified, the
stream will not have a streamKey. | | | `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | +| `Multistream` | [*components.Multistream](../../models/components/multistream.md) | :heavy_minus_sign: | N/A | | +| `Name` | *string* | :heavy_check_mark: | N/A | test_stream | | `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_check_mark: | N/A | | +| `Pull` | [*components.Pull](../../models/components/pull.md) | :heavy_minus_sign: | Configuration for a stream that should be actively pulled from an
external source, rather than pushed to Livepeer. If specified, the
stream will not have a streamKey. | | | `Record` | **bool* | :heavy_minus_sign: | Should this stream be recorded? Uses default settings. For more
customization, create and configure an object store.
| false | -| `RecordingSpec` | [*components.RecordingSpec](../../models/components/recordingspec.md) | :heavy_minus_sign: | Configuration for recording the stream. This can only be set if
`record` is true.
| | -| `Multistream` | [*components.Multistream](../../models/components/multistream.md) | :heavy_minus_sign: | N/A | | +| `RecordingSpec` | [*components.NewStreamPayloadRecordingSpec](../../models/components/newstreampayloadrecordingspec.md) | :heavy_minus_sign: | N/A | | | `UserTags` | map[string][components.UserTags](../../models/components/usertags.md) | :heavy_minus_sign: | User input tags associated with the stream | | \ No newline at end of file diff --git a/docs/models/components/newstreampayloadrecordingspec.md b/docs/models/components/newstreampayloadrecordingspec.md new file mode 100644 index 0000000..7a580cc --- /dev/null +++ b/docs/models/components/newstreampayloadrecordingspec.md @@ -0,0 +1,8 @@ +# NewStreamPayloadRecordingSpec + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/one.md b/docs/models/components/one.md index e584627..920087b 100644 --- a/docs/models/components/one.md +++ b/docs/models/components/one.md @@ -1,12 +1,8 @@ # One -0: not mobile, 1: mobile screen share, 2: mobile camera. +## Fields -## Values - -| Name | Value | -| --------- | --------- | -| `OneZero` | 0 | -| `OneOne` | 1 | -| `OneTwo` | 2 | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Spec` | [*components.Spec](../../models/components/spec.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/output.md b/docs/models/components/output.md index ec4a64f..f0f9400 100644 --- a/docs/models/components/output.md +++ b/docs/models/components/output.md @@ -7,6 +7,6 @@ Output of the task | Field | Type | Required | Description | | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `Upload` | [*components.TaskUpload](../../models/components/taskupload.md) | :heavy_minus_sign: | Output of the upload task | | `Export` | [*components.Export](../../models/components/export.md) | :heavy_minus_sign: | Output of the export task | -| `ExportData` | [*components.ExportData](../../models/components/exportdata.md) | :heavy_minus_sign: | Output of the export data task | \ No newline at end of file +| `ExportData` | [*components.ExportData](../../models/components/exportdata.md) | :heavy_minus_sign: | Output of the export data task | +| `Upload` | [*components.Upload](../../models/components/upload.md) | :heavy_minus_sign: | Output of the upload task | \ No newline at end of file diff --git a/docs/models/components/outputs.md b/docs/models/components/outputs.md index 848f355..b00cce5 100644 --- a/docs/models/components/outputs.md +++ b/docs/models/components/outputs.md @@ -7,6 +7,6 @@ Output formats | Field | Type | Required | Description | | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +| `Fmp4` | [*components.Fmp4](../../models/components/fmp4.md) | :heavy_minus_sign: | FMP4 output format | | `Hls` | [*components.Hls](../../models/components/hls.md) | :heavy_minus_sign: | HLS output format | -| `Mp4` | [*components.Mp4](../../models/components/mp4.md) | :heavy_minus_sign: | MP4 output format | -| `Fmp4` | [*components.Fmp4](../../models/components/fmp4.md) | :heavy_minus_sign: | FMP4 output format | \ No newline at end of file +| `Mp4` | [*components.Mp4](../../models/components/mp4.md) | :heavy_minus_sign: | MP4 output format | \ No newline at end of file diff --git a/docs/models/components/params.md b/docs/models/components/params.md index b60a98f..8314efc 100644 --- a/docs/models/components/params.md +++ b/docs/models/components/params.md @@ -7,8 +7,8 @@ Parameters of the task | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Upload` | [*components.Upload](../../models/components/upload.md) | :heavy_minus_sign: | Parameters for the upload task | +| `Clip` | [*components.Clip](../../models/components/clip.md) | :heavy_minus_sign: | N/A | | `Export` | [*components.ExportTaskParams](../../models/components/exporttaskparams.md) | :heavy_minus_sign: | Parameters for the export task | | `ExportData` | [*components.TaskExportData](../../models/components/taskexportdata.md) | :heavy_minus_sign: | Parameters for the export-data task | | `TranscodeFile` | [*components.TranscodeFile](../../models/components/transcodefile.md) | :heavy_minus_sign: | Parameters for the transcode-file task | -| `Clip` | [*components.Clip](../../models/components/clip.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Upload` | [*components.TaskUpload](../../models/components/taskupload.md) | :heavy_minus_sign: | Parameters for the upload task | \ No newline at end of file diff --git a/docs/models/components/participants.md b/docs/models/components/participants.md index 066297f..33ca192 100644 --- a/docs/models/components/participants.md +++ b/docs/models/components/participants.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | | `Identity` | **string* | :heavy_minus_sign: | participant ID | -| `Name` | **string* | :heavy_minus_sign: | user defined participant name | | `JoinedAt` | **int64* | :heavy_minus_sign: | the time the participant joined | -| `LeftAt` | **int64* | :heavy_minus_sign: | the time the participant left | \ No newline at end of file +| `LeftAt` | **int64* | :heavy_minus_sign: | the time the participant left | +| `Name` | **string* | :heavy_minus_sign: | user defined participant name | \ No newline at end of file diff --git a/docs/models/components/playbackinfo.md b/docs/models/components/playbackinfo.md index a74cda9..593e488 100644 --- a/docs/models/components/playbackinfo.md +++ b/docs/models/components/playbackinfo.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `Type` | [components.PlaybackInfoType](../../models/components/playbackinfotype.md) | :heavy_check_mark: | N/A | vod | -| `Meta` | [components.Meta](../../models/components/meta.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `Meta` | [components.Meta](../../models/components/meta.md) | :heavy_check_mark: | N/A | | +| `Type` | [components.PlaybackInfoType](../../models/components/playbackinfotype.md) | :heavy_check_mark: | N/A | vod | \ No newline at end of file diff --git a/docs/models/components/playbackinfohrn.md b/docs/models/components/playbackinfohrn.md index 599c09d..cdbc66d 100644 --- a/docs/models/components/playbackinfohrn.md +++ b/docs/models/components/playbackinfohrn.md @@ -1,8 +1,15 @@ # PlaybackInfoHrn +Human Readable Name + ## Values -| Name | Value | -| ---------------------- | ---------------------- | -| `PlaybackInfoHrnHlsTs` | HLS (TS) | \ No newline at end of file +| Name | Value | +| ------------------------------ | ------------------------------ | +| `PlaybackInfoHrnHlsTs` | HLS (TS) | +| `PlaybackInfoHrnMp4` | MP4 | +| `PlaybackInfoHrnWebRtcH264` | WebRTC (H264) | +| `PlaybackInfoHrnFlvH264` | FLV (H264) | +| `PlaybackInfoHrnThumbnailJpeg` | Thumbnail (JPEG) | +| `PlaybackInfoHrnThumbnails` | Thumbnails | \ No newline at end of file diff --git a/docs/models/components/playbackinfosource.md b/docs/models/components/playbackinfosource.md index 36c022a..179db55 100644 --- a/docs/models/components/playbackinfosource.md +++ b/docs/models/components/playbackinfosource.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| `Hrn` | [components.Hrn](../../models/components/hrn.md) | :heavy_check_mark: | Human Readable Name | MP4 | +| `Bitrate` | **float64* | :heavy_minus_sign: | N/A | 449890 | +| `Height` | **float64* | :heavy_minus_sign: | N/A | 360 | +| `Hrn` | [components.PlaybackInfoHrn](../../models/components/playbackinfohrn.md) | :heavy_check_mark: | Human Readable Name | MP4 | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 494778 | | `Type` | [components.PlaybackInfoMetaType](../../models/components/playbackinfometatype.md) | :heavy_check_mark: | N/A | html5/video/mp4 | | `URL` | *string* | :heavy_check_mark: | N/A | https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4 | -| `Size` | **float64* | :heavy_minus_sign: | N/A | 494778 | -| `Width` | **float64* | :heavy_minus_sign: | N/A | 204 | -| `Height` | **float64* | :heavy_minus_sign: | N/A | 360 | -| `Bitrate` | **float64* | :heavy_minus_sign: | N/A | 449890 | \ No newline at end of file +| `Width` | **float64* | :heavy_minus_sign: | N/A | 204 | \ No newline at end of file diff --git a/docs/models/components/playbackpolicy.md b/docs/models/components/playbackpolicy.md index e61cc46..0dbb66f 100644 --- a/docs/models/components/playbackpolicy.md +++ b/docs/models/components/playbackpolicy.md @@ -7,8 +7,8 @@ Whether the playback policy for an asset or stream is public or signed | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `AllowedOrigins` | []*string* | :heavy_minus_sign: | List of allowed origins for CORS playback (://:, ://) | | +| `RefreshInterval` | **float64* | :heavy_minus_sign: | Interval (in seconds) at which the playback policy should be
refreshed (default 600 seconds)
| 600 | | `Type` | [components.Type](../../models/components/type.md) | :heavy_check_mark: | N/A | webhook | -| `WebhookID` | **string* | :heavy_minus_sign: | ID of the webhook to use for playback policy | 1bde4o2i6xycudoy | | `WebhookContext` | map[string]*any* | :heavy_minus_sign: | User-defined webhook context | {
"streamerId": "my-custom-id"
} | -| `RefreshInterval` | **float64* | :heavy_minus_sign: | Interval (in seconds) at which the playback policy should be
refreshed (default 600 seconds)
| 600 | -| `AllowedOrigins` | []*string* | :heavy_minus_sign: | List of allowed origins for CORS playback (://:, ://) | | \ No newline at end of file +| `WebhookID` | **string* | :heavy_minus_sign: | ID of the webhook to use for playback policy | 1bde4o2i6xycudoy | \ No newline at end of file diff --git a/docs/models/components/pull.md b/docs/models/components/pull.md index a9e0ec5..e51a51e 100644 --- a/docs/models/components/pull.md +++ b/docs/models/components/pull.md @@ -9,7 +9,7 @@ stream will not have a streamKey. | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `Source` | *string* | :heavy_check_mark: | URL from which to pull from. | https://myservice.com/live/stream.flv | | `Headers` | map[string]*string* | :heavy_minus_sign: | Headers to be sent with the request to the pull source. | {
"Authorization": "Bearer 123"
} | | `IsMobile` | [*components.IsMobile](../../models/components/ismobile.md) | :heavy_minus_sign: | Indicates whether the stream will be pulled from a mobile source. | | -| `Location` | [*components.Location](../../models/components/location.md) | :heavy_minus_sign: | Approximate location of the pull source. The location is used to
determine the closest Livepeer region to pull the stream from. | | \ No newline at end of file +| `Location` | [*components.Location](../../models/components/location.md) | :heavy_minus_sign: | Approximate location of the pull source. The location is used to
determine the closest Livepeer region to pull the stream from. | | +| `Source` | *string* | :heavy_check_mark: | URL from which to pull from. | https://myservice.com/live/stream.flv | \ No newline at end of file diff --git a/docs/models/components/recordingspec.md b/docs/models/components/recordingspec.md index 2050549..ef1778a 100644 --- a/docs/models/components/recordingspec.md +++ b/docs/models/components/recordingspec.md @@ -7,6 +7,6 @@ Configuration for recording the stream. This can only be set if ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | Profiles to record the stream in. If not specified, the stream
will be recorded in the same profiles as the stream itself. Keep
in mind that the source rendition will always be recorded.
| \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | Profiles to process the recording of this stream into. If not
specified, default profiles will be derived based on the stream
input. Keep in mind that the source rendition is always kept.
| \ No newline at end of file diff --git a/docs/models/components/request.md b/docs/models/components/request.md index b4015e8..32afe97 100644 --- a/docs/models/components/request.md +++ b/docs/models/components/request.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `URL` | **string* | :heavy_minus_sign: | URL used for the request | https://my-service.com/webhook | -| `Method` | **string* | :heavy_minus_sign: | HTTP request method | POST | +| `Body` | **string* | :heavy_minus_sign: | request body | {"event": "stream.started"} | | `Headers` | map[string]*string* | :heavy_minus_sign: | HTTP request headers | {
"User-Agent": "livepeer.studio"
} | -| `Body` | **string* | :heavy_minus_sign: | request body | {"event": "stream.started"} | \ No newline at end of file +| `Method` | **string* | :heavy_minus_sign: | HTTP request method | POST | +| `URL` | **string* | :heavy_minus_sign: | URL used for the request | https://my-service.com/webhook | \ No newline at end of file diff --git a/docs/models/components/room.md b/docs/models/components/room.md index 905becc..a49565e 100644 --- a/docs/models/components/room.md +++ b/docs/models/components/room.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `ID` | *string* | :heavy_check_mark: | room ID | d32ae9e6-c459-4931-9898-e86e2f5e7e16 | | `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the room was created | 1587667174725 | -| `UpdatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which room was updated | 1587667174725 | | `EgressID` | **string* | :heavy_minus_sign: | internal ID for egress output | | -| `Participants` | map[string][components.Participants](../../models/components/participants.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `ID` | *string* | :heavy_check_mark: | room ID | d32ae9e6-c459-4931-9898-e86e2f5e7e16 | +| `Participants` | map[string][components.Participants](../../models/components/participants.md) | :heavy_check_mark: | N/A | | +| `UpdatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which room was updated | 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/roomuserpayload.md b/docs/models/components/roomuserpayload.md index 71080b0..4fa9bf2 100644 --- a/docs/models/components/roomuserpayload.md +++ b/docs/models/components/roomuserpayload.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -| `Name` | *string* | :heavy_check_mark: | Display name | name | | `CanPublish` | **bool* | :heavy_minus_sign: | Whether a user is allowed to publish audio/video tracks | true | | `CanPublishData` | **bool* | :heavy_minus_sign: | Whether a user is allowed to publish data messages to the room | true | -| `Metadata` | **string* | :heavy_minus_sign: | User defined payload to store for the participant | | \ No newline at end of file +| `Metadata` | **string* | :heavy_minus_sign: | User defined payload to store for the participant | | +| `Name` | *string* | :heavy_check_mark: | Display name | name | \ No newline at end of file diff --git a/docs/models/components/session.md b/docs/models/components/session.md index d6d889c..1dc2368 100644 --- a/docs/models/components/session.md +++ b/docs/models/components/session.md @@ -3,30 +3,30 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| ~~`Kind`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | stream | -| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | -| `Name` | *string* | :heavy_check_mark: | N/A | test_session | -| `LastSeen` | **float64* | :heavy_minus_sign: | N/A | 1587667174725 | -| `SourceSegments` | **float64* | :heavy_minus_sign: | N/A | 1 | -| `TranscodedSegments` | **float64* | :heavy_minus_sign: | N/A | 2 | -| `SourceSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the source segments, sec | 1 | -| `TranscodedSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the transcoded segments, sec | 2 | -| `SourceBytes` | **float64* | :heavy_minus_sign: | N/A | 1 | -| `TranscodedBytes` | **float64* | :heavy_minus_sign: | N/A | 2 | -| `IngestRate` | **float64* | :heavy_minus_sign: | Rate at which sourceBytes increases (bytes/second) | 1 | -| `OutgoingRate` | **float64* | :heavy_minus_sign: | Rate at which transcodedBytes increases (bytes/second) | 2 | -| `IsHealthy` | **bool* | :heavy_minus_sign: | Indicates whether the stream is healthy or not. | | -| `Issues` | []*string* | :heavy_minus_sign: | A string array of human-readable errors describing issues affecting the stream, if any. | | -| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | -| `ParentID` | **string* | :heavy_minus_sign: | Points to parent stream object | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | -| `Record` | **bool* | :heavy_minus_sign: | Whether the stream should be recorded. Uses default settings. For more customization, create and configure an object store.
| false | -| `RecordingStatus` | [*components.RecordingStatus](../../models/components/recordingstatus.md) | :heavy_minus_sign: | The status of the recording process of this stream session. | | -| `RecordingURL` | **string* | :heavy_minus_sign: | URL for accessing the recording of this stream session. | | -| `Mp4URL` | **string* | :heavy_minus_sign: | The URL for the stream session recording packaged in an MP4. | | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | -| `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | N/A | | -| `RecordingSpec` | [*components.RecordingSpec](../../models/components/recordingspec.md) | :heavy_minus_sign: | Configuration for recording the stream. This can only be set if
`record` is true.
| | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | +| `ID` | **string* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `IngestRate` | **float64* | :heavy_minus_sign: | Rate at which sourceBytes increases (bytes/second) | 1 | +| `IsHealthy` | **bool* | :heavy_minus_sign: | Indicates whether the stream is healthy or not. | | +| `Issues` | []*string* | :heavy_minus_sign: | A string array of human-readable errors describing issues affecting the stream, if any. | | +| ~~`Kind`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | stream | +| `LastSeen` | **float64* | :heavy_minus_sign: | N/A | 1587667174725 | +| `Mp4URL` | **string* | :heavy_minus_sign: | The URL for the stream session recording packaged in an MP4. | | +| `Name` | *string* | :heavy_check_mark: | N/A | test_session | +| `OutgoingRate` | **float64* | :heavy_minus_sign: | Rate at which transcodedBytes increases (bytes/second) | 2 | +| `ParentID` | **string* | :heavy_minus_sign: | Points to parent stream object | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | +| `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | Profiles to transcode the stream into. If not specified, a default
set of profiles will be used with 240p, 360p, 480p and 720p
resolutions. Keep in mind that the source rendition is always kept.
| | +| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | +| `Record` | **bool* | :heavy_minus_sign: | Whether the stream should be recorded. Uses default settings. For more customization, create and configure an object store.
| false | +| `RecordingSpec` | [*components.RecordingSpec](../../models/components/recordingspec.md) | :heavy_minus_sign: | Configuration for recording the stream. This can only be set if
`record` is true.
| | +| `RecordingStatus` | [*components.RecordingStatus](../../models/components/recordingstatus.md) | :heavy_minus_sign: | The status of the recording process of this stream session. | | +| `RecordingURL` | **string* | :heavy_minus_sign: | URL for accessing the recording of this stream session. | | +| `SourceBytes` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `SourceSegments` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `SourceSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the source segments, sec | 1 | +| `TranscodedBytes` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `TranscodedSegments` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `TranscodedSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the transcoded segments, sec | 2 | +| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | \ No newline at end of file diff --git a/docs/models/components/signingkey.md b/docs/models/components/signingkey.md index cef43dc..d914177 100644 --- a/docs/models/components/signingkey.md +++ b/docs/models/components/signingkey.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | 78df0075-b5f3-4683-a618-1086faca35dc | -| `Name` | **string* | :heavy_minus_sign: | Name of the signing key | key1 | -| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 78df0075-b5f3-4683-a618-1086faca35dc | | `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the signing-key was created | 1587667174725 | +| `Disabled` | **bool* | :heavy_minus_sign: | Disable the signing key to allow rotation safely | false | +| `ID` | **string* | :heavy_minus_sign: | N/A | 78df0075-b5f3-4683-a618-1086faca35dc | | `LastSeen` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the signing-key was last used | 1587667174725 | +| `Name` | **string* | :heavy_minus_sign: | Name of the signing key | key1 | +| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb | | `PublicKey` | *string* | :heavy_check_mark: | N/A | | -| `Disabled` | **bool* | :heavy_minus_sign: | Disable the signing key to allow rotation safely | false | -| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb | \ No newline at end of file +| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 78df0075-b5f3-4683-a618-1086faca35dc | \ No newline at end of file diff --git a/docs/models/components/source1.md b/docs/models/components/source1.md index 638d1d3..b2f5210 100644 --- a/docs/models/components/source1.md +++ b/docs/models/components/source1.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Type` | [components.SourceType](../../models/components/sourcetype.md) | :heavy_check_mark: | N/A | -| `URL` | *string* | :heavy_check_mark: | URL from which the asset was uploaded. | +| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | | `GatewayURL` | **string* | :heavy_minus_sign: | Gateway URL from asset if parsed from provided URL on upload. | -| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `Type` | [components.SourceType](../../models/components/sourcetype.md) | :heavy_check_mark: | N/A | +| `URL` | *string* | :heavy_check_mark: | URL from which the asset was uploaded. | \ No newline at end of file diff --git a/docs/models/components/source3.md b/docs/models/components/source3.md index 066b55e..ac7439c 100644 --- a/docs/models/components/source3.md +++ b/docs/models/components/source3.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Type` | [components.AssetSource3Type](../../models/components/assetsource3type.md) | :heavy_check_mark: | N/A | +| `AssetID` | **string* | :heavy_minus_sign: | ID of the asset from which this asset was created. | | `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | -| `SourceID` | **string* | :heavy_minus_sign: | ID of the asset or stream from which this asset was created. | -| `SessionID` | **string* | :heavy_minus_sign: | ID of the session from which this asset was created. | | `PlaybackID` | **string* | :heavy_minus_sign: | Playback ID of the asset or stream from which this asset was created. | | `RequesterID` | **string* | :heavy_minus_sign: | ID of the requester from which this asset was created. | -| `AssetID` | **string* | :heavy_minus_sign: | ID of the asset from which this asset was created. | \ No newline at end of file +| `SessionID` | **string* | :heavy_minus_sign: | ID of the session from which this asset was created. | +| `SourceID` | **string* | :heavy_minus_sign: | ID of the asset or stream from which this asset was created. | +| `Type` | [components.AssetSource3Type](../../models/components/assetsource3type.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/spec.md b/docs/models/components/spec.md index 42ba235..24ebacd 100644 --- a/docs/models/components/spec.md +++ b/docs/models/components/spec.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `NftMetadataTemplate` | [*components.NftMetadataTemplate](../../models/components/nftmetadatatemplate.md) | :heavy_minus_sign: | Name of the NFT metadata template to export. 'player'
will embed the Livepeer Player on the NFT while 'file'
will reference only the immutable MP4 files.
| -| `NftMetadata` | [*components.NftMetadata](../../models/components/nftmetadata.md) | :heavy_minus_sign: | Additional data to add to the NFT metadata exported to
IPFS. Will be deep merged with the default metadata
exported.
| \ No newline at end of file +| `NftMetadata` | [*components.NftMetadata](../../models/components/nftmetadata.md) | :heavy_minus_sign: | Additional data to add to the NFT metadata exported to
IPFS. Will be deep merged with the default metadata
exported.
| +| `NftMetadataTemplate` | [*components.NftMetadataTemplate](../../models/components/nftmetadatatemplate.md) | :heavy_minus_sign: | Name of the NFT metadata template to export. 'player'
will embed the Livepeer Player on the NFT while 'file'
will reference only the immutable MP4 files.
| \ No newline at end of file diff --git a/docs/models/components/status.md b/docs/models/components/status.md index 4b24ff5..7b4af18 100644 --- a/docs/models/components/status.md +++ b/docs/models/components/status.md @@ -1,11 +1,13 @@ # Status -status of webhook +Status of the asset ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `LastFailure` | [*components.LastFailure](../../models/components/lastfailure.md) | :heavy_minus_sign: | failure timestamp and error message with status code | | -| `LastTriggeredAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the webhook last was
triggered
| 1587667174725 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `ErrorMessage` | **string* | :heavy_minus_sign: | Error message if the asset creation failed. | | +| `Phase` | [components.AssetPhase](../../models/components/assetphase.md) | :heavy_check_mark: | Phase of the asset | | +| `Progress` | **float64* | :heavy_minus_sign: | Current progress of the task creating this asset. | | +| `UpdatedAt` | *float64* | :heavy_check_mark: | Timestamp (in milliseconds) at which the asset was last updated | 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/storage1.md b/docs/models/components/storage1.md index 20ffa9f..bcb89a6 100644 --- a/docs/models/components/storage1.md +++ b/docs/models/components/storage1.md @@ -7,7 +7,7 @@ Storage for the output files | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Type` | [components.StorageType](../../models/components/storagetype.md) | :heavy_check_mark: | Type of service used for output files | | -| `Endpoint` | *string* | :heavy_check_mark: | Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) | https://gateway.storjshare.io | | `Bucket` | *string* | :heavy_check_mark: | Bucket with output files | outputbucket | -| `Credentials` | [components.StorageCredentials](../../models/components/storagecredentials.md) | :heavy_check_mark: | Credentials for the output video storage | | \ No newline at end of file +| `Credentials` | [components.StorageCredentials](../../models/components/storagecredentials.md) | :heavy_check_mark: | Credentials for the output video storage | | +| `Endpoint` | *string* | :heavy_check_mark: | Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) | https://gateway.storjshare.io | +| `Type` | [components.StorageType](../../models/components/storagetype.md) | :heavy_check_mark: | Type of service used for output files | | \ No newline at end of file diff --git a/docs/models/components/storage2.md b/docs/models/components/storage2.md index a88a64b..bb94172 100644 --- a/docs/models/components/storage2.md +++ b/docs/models/components/storage2.md @@ -7,5 +7,5 @@ Storage for the output files | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `Type` | [components.TranscodePayloadStorageType](../../models/components/transcodepayloadstoragetype.md) | :heavy_check_mark: | Type of service used for output files | -| `Credentials` | [components.TranscodePayloadStorageCredentials](../../models/components/transcodepayloadstoragecredentials.md) | :heavy_check_mark: | Delegation proof for Livepeer to be able to upload to
web3.storage
| \ No newline at end of file +| `Credentials` | [components.TranscodePayloadStorageCredentials](../../models/components/transcodepayloadstoragecredentials.md) | :heavy_check_mark: | Delegation proof for Livepeer to be able to upload to
web3.storage
| +| `Type` | [components.TranscodePayloadStorageType](../../models/components/transcodepayloadstoragetype.md) | :heavy_check_mark: | Type of service used for output files | \ No newline at end of file diff --git a/docs/models/components/storagestatus.md b/docs/models/components/storagestatus.md index 6f041a4..53c5aab 100644 --- a/docs/models/components/storagestatus.md +++ b/docs/models/components/storagestatus.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `ErrorMessage` | **string* | :heavy_minus_sign: | Error message if the last storage changed failed. | Failed to update storage | | `Phase` | [components.Phase](../../models/components/phase.md) | :heavy_check_mark: | Phase of the asset storage | ready | | `Progress` | **float64* | :heavy_minus_sign: | Current progress of the task updating the storage. | 0.5 | -| `ErrorMessage` | **string* | :heavy_minus_sign: | Error message if the last storage changed failed. | Failed to update storage | | `Tasks` | [components.Tasks](../../models/components/tasks.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/stream.md b/docs/models/components/stream.md index 6f9dd29..b7a002c 100644 --- a/docs/models/components/stream.md +++ b/docs/models/components/stream.md @@ -3,38 +3,38 @@ ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `Name` | *string* | :heavy_check_mark: | N/A | test_stream | -| ~~`Kind`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | stream | -| `CreatorID` | [*components.CreatorID](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | -| `UserTags` | map[string][components.StreamUserTags](../../models/components/streamusertags.md) | :heavy_minus_sign: | User input tags associated with the stream | | -| `LastSeen` | **float64* | :heavy_minus_sign: | N/A | 1587667174725 | -| `SourceSegments` | **float64* | :heavy_minus_sign: | N/A | 1 | -| `TranscodedSegments` | **float64* | :heavy_minus_sign: | N/A | 2 | -| `SourceSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the source segments, sec | 1 | -| `TranscodedSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the transcoded segments, sec | 2 | -| `SourceBytes` | **float64* | :heavy_minus_sign: | N/A | 1 | -| `TranscodedBytes` | **float64* | :heavy_minus_sign: | N/A | 2 | -| `IngestRate` | **float64* | :heavy_minus_sign: | Rate at which sourceBytes increases (bytes/second) | 1 | -| `OutgoingRate` | **float64* | :heavy_minus_sign: | Rate at which transcodedBytes increases (bytes/second) | 2 | -| `IsActive` | **bool* | :heavy_minus_sign: | If currently active | true | -| `IsHealthy` | **bool* | :heavy_minus_sign: | Indicates whether the stream is healthy or not. | | -| `Issues` | []*string* | :heavy_minus_sign: | A string array of human-readable errors describing issues affecting the stream, if any. | | -| `CreatedByTokenName` | **string* | :heavy_minus_sign: | Name of the token used to create this object | abc-123-xyz-456 | -| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | -| `ParentID` | **string* | :heavy_minus_sign: | Points to parent stream object | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `StreamKey` | **string* | :heavy_minus_sign: | Used to form RTMP ingest URL | hgebdhhigq | -| `Pull` | [*components.StreamPull](../../models/components/streampull.md) | :heavy_minus_sign: | Configuration for a stream that should be actively pulled from an
external source, rather than pushed to Livepeer. If specified, the
stream will not have a streamKey. | | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | -| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | -| `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | N/A | | -| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | -| `Record` | **bool* | :heavy_minus_sign: | Should this stream be recorded? Uses default settings. For more
customization, create and configure an object store.
| false | -| `RecordingSpec` | [*components.StreamRecordingSpec](../../models/components/streamrecordingspec.md) | :heavy_minus_sign: | Configuration for recording the stream. This can only be set if
`record` is true.
| | -| `Multistream` | [*components.StreamMultistream](../../models/components/streammultistream.md) | :heavy_minus_sign: | N/A | | -| `Suspended` | **bool* | :heavy_minus_sign: | If currently suspended | | -| `LastTerminatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) when the stream was last terminated | 1713281212993 | -| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | we7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `Renditions` | [*components.Renditions](../../models/components/renditions.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | +| `CreatedByTokenName` | **string* | :heavy_minus_sign: | Name of the token used to create this object | abc-123-xyz-456 | +| `CreatorID` | [*components.CreatorID](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | +| `ID` | **string* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `IngestRate` | **float64* | :heavy_minus_sign: | Rate at which sourceBytes increases (bytes/second) | 1 | +| `IsActive` | **bool* | :heavy_minus_sign: | If currently active | true | +| `IsHealthy` | **bool* | :heavy_minus_sign: | Indicates whether the stream is healthy or not. | | +| `Issues` | []*string* | :heavy_minus_sign: | A string array of human-readable errors describing issues affecting the stream, if any. | | +| ~~`Kind`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | stream | +| `LastSeen` | **float64* | :heavy_minus_sign: | N/A | 1587667174725 | +| `LastTerminatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) when the stream was last terminated | 1713281212993 | +| `Multistream` | [*components.StreamMultistream](../../models/components/streammultistream.md) | :heavy_minus_sign: | N/A | | +| `Name` | *string* | :heavy_check_mark: | N/A | test_stream | +| `OutgoingRate` | **float64* | :heavy_minus_sign: | Rate at which transcodedBytes increases (bytes/second) | 2 | +| `ParentID` | **string* | :heavy_minus_sign: | Points to parent stream object | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | +| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | +| `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | Profiles to transcode the stream into. If not specified, a default
set of profiles will be used with 240p, 360p, 480p and 720p
resolutions. Keep in mind that the source rendition is always kept.
| | +| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | +| `Pull` | [*components.StreamPull](../../models/components/streampull.md) | :heavy_minus_sign: | Configuration for a stream that should be actively pulled from an
external source, rather than pushed to Livepeer. If specified, the
stream will not have a streamKey. | | +| `Record` | **bool* | :heavy_minus_sign: | Should this stream be recorded? Uses default settings. For more
customization, create and configure an object store.
| false | +| `RecordingSpec` | [*components.StreamRecordingSpec](../../models/components/streamrecordingspec.md) | :heavy_minus_sign: | Configuration for recording the stream. This can only be set if
`record` is true.
| | +| `Renditions` | [*components.Renditions](../../models/components/renditions.md) | :heavy_minus_sign: | N/A | | +| `SourceBytes` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `SourceSegments` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `SourceSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the source segments, sec | 1 | +| `StreamKey` | **string* | :heavy_minus_sign: | Used to form RTMP ingest URL | hgebdhhigq | +| `Suspended` | **bool* | :heavy_minus_sign: | If currently suspended | | +| `TranscodedBytes` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `TranscodedSegments` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `TranscodedSegmentsDuration` | **float64* | :heavy_minus_sign: | Duration of all the transcoded segments, sec | 2 | +| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | we7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `UserTags` | map[string][components.StreamUserTags](../../models/components/streamusertags.md) | :heavy_minus_sign: | User input tags associated with the stream | | \ No newline at end of file diff --git a/docs/models/components/streamismobile.md b/docs/models/components/streamismobile.md index 9c7531e..7fedcbe 100644 --- a/docs/models/components/streamismobile.md +++ b/docs/models/components/streamismobile.md @@ -5,10 +5,10 @@ Indicates whether the stream will be pulled from a mobile source. ## Supported Types -### IsMobile1 +### StreamIsMobile1 ```go -streamIsMobile := components.CreateStreamIsMobileIsMobile1(components.IsMobile1{/* values here */}) +streamIsMobile := components.CreateStreamIsMobileStreamIsMobile1(components.StreamIsMobile1{/* values here */}) ``` ### diff --git a/docs/models/components/streamismobile1.md b/docs/models/components/streamismobile1.md new file mode 100644 index 0000000..82f5748 --- /dev/null +++ b/docs/models/components/streamismobile1.md @@ -0,0 +1,12 @@ +# StreamIsMobile1 + +0: not mobile, 1: mobile screen share, 2: mobile camera. + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `StreamIsMobile1Zero` | 0 | +| `StreamIsMobile1One` | 1 | +| `StreamIsMobile1Two` | 2 | \ No newline at end of file diff --git a/docs/models/components/streampatchpayload.md b/docs/models/components/streampatchpayload.md index 1fb9f4c..bde5138 100644 --- a/docs/models/components/streampatchpayload.md +++ b/docs/models/components/streampatchpayload.md @@ -6,9 +6,10 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | | `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | -| `Record` | **bool* | :heavy_minus_sign: | Should this stream be recorded? Uses default settings. For more
customization, create and configure an object store.
| false | -| `Suspended` | **bool* | :heavy_minus_sign: | If currently suspended | | | `Multistream` | [*components.Multistream](../../models/components/multistream.md) | :heavy_minus_sign: | N/A | | | `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | N/A | | +| `Record` | **bool* | :heavy_minus_sign: | Should this stream be recorded? Uses default settings. For more
customization, create and configure an object store.
| false | +| `RecordingSpec` | [*components.RecordingSpec](../../models/components/recordingspec.md) | :heavy_minus_sign: | N/A | | +| `Suspended` | **bool* | :heavy_minus_sign: | If currently suspended | | | `UserTags` | map[string][components.UserTags](../../models/components/usertags.md) | :heavy_minus_sign: | User input tags associated with the stream | | \ No newline at end of file diff --git a/docs/models/components/streampull.md b/docs/models/components/streampull.md index 7cd952b..ed65e1c 100644 --- a/docs/models/components/streampull.md +++ b/docs/models/components/streampull.md @@ -9,7 +9,7 @@ stream will not have a streamKey. | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `Source` | *string* | :heavy_check_mark: | URL from which to pull from. | https://myservice.com/live/stream.flv | | `Headers` | map[string]*string* | :heavy_minus_sign: | Headers to be sent with the request to the pull source. | {
"Authorization": "Bearer 123"
} | | `IsMobile` | [*components.StreamIsMobile](../../models/components/streamismobile.md) | :heavy_minus_sign: | Indicates whether the stream will be pulled from a mobile source. | | -| `Location` | [*components.StreamLocation](../../models/components/streamlocation.md) | :heavy_minus_sign: | Approximate location of the pull source. The location is used to
determine the closest Livepeer region to pull the stream from. | | \ No newline at end of file +| `Location` | [*components.StreamLocation](../../models/components/streamlocation.md) | :heavy_minus_sign: | Approximate location of the pull source. The location is used to
determine the closest Livepeer region to pull the stream from. | | +| `Source` | *string* | :heavy_check_mark: | URL from which to pull from. | https://myservice.com/live/stream.flv | \ No newline at end of file diff --git a/docs/models/components/streamrecordingspec.md b/docs/models/components/streamrecordingspec.md index 0c5bd7d..6938167 100644 --- a/docs/models/components/streamrecordingspec.md +++ b/docs/models/components/streamrecordingspec.md @@ -7,6 +7,6 @@ Configuration for recording the stream. This can only be set if ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Profiles` | [][components.FfmpegProfile](../../models/components/ffmpegprofile.md) | :heavy_minus_sign: | Profiles to record the stream in. If not specified, the stream
will be recorded in the same profiles as the stream itself. Keep
in mind that the source rendition will always be recorded.
| \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | Profiles to process the recording of this stream into. If not
specified, default profiles will be derived based on the stream
input. Keep in mind that the source rendition is always kept.
| \ No newline at end of file diff --git a/docs/models/components/target.md b/docs/models/components/target.md index 12fc770..c8e2402 100644 --- a/docs/models/components/target.md +++ b/docs/models/components/target.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `Profile` | *string* | :heavy_check_mark: | Name of transcoding profile that should be sent. Use
"source" for pushing source stream data
| 720p0 | -| `VideoOnly` | **bool* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | | `ID` | **string* | :heavy_minus_sign: | ID of multistream target object where to push this stream | PUSH123 | -| `Spec` | [*components.TargetSpec](../../models/components/targetspec.md) | :heavy_minus_sign: | Inline multistream target object. Will automatically
create the target resource to be used by the created
stream.
| | \ No newline at end of file +| `Profile` | *string* | :heavy_check_mark: | Name of transcoding profile that should be sent. Use
"source" for pushing source stream data
| 720p0 | +| `Spec` | [*components.TargetSpec](../../models/components/targetspec.md) | :heavy_minus_sign: | Inline multistream target object. Will automatically
create the target resource to be used by the created
stream.
| | +| `VideoOnly` | **bool* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | \ No newline at end of file diff --git a/docs/models/components/targetaddpayload.md b/docs/models/components/targetaddpayload.md index 01caf4d..1b890d7 100644 --- a/docs/models/components/targetaddpayload.md +++ b/docs/models/components/targetaddpayload.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `Profile` | *string* | :heavy_check_mark: | Name of transcoding profile that should be sent. Use
"source" for pushing source stream data
| 720p0 | -| `VideoOnly` | **bool* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | | `ID` | **string* | :heavy_minus_sign: | ID of multistream target object where to push this stream | PUSH123 | -| `Spec` | [*components.TargetAddPayloadSpec](../../models/components/targetaddpayloadspec.md) | :heavy_minus_sign: | Inline multistream target object. Will automatically
create the target resource to be used by the created
stream.
| | \ No newline at end of file +| `Profile` | *string* | :heavy_check_mark: | Name of transcoding profile that should be sent. Use
"source" for pushing source stream data
| 720p0 | +| `Spec` | [*components.TargetAddPayloadSpec](../../models/components/targetaddpayloadspec.md) | :heavy_minus_sign: | Inline multistream target object. Will automatically
create the target resource to be used by the created
stream.
| | +| `VideoOnly` | **bool* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | \ No newline at end of file diff --git a/docs/models/components/targetoutput.md b/docs/models/components/targetoutput.md index 482e091..b34e376 100644 --- a/docs/models/components/targetoutput.md +++ b/docs/models/components/targetoutput.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ID` | **string* | :heavy_minus_sign: | ID of multistream target object where to push this stream | PUSH123 | | `Profile` | *string* | :heavy_check_mark: | Name of transcoding profile that should be sent. Use
"source" for pushing source stream data
| 720p0 | -| `VideoOnly` | **bool* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | -| `ID` | **string* | :heavy_minus_sign: | ID of multistream target object where to push this stream | PUSH123 | \ No newline at end of file +| `VideoOnly` | **bool* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | \ No newline at end of file diff --git a/docs/models/components/task.md b/docs/models/components/task.md index 6da1943..f5e2e9b 100644 --- a/docs/models/components/task.md +++ b/docs/models/components/task.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `ID` | **string* | :heavy_minus_sign: | Task ID | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | -| `Type` | [*components.TaskType](../../models/components/tasktype.md) | :heavy_minus_sign: | Type of the task | upload | | `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which task was created | 1587667174725 | -| `ScheduledAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the task was scheduled for
execution (e.g. after file upload finished).
| 1587667174725 | +| `ID` | **string* | :heavy_minus_sign: | Task ID | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `InputAssetID` | **string* | :heavy_minus_sign: | ID of the input asset | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | +| `Output` | [*components.Output](../../models/components/output.md) | :heavy_minus_sign: | Output of the task | | | `OutputAssetID` | **string* | :heavy_minus_sign: | ID of the output asset | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | -| `RequesterID` | **string* | :heavy_minus_sign: | ID of the requester hash(IP + SALT + PlaybackId) | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `Params` | [*components.Params](../../models/components/params.md) | :heavy_minus_sign: | Parameters of the task | | +| `RequesterID` | **string* | :heavy_minus_sign: | ID of the requester hash(IP + SALT + PlaybackId) | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | +| `ScheduledAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the task was scheduled for
execution (e.g. after file upload finished).
| 1587667174725 | | `Status` | [*components.TaskStatus](../../models/components/taskstatus.md) | :heavy_minus_sign: | Status of the task | | -| `Output` | [*components.Output](../../models/components/output.md) | :heavy_minus_sign: | Output of the task | | \ No newline at end of file +| `Type` | [*components.TaskType](../../models/components/tasktype.md) | :heavy_minus_sign: | Type of the task | upload | \ No newline at end of file diff --git a/docs/models/components/taskexportdata.md b/docs/models/components/taskexportdata.md index ff6a347..4a3d7d5 100644 --- a/docs/models/components/taskexportdata.md +++ b/docs/models/components/taskexportdata.md @@ -8,6 +8,6 @@ Parameters for the export-data task | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | | `Content` | [components.Content](../../models/components/content.md) | :heavy_check_mark: | File content to store into IPFS | {
"data": "Hello, World!"
} | +| `ID` | **string* | :heavy_minus_sign: | Optional ID of the content | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `Ipfs` | [*components.IpfsExportParams](../../models/components/ipfsexportparams.md) | :heavy_minus_sign: | N/A | | -| `Type` | **string* | :heavy_minus_sign: | Optional type of content | text/plain | -| `ID` | **string* | :heavy_minus_sign: | Optional ID of the content | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | \ No newline at end of file +| `Type` | **string* | :heavy_minus_sign: | Optional type of content | text/plain | \ No newline at end of file diff --git a/docs/models/components/taskipfs.md b/docs/models/components/taskipfs.md index 36e3e4b..0cee458 100644 --- a/docs/models/components/taskipfs.md +++ b/docs/models/components/taskipfs.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `VideoFileCid` | *string* | :heavy_check_mark: | IPFS CID of the exported video file | Qmabc123xyz341 | -| `VideoFileURL` | **string* | :heavy_minus_sign: | URL for the file with the IPFS protocol | ipfs://Qmabc123xyz341 | -| `VideoFileGatewayURL` | **string* | :heavy_minus_sign: | URL to access file via HTTP through an IPFS gateway | https://gateway.ipfs.io/ipfs/Qmabc123xyz341 | | `NftMetadataCid` | **string* | :heavy_minus_sign: | IPFS CID of the default metadata exported for the video | Qmabc123xyz341 | +| `NftMetadataGatewayURL` | **string* | :heavy_minus_sign: | URL to access metadata file via HTTP through an IPFS
gateway
| https://gateway.ipfs.io/ipfs/Qmabc123xyz341 | | `NftMetadataURL` | **string* | :heavy_minus_sign: | URL for the metadata file with the IPFS protocol | ipfs://Qmabc123xyz341 | -| `NftMetadataGatewayURL` | **string* | :heavy_minus_sign: | URL to access metadata file via HTTP through an IPFS
gateway
| https://gateway.ipfs.io/ipfs/Qmabc123xyz341 | \ No newline at end of file +| `VideoFileCid` | *string* | :heavy_check_mark: | IPFS CID of the exported video file | Qmabc123xyz341 | +| `VideoFileGatewayURL` | **string* | :heavy_minus_sign: | URL to access file via HTTP through an IPFS gateway | https://gateway.ipfs.io/ipfs/Qmabc123xyz341 | +| `VideoFileURL` | **string* | :heavy_minus_sign: | URL for the file with the IPFS protocol | ipfs://Qmabc123xyz341 | \ No newline at end of file diff --git a/docs/models/components/tasks.md b/docs/models/components/tasks.md index 7c6cce6..02085ea 100644 --- a/docs/models/components/tasks.md +++ b/docs/models/components/tasks.md @@ -5,6 +5,6 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -| `Pending` | **string* | :heavy_minus_sign: | ID of any currently running task that is exporting this
asset to IPFS.
| 09F8B46C-61A0-4254-9875-F71F4C605BC7 | +| `Failed` | **string* | :heavy_minus_sign: | ID of the last task to fail execution. | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `Last` | **string* | :heavy_minus_sign: | ID of the last task to run successfully, that created
the currently saved data.
| 09F8B46C-61A0-4254-9875-F71F4C605BC7 | -| `Failed` | **string* | :heavy_minus_sign: | ID of the last task to fail execution. | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | \ No newline at end of file +| `Pending` | **string* | :heavy_minus_sign: | ID of any currently running task that is exporting this
asset to IPFS.
| 09F8B46C-61A0-4254-9875-F71F4C605BC7 | \ No newline at end of file diff --git a/docs/models/components/taskstatus.md b/docs/models/components/taskstatus.md index 3e55386..f7c5023 100644 --- a/docs/models/components/taskstatus.md +++ b/docs/models/components/taskstatus.md @@ -7,8 +7,8 @@ Status of the task | Field | Type | Required | Description | Example | | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `ErrorMessage` | **string* | :heavy_minus_sign: | Error message if the task failed | Failed to upload file | | `Phase` | [components.TaskPhase](../../models/components/taskphase.md) | :heavy_check_mark: | Phase of the task | pending | -| `UpdatedAt` | *float64* | :heavy_check_mark: | Timestamp (in milliseconds) at which task was updated | 1587667174725 | | `Progress` | **float64* | :heavy_minus_sign: | Current progress of the task in a 0-1 ratio | 0.5 | -| `ErrorMessage` | **string* | :heavy_minus_sign: | Error message if the task failed | Failed to upload file | -| `Retries` | **float64* | :heavy_minus_sign: | Number of retries done on the task | 3 | \ No newline at end of file +| `Retries` | **float64* | :heavy_minus_sign: | Number of retries done on the task | 3 | +| `UpdatedAt` | *float64* | :heavy_check_mark: | Timestamp (in milliseconds) at which task was updated | 1587667174725 | \ No newline at end of file diff --git a/docs/models/components/taskupload.md b/docs/models/components/taskupload.md index 86f28a8..74c5424 100644 --- a/docs/models/components/taskupload.md +++ b/docs/models/components/taskupload.md @@ -1,11 +1,14 @@ # TaskUpload -Output of the upload task +Parameters for the upload task ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `AssetSpec` | [*components.Asset](../../models/components/asset.md) | :heavy_minus_sign: | N/A | -| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | true | +| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | | +| `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | | +| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | 6 | +| `URL` | **string* | :heavy_minus_sign: | URL of the asset to "upload" | https://cdn.livepeer.com/ABC123/filename.mp4 | \ No newline at end of file diff --git a/docs/models/components/tracks.md b/docs/models/components/tracks.md index 81f3764..d96a129 100644 --- a/docs/models/components/tracks.md +++ b/docs/models/components/tracks.md @@ -5,15 +5,15 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `Type` | [components.AssetVideoSpecType](../../models/components/assetvideospectype.md) | :heavy_check_mark: | type of track | video | +| `BitDepth` | **float64* | :heavy_minus_sign: | Bit depth of the track - only for audio tracks | 16 | +| `Bitrate` | **float64* | :heavy_minus_sign: | Bitrate of the track in bits per second | 1000000 | +| `Channels` | **float64* | :heavy_minus_sign: | Amount of audio channels in the track | 2 | | `Codec` | *string* | :heavy_check_mark: | Codec of the track | aac | -| `StartTime` | **float64* | :heavy_minus_sign: | Start time of the track in seconds | 23.8238 | | `Duration` | **float64* | :heavy_minus_sign: | Duration of the track in seconds | 23.8238 | -| `Bitrate` | **float64* | :heavy_minus_sign: | Bitrate of the track in bits per second | 1000000 | -| `Width` | **float64* | :heavy_minus_sign: | Width of the track - only for video tracks | 1920 | +| `Fps` | **float64* | :heavy_minus_sign: | Frame rate of the track - only for video tracks | 30 | | `Height` | **float64* | :heavy_minus_sign: | Height of the track - only for video tracks | 1080 | | `PixelFormat` | **string* | :heavy_minus_sign: | Pixel format of the track - only for video tracks | yuv420p | -| `Fps` | **float64* | :heavy_minus_sign: | Frame rate of the track - only for video tracks | 30 | -| `Channels` | **float64* | :heavy_minus_sign: | Amount of audio channels in the track | 2 | | `SampleRate` | **float64* | :heavy_minus_sign: | Sample rate of the track in samples per second - only for
audio tracks
| 44100 | -| `BitDepth` | **float64* | :heavy_minus_sign: | Bit depth of the track - only for audio tracks | 16 | \ No newline at end of file +| `StartTime` | **float64* | :heavy_minus_sign: | Start time of the track in seconds | 23.8238 | +| `Type` | [components.AssetVideoSpecType](../../models/components/assetvideospectype.md) | :heavy_check_mark: | type of track | video | +| `Width` | **float64* | :heavy_minus_sign: | Width of the track - only for video tracks | 1920 | \ No newline at end of file diff --git a/docs/models/components/transcodefile.md b/docs/models/components/transcodefile.md index 9f89e9a..a75edb8 100644 --- a/docs/models/components/transcodefile.md +++ b/docs/models/components/transcodefile.md @@ -7,10 +7,10 @@ Parameters for the transcode-file task | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | false | +| `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | | `Input` | [*components.TaskInput](../../models/components/taskinput.md) | :heavy_minus_sign: | Input video file to transcode | | -| `Storage` | [*components.TaskStorage](../../models/components/taskstorage.md) | :heavy_minus_sign: | Storage for the output files | | | `Outputs` | [*components.TaskOutputs](../../models/components/taskoutputs.md) | :heavy_minus_sign: | Output formats | | | `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | | -| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should
be
| 10 | -| `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | -| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | false | \ No newline at end of file +| `Storage` | [*components.TaskStorage](../../models/components/taskstorage.md) | :heavy_minus_sign: | Storage for the output files | | +| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should
be
| 10 | \ No newline at end of file diff --git a/docs/models/components/transcodepayload.md b/docs/models/components/transcodepayload.md index 177202b..7912c0d 100644 --- a/docs/models/components/transcodepayload.md +++ b/docs/models/components/transcodepayload.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | +| `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | `Input` | [components.Input](../../models/components/input.md) | :heavy_check_mark: | N/A | -| `Storage` | [components.TranscodePayloadStorage](../../models/components/transcodepayloadstorage.md) | :heavy_check_mark: | N/A | | `Outputs` | [components.Outputs](../../models/components/outputs.md) | :heavy_check_mark: | Output formats | | `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | -| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | -| `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | -| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | \ No newline at end of file +| `Storage` | [components.TranscodePayloadStorage](../../models/components/transcodepayloadstorage.md) | :heavy_check_mark: | N/A | +| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | \ No newline at end of file diff --git a/docs/models/components/transcodeprofile.md b/docs/models/components/transcodeprofile.md index 601beaa..4bc81f2 100644 --- a/docs/models/components/transcodeprofile.md +++ b/docs/models/components/transcodeprofile.md @@ -7,13 +7,13 @@ Transcode API profile | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `Width` | **int64* | :heavy_minus_sign: | N/A | 1280 | -| `Name` | **string* | :heavy_minus_sign: | N/A | 720p | -| `Height` | **int64* | :heavy_minus_sign: | N/A | | | `Bitrate` | *int64* | :heavy_check_mark: | N/A | 3000000 | -| `Quality` | **int64* | :heavy_minus_sign: | Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
| 23 | +| `Encoder` | [*components.Encoder](../../models/components/encoder.md) | :heavy_minus_sign: | N/A | H.264 | | `Fps` | **int64* | :heavy_minus_sign: | N/A | 30 | | `FpsDen` | **int64* | :heavy_minus_sign: | N/A | 1 | | `Gop` | **string* | :heavy_minus_sign: | N/A | 2 | -| `Profile` | [*components.TranscodeProfileProfile](../../models/components/transcodeprofileprofile.md) | :heavy_minus_sign: | N/A | H264Baseline | -| `Encoder` | [*components.TranscodeProfileEncoder](../../models/components/transcodeprofileencoder.md) | :heavy_minus_sign: | N/A | H.264 | \ No newline at end of file +| `Height` | **int64* | :heavy_minus_sign: | N/A | | +| `Name` | **string* | :heavy_minus_sign: | N/A | 720p | +| `Profile` | [*components.Profile](../../models/components/profile.md) | :heavy_minus_sign: | N/A | H264Baseline | +| `Quality` | **int64* | :heavy_minus_sign: | Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
| 23 | +| `Width` | **int64* | :heavy_minus_sign: | N/A | 1280 | \ No newline at end of file diff --git a/docs/models/components/transcodeprofileencoder.md b/docs/models/components/transcodeprofileencoder.md deleted file mode 100644 index e7e17fd..0000000 --- a/docs/models/components/transcodeprofileencoder.md +++ /dev/null @@ -1,11 +0,0 @@ -# TranscodeProfileEncoder - - -## Values - -| Name | Value | -| ----------------------------- | ----------------------------- | -| `TranscodeProfileEncoderH264` | H.264 | -| `TranscodeProfileEncoderHevc` | HEVC | -| `TranscodeProfileEncoderVp8` | VP8 | -| `TranscodeProfileEncoderVp9` | VP9 | \ No newline at end of file diff --git a/docs/models/components/transcodeprofileprofile.md b/docs/models/components/transcodeprofileprofile.md deleted file mode 100644 index 7db4e86..0000000 --- a/docs/models/components/transcodeprofileprofile.md +++ /dev/null @@ -1,11 +0,0 @@ -# TranscodeProfileProfile - - -## Values - -| Name | Value | -| -------------------------------------------- | -------------------------------------------- | -| `TranscodeProfileProfileH264Baseline` | H264Baseline | -| `TranscodeProfileProfileH264Main` | H264Main | -| `TranscodeProfileProfileH264High` | H264High | -| `TranscodeProfileProfileH264ConstrainedHigh` | H264ConstrainedHigh | \ No newline at end of file diff --git a/docs/models/components/two.md b/docs/models/components/two.md index 0d3dd9e..986847f 100644 --- a/docs/models/components/two.md +++ b/docs/models/components/two.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `Type` | [components.AssetSourceType](../../models/components/assetsourcetype.md) | :heavy_check_mark: | N/A | -| `SessionID` | *string* | :heavy_check_mark: | ID of the session from which this asset was created | \ No newline at end of file +| `SessionID` | *string* | :heavy_check_mark: | ID of the session from which this asset was created | +| `Type` | [components.AssetSourceType](../../models/components/assetsourcetype.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/upload.md b/docs/models/components/upload.md index fff61f9..c94c100 100644 --- a/docs/models/components/upload.md +++ b/docs/models/components/upload.md @@ -1,14 +1,11 @@ # Upload -Parameters for the upload task +Output of the upload task ## Fields -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `URL` | **string* | :heavy_minus_sign: | URL of the asset to "upload" | https://cdn.livepeer.com/ABC123/filename.mp4 | -| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | | -| `C2pa` | **bool* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | true | -| `Profiles` | [][components.TranscodeProfile](../../models/components/transcodeprofile.md) | :heavy_minus_sign: | N/A | | -| `TargetSegmentSizeSecs` | **float64* | :heavy_minus_sign: | How many seconds the duration of each output segment should be | 6 | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `AssetSpec` | [*components.Asset](../../models/components/asset.md) | :heavy_minus_sign: | N/A | +| `AdditionalProperties` | map[string]*any* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/usagemetric.md b/docs/models/components/usagemetric.md index 0b2ff70..ef8cb22 100644 --- a/docs/models/components/usagemetric.md +++ b/docs/models/components/usagemetric.md @@ -8,8 +8,8 @@ An individual metric about usage of a user. | Field | Type | Required | Description | Example | | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | -| `UserID` | **string* | :heavy_minus_sign: | The user ID associated with the metric | 1bde4o2i6xycudoy | | `CreatorID` | **string* | :heavy_minus_sign: | The creator ID associated with the metric | john@doe.com | | `DeliveryUsageMins` | **float64* | :heavy_minus_sign: | Total minutes of delivery usage. | 100 | +| `StorageUsageMins` | **float64* | :heavy_minus_sign: | Total minutes of storage usage. | 100 | | `TotalUsageMins` | **float64* | :heavy_minus_sign: | Total transcoded minutes. | 100 | -| `StorageUsageMins` | **float64* | :heavy_minus_sign: | Total minutes of storage usage. | 100 | \ No newline at end of file +| `UserID` | **string* | :heavy_minus_sign: | The user ID associated with the metric | 1bde4o2i6xycudoy | \ No newline at end of file diff --git a/docs/models/components/videospec.md b/docs/models/components/videospec.md index f2e020b..fe1ec0e 100644 --- a/docs/models/components/videospec.md +++ b/docs/models/components/videospec.md @@ -7,7 +7,7 @@ Video metadata | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `Format` | **string* | :heavy_minus_sign: | Format of the asset | mp4 | -| `Duration` | **float64* | :heavy_minus_sign: | Duration of the asset in seconds (float) | 23.8328 | | `Bitrate` | **float64* | :heavy_minus_sign: | Bitrate of the video in bits per second | 1000000 | +| `Duration` | **float64* | :heavy_minus_sign: | Duration of the asset in seconds (float) | 23.8328 | +| `Format` | **string* | :heavy_minus_sign: | Format of the asset | mp4 | | `Tracks` | [][components.Tracks](../../models/components/tracks.md) | :heavy_minus_sign: | List of tracks associated with the asset when the format
contemplates them (e.g. mp4)
| | \ No newline at end of file diff --git a/docs/models/components/viewershipmetric.md b/docs/models/components/viewershipmetric.md index e620405..65f0195 100644 --- a/docs/models/components/viewershipmetric.md +++ b/docs/models/components/viewershipmetric.md @@ -9,25 +9,25 @@ An individual metric about viewership of an asset. Necessarily, at least | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID associated with the metric. | 1bde4o2i6xycudoy | +| `Browser` | **string* | :heavy_minus_sign: | The browser used by the viewer. | Safari | +| `BrowserEngine` | **string* | :heavy_minus_sign: | The browser engine used by the viewer's browser. | WebKit | +| `Continent` | **string* | :heavy_minus_sign: | The continent where the viewer is located. | North America | +| `Country` | **string* | :heavy_minus_sign: | The country where the viewer is located. | United States | +| `CPU` | **string* | :heavy_minus_sign: | The CPU used by the viewer's device. | ARM | | `CreatorID` | **string* | :heavy_minus_sign: | The ID of the creator associated with the metric. | john@doe.com | -| `ViewerID` | **string* | :heavy_minus_sign: | The ID of the viewer associated with the metric. | 1bde4o2i6xycudoy | | `DStorageURL` | **string* | :heavy_minus_sign: | The URL of the distributed storage used for the asset | ipfs://QmZ4 | -| `Timestamp` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) when the metric was recorded. If the
query contains a time step, this timestamp will point to the
beginning of the time step period.
| 1587667174725 | | `Device` | **string* | :heavy_minus_sign: | The device used by the viewer. | iPhone | | `DeviceType` | **string* | :heavy_minus_sign: | The type of the device used by the viewer. | mobile | -| `CPU` | **string* | :heavy_minus_sign: | The CPU used by the viewer's device. | ARM | +| `ErrorRate` | **float64* | :heavy_minus_sign: | The error rate for the asset. | 0.1 | +| `ExitsBeforeStart` | **float64* | :heavy_minus_sign: | The percentage of sessions that existed before the asset started
playing.
| 0.5 | +| `Geohash` | **string* | :heavy_minus_sign: | Geographic encoding of the viewers location. Accurate to 3 digits. | 123 | | `Os` | **string* | :heavy_minus_sign: | The operating system used by the viewer. | iOS | -| `Browser` | **string* | :heavy_minus_sign: | The browser used by the viewer. | Safari | -| `BrowserEngine` | **string* | :heavy_minus_sign: | The browser engine used by the viewer's browser. | WebKit | -| `Continent` | **string* | :heavy_minus_sign: | The continent where the viewer is located. | North America | -| `Country` | **string* | :heavy_minus_sign: | The country where the viewer is located. | United States | +| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID associated with the metric. | 1bde4o2i6xycudoy | +| `PlaytimeMins` | *float64* | :heavy_check_mark: | The total playtime in minutes for the asset. | 10 | +| `RebufferRatio` | **float64* | :heavy_minus_sign: | The rebuffering ratio for the asset. | 0.1 | | `Subdivision` | **string* | :heavy_minus_sign: | The subdivision (e.g., state or province) where the viewer is
located.
| California | +| `Timestamp` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) when the metric was recorded. If the
query contains a time step, this timestamp will point to the
beginning of the time step period.
| 1587667174725 | | `Timezone` | **string* | :heavy_minus_sign: | The timezone where the viewer is located. | America/Los_Angeles | -| `Geohash` | **string* | :heavy_minus_sign: | Geographic encoding of the viewers location. Accurate to 3 digits. | 123 | -| `ViewCount` | *int64* | :heavy_check_mark: | The number of views for the asset. | 100 | -| `PlaytimeMins` | *float64* | :heavy_check_mark: | The total playtime in minutes for the asset. | 10 | | `TtffMs` | **float64* | :heavy_minus_sign: | The time-to-first-frame (TTFF) in milliseconds. | 100 | -| `RebufferRatio` | **float64* | :heavy_minus_sign: | The rebuffering ratio for the asset. | 0.1 | -| `ErrorRate` | **float64* | :heavy_minus_sign: | The error rate for the asset. | 0.1 | -| `ExitsBeforeStart` | **float64* | :heavy_minus_sign: | The percentage of sessions that existed before the asset started
playing.
| 0.5 | \ No newline at end of file +| `ViewCount` | *int64* | :heavy_check_mark: | The number of views for the asset. | 100 | +| `ViewerID` | **string* | :heavy_minus_sign: | The ID of the viewer associated with the metric. | 1bde4o2i6xycudoy | \ No newline at end of file diff --git a/docs/models/components/webhook.md b/docs/models/components/webhook.md index 99b44f9..7f513bf 100644 --- a/docs/models/components/webhook.md +++ b/docs/models/components/webhook.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | +| `Events` | [][components.Events](../../models/components/events.md) | :heavy_minus_sign: | N/A | [
"stream.started",
"stream.idle"
] | | `ID` | **string* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `Name` | *string* | :heavy_check_mark: | N/A | test_webhook | | ~~`Kind`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | webhook | -| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | +| `Name` | *string* | :heavy_check_mark: | N/A | test_webhook | | `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | -| `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | -| `Events` | [][components.Events](../../models/components/events.md) | :heavy_minus_sign: | N/A | [
"stream.started",
"stream.idle"
] | -| `URL` | *string* | :heavy_check_mark: | N/A | https://my-service.com/webhook | +| `Status` | [*components.WebhookStatus](../../models/components/webhookstatus.md) | :heavy_minus_sign: | status of webhook | | | `StreamID` | **string* | :heavy_minus_sign: | streamId of the stream on which the webhook is applied | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `Status` | [*components.Status](../../models/components/status.md) | :heavy_minus_sign: | status of webhook | | \ No newline at end of file +| `URL` | *string* | :heavy_check_mark: | N/A | https://my-service.com/webhook | +| ~~`UserID`~~ | **string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | \ No newline at end of file diff --git a/docs/models/components/webhookinput.md b/docs/models/components/webhookinput.md index 6306e96..9f0ba60 100644 --- a/docs/models/components/webhookinput.md +++ b/docs/models/components/webhookinput.md @@ -5,9 +5,9 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Events` | [][components.Events](../../models/components/events.md) | :heavy_minus_sign: | N/A | [
"stream.started",
"stream.idle"
] | | `Name` | *string* | :heavy_check_mark: | N/A | test_webhook | | `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | -| `Events` | [][components.Events](../../models/components/events.md) | :heavy_minus_sign: | N/A | [
"stream.started",
"stream.idle"
] | -| `URL` | *string* | :heavy_check_mark: | N/A | https://my-service.com/webhook | | `SharedSecret` | **string* | :heavy_minus_sign: | shared secret used to sign the webhook payload | my-secret | -| `StreamID` | **string* | :heavy_minus_sign: | streamId of the stream on which the webhook is applied | de7818e7-610a-4057-8f6f-b785dc1e6f88 | \ No newline at end of file +| `StreamID` | **string* | :heavy_minus_sign: | streamId of the stream on which the webhook is applied | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `URL` | *string* | :heavy_check_mark: | N/A | https://my-service.com/webhook | \ No newline at end of file diff --git a/docs/models/components/webhooklog.md b/docs/models/components/webhooklog.md index 2f7d596..df75464 100644 --- a/docs/models/components/webhooklog.md +++ b/docs/models/components/webhooklog.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `ID` | *string* | :heavy_check_mark: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `WebhookID` | *string* | :heavy_check_mark: | ID of the webhook this request was made for | de7818e7-610a-4057-8f6f-b785dc1e6f88 | -| `Event` | **string* | :heavy_minus_sign: | The event type that triggered the webhook request | stream.started | | `CreatedAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which webhook request object was
created
| 1587667174725 | | `Duration` | **float64* | :heavy_minus_sign: | The time taken (in seconds) to make the webhook request | 0.5 | -| `Success` | **bool* | :heavy_minus_sign: | Whether the webhook request was successful | true | +| `Event` | **string* | :heavy_minus_sign: | The event type that triggered the webhook request | stream.started | +| `ID` | *string* | :heavy_check_mark: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | | `Request` | [*components.Request](../../models/components/request.md) | :heavy_minus_sign: | N/A | | -| `Response` | [*components.Response](../../models/components/response.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +| `Response` | [*components.Response](../../models/components/response.md) | :heavy_minus_sign: | N/A | | +| `Success` | **bool* | :heavy_minus_sign: | Whether the webhook request was successful | true | +| `WebhookID` | *string* | :heavy_check_mark: | ID of the webhook this request was made for | de7818e7-610a-4057-8f6f-b785dc1e6f88 | \ No newline at end of file diff --git a/docs/models/components/webhookstatus.md b/docs/models/components/webhookstatus.md new file mode 100644 index 0000000..5862201 --- /dev/null +++ b/docs/models/components/webhookstatus.md @@ -0,0 +1,11 @@ +# WebhookStatus + +status of webhook + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `LastFailure` | [*components.LastFailure](../../models/components/lastfailure.md) | :heavy_minus_sign: | failure timestamp and error message with status code | | +| `LastTriggeredAt` | **float64* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the webhook last was
triggered
| 1587667174725 | \ No newline at end of file diff --git a/docs/models/operations/breakdownby.md b/docs/models/operations/breakdownby.md index d076d96..a4dd860 100644 --- a/docs/models/operations/breakdownby.md +++ b/docs/models/operations/breakdownby.md @@ -3,19 +3,6 @@ ## Values -| Name | Value | -| -------------------------- | -------------------------- | -| `BreakdownByPlaybackID` | playbackId | -| `BreakdownByDeviceType` | deviceType | -| `BreakdownByDevice` | device | -| `BreakdownByCPU` | cpu | -| `BreakdownByOs` | os | -| `BreakdownByBrowser` | browser | -| `BreakdownByBrowserEngine` | browserEngine | -| `BreakdownByContinent` | continent | -| `BreakdownByCountry` | country | -| `BreakdownBySubdivision` | subdivision | -| `BreakdownByTimezone` | timezone | -| `BreakdownByGeohash` | geohash | -| `BreakdownByViewerID` | viewerId | -| `BreakdownByCreatorID` | creatorId | \ No newline at end of file +| Name | Value | +| ---------------------- | ---------------------- | +| `BreakdownByCreatorID` | creatorId | \ No newline at end of file diff --git a/docs/models/operations/getcreatorviewershipmetricsqueryparambreakdownby.md b/docs/models/operations/getcreatorviewershipmetricsqueryparambreakdownby.md new file mode 100644 index 0000000..d84e494 --- /dev/null +++ b/docs/models/operations/getcreatorviewershipmetricsqueryparambreakdownby.md @@ -0,0 +1,18 @@ +# GetCreatorViewershipMetricsQueryParamBreakdownBy + + +## Values + +| Name | Value | +| --------------------------------------------------------------- | --------------------------------------------------------------- | +| `GetCreatorViewershipMetricsQueryParamBreakdownByDeviceType` | deviceType | +| `GetCreatorViewershipMetricsQueryParamBreakdownByDevice` | device | +| `GetCreatorViewershipMetricsQueryParamBreakdownByCPU` | cpu | +| `GetCreatorViewershipMetricsQueryParamBreakdownByOs` | os | +| `GetCreatorViewershipMetricsQueryParamBreakdownByBrowser` | browser | +| `GetCreatorViewershipMetricsQueryParamBreakdownByBrowserEngine` | browserEngine | +| `GetCreatorViewershipMetricsQueryParamBreakdownByContinent` | continent | +| `GetCreatorViewershipMetricsQueryParamBreakdownByCountry` | country | +| `GetCreatorViewershipMetricsQueryParamBreakdownBySubdivision` | subdivision | +| `GetCreatorViewershipMetricsQueryParamBreakdownByTimezone` | timezone | +| `GetCreatorViewershipMetricsQueryParamBreakdownByViewerID` | viewerId | \ No newline at end of file diff --git a/docs/models/operations/getcreatorviewershipmetricsqueryparamtimestep.md b/docs/models/operations/getcreatorviewershipmetricsqueryparamtimestep.md new file mode 100644 index 0000000..e0fa131 --- /dev/null +++ b/docs/models/operations/getcreatorviewershipmetricsqueryparamtimestep.md @@ -0,0 +1,14 @@ +# GetCreatorViewershipMetricsQueryParamTimeStep + +The time step to aggregate viewership metrics by + + +## Values + +| Name | Value | +| ---------------------------------------------------- | ---------------------------------------------------- | +| `GetCreatorViewershipMetricsQueryParamTimeStepHour` | hour | +| `GetCreatorViewershipMetricsQueryParamTimeStepDay` | day | +| `GetCreatorViewershipMetricsQueryParamTimeStepWeek` | week | +| `GetCreatorViewershipMetricsQueryParamTimeStepMonth` | month | +| `GetCreatorViewershipMetricsQueryParamTimeStepYear` | year | \ No newline at end of file diff --git a/docs/models/operations/getcreatorviewershipmetricsrequest.md b/docs/models/operations/getcreatorviewershipmetricsrequest.md index ea3cbc9..30d6772 100644 --- a/docs/models/operations/getcreatorviewershipmetricsrequest.md +++ b/docs/models/operations/getcreatorviewershipmetricsrequest.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `From` | [*operations.QueryParamFrom](../../models/operations/queryparamfrom.md) | :heavy_minus_sign: | Start timestamp for the query range (inclusive) | -| `To` | [*operations.QueryParamTo](../../models/operations/queryparamto.md) | :heavy_minus_sign: | End timestamp for the query range (exclusive) | -| `TimeStep` | [*operations.QueryParamTimeStep](../../models/operations/queryparamtimestep.md) | :heavy_minus_sign: | The time step to aggregate viewership metrics by | -| `AssetID` | **string* | :heavy_minus_sign: | The asset ID to filter metrics for | -| `StreamID` | **string* | :heavy_minus_sign: | The stream ID to filter metrics for | -| `CreatorID` | **string* | :heavy_minus_sign: | The creator ID to filter the query results | -| `BreakdownBy` | [][operations.QueryParamBreakdownBy](../../models/operations/queryparambreakdownby.md) | :heavy_minus_sign: | The list of fields to break down the query results. Specify this
query-string multiple times to break down by multiple fields.
| \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- | +| `From` | [*operations.QueryParamFrom](../../models/operations/queryparamfrom.md) | :heavy_minus_sign: | Start timestamp for the query range (inclusive) | +| `To` | [*operations.QueryParamTo](../../models/operations/queryparamto.md) | :heavy_minus_sign: | End timestamp for the query range (exclusive) | +| `TimeStep` | [*operations.GetCreatorViewershipMetricsQueryParamTimeStep](../../models/operations/getcreatorviewershipmetricsqueryparamtimestep.md) | :heavy_minus_sign: | The time step to aggregate viewership metrics by | +| `AssetID` | **string* | :heavy_minus_sign: | The asset ID to filter metrics for | +| `StreamID` | **string* | :heavy_minus_sign: | The stream ID to filter metrics for | +| `CreatorID` | **string* | :heavy_minus_sign: | The creator ID to filter the query results | +| `BreakdownBy` | [][operations.GetCreatorViewershipMetricsQueryParamBreakdownBy](../../models/operations/getcreatorviewershipmetricsqueryparambreakdownby.md) | :heavy_minus_sign: | The list of fields to break down the query results. Specify this
query-string multiple times to break down by multiple fields.
| \ No newline at end of file diff --git a/docs/models/operations/getpublicviewershipmetricsdata.md b/docs/models/operations/getpublicviewershipmetricsdata.md index faa9e80..39e26f0 100644 --- a/docs/models/operations/getpublicviewershipmetricsdata.md +++ b/docs/models/operations/getpublicviewershipmetricsdata.md @@ -9,7 +9,7 @@ asset. Either playbackId or dStorageUrl will be set. | Field | Type | Required | Description | Example | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID associated with the metric. | 1bde4o2i6xycudoy | | `DStorageURL` | **string* | :heavy_minus_sign: | The URL of the distributed storage used for the asset | ipfs://QmZ4 | -| `ViewCount` | **int64* | :heavy_minus_sign: | The number of views for the asset. | 100 | -| `PlaytimeMins` | **float64* | :heavy_minus_sign: | The total playtime in minutes for the asset. | 10 | \ No newline at end of file +| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID associated with the metric. | 1bde4o2i6xycudoy | +| `PlaytimeMins` | **float64* | :heavy_minus_sign: | The total playtime in minutes for the asset. | 10 | +| `ViewCount` | **int64* | :heavy_minus_sign: | The number of views for the asset. | 100 | \ No newline at end of file diff --git a/docs/models/operations/getusagemetricsqueryparambreakdownby.md b/docs/models/operations/getusagemetricsqueryparambreakdownby.md deleted file mode 100644 index 29e924d..0000000 --- a/docs/models/operations/getusagemetricsqueryparambreakdownby.md +++ /dev/null @@ -1,8 +0,0 @@ -# GetUsageMetricsQueryParamBreakdownBy - - -## Values - -| Name | Value | -| ----------------------------------------------- | ----------------------------------------------- | -| `GetUsageMetricsQueryParamBreakdownByCreatorID` | creatorId | \ No newline at end of file diff --git a/docs/models/operations/getusagemetricsqueryparamtimestep.md b/docs/models/operations/getusagemetricsqueryparamtimestep.md deleted file mode 100644 index fd208d3..0000000 --- a/docs/models/operations/getusagemetricsqueryparamtimestep.md +++ /dev/null @@ -1,12 +0,0 @@ -# GetUsageMetricsQueryParamTimeStep - -The time step to aggregate viewership metrics by - - - -## Values - -| Name | Value | -| --------------------------------------- | --------------------------------------- | -| `GetUsageMetricsQueryParamTimeStepHour` | hour | -| `GetUsageMetricsQueryParamTimeStepDay` | day | \ No newline at end of file diff --git a/docs/models/operations/getusagemetricsrequest.md b/docs/models/operations/getusagemetricsrequest.md index d076a0a..25a442c 100644 --- a/docs/models/operations/getusagemetricsrequest.md +++ b/docs/models/operations/getusagemetricsrequest.md @@ -3,10 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `From` | **int64* | :heavy_minus_sign: | Start millis timestamp for the query range (inclusive)
| -| `To` | **int64* | :heavy_minus_sign: | End millis timestamp for the query range (exclusive)
| -| `TimeStep` | [*operations.GetUsageMetricsQueryParamTimeStep](../../models/operations/getusagemetricsqueryparamtimestep.md) | :heavy_minus_sign: | The time step to aggregate viewership metrics by
| -| `CreatorID` | **string* | :heavy_minus_sign: | The creator ID to filter the query results
| -| `BreakdownBy` | [][operations.GetUsageMetricsQueryParamBreakdownBy](../../models/operations/getusagemetricsqueryparambreakdownby.md) | :heavy_minus_sign: | The list of fields to break down the query results. Currently the
only supported breakdown is by `creatorId`.
| \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `From` | **int64* | :heavy_minus_sign: | Start millis timestamp for the query range (inclusive)
| +| `To` | **int64* | :heavy_minus_sign: | End millis timestamp for the query range (exclusive)
| +| `TimeStep` | [*operations.TimeStep](../../models/operations/timestep.md) | :heavy_minus_sign: | The time step to aggregate viewership metrics by
| +| `CreatorID` | **string* | :heavy_minus_sign: | The creator ID to filter the query results
| +| `BreakdownBy` | [][operations.BreakdownBy](../../models/operations/breakdownby.md) | :heavy_minus_sign: | The list of fields to break down the query results. Currently the
only supported breakdown is by `creatorId`.
| \ No newline at end of file diff --git a/docs/models/operations/getviewershipmetricsrequest.md b/docs/models/operations/getviewershipmetricsrequest.md index e778436..c85baad 100644 --- a/docs/models/operations/getviewershipmetricsrequest.md +++ b/docs/models/operations/getviewershipmetricsrequest.md @@ -8,8 +8,8 @@ | `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to filter the query results. This can be a canonical
playback ID from Livepeer assets or streams, or dStorage identifiers
for assets
| | `From` | [*operations.From](../../models/operations/from.md) | :heavy_minus_sign: | Start timestamp for the query range (inclusive) | | `To` | [*operations.To](../../models/operations/to.md) | :heavy_minus_sign: | End timestamp for the query range (exclusive) | -| `TimeStep` | [*operations.TimeStep](../../models/operations/timestep.md) | :heavy_minus_sign: | The time step to aggregate viewership metrics by | +| `TimeStep` | [*operations.QueryParamTimeStep](../../models/operations/queryparamtimestep.md) | :heavy_minus_sign: | The time step to aggregate viewership metrics by | | `AssetID` | **string* | :heavy_minus_sign: | The asset ID to filter metrics for | | `StreamID` | **string* | :heavy_minus_sign: | The stream ID to filter metrics for | | `CreatorID` | **string* | :heavy_minus_sign: | The creator ID to filter the query results | -| `BreakdownBy` | [][operations.BreakdownBy](../../models/operations/breakdownby.md) | :heavy_minus_sign: | The list of fields to break down the query results. Specify this
query-string multiple times to break down by multiple fields.
| \ No newline at end of file +| `BreakdownBy` | [][operations.QueryParamBreakdownBy](../../models/operations/queryparambreakdownby.md) | :heavy_minus_sign: | The list of fields to break down the query results. Specify this
query-string multiple times to break down by multiple fields.
| \ No newline at end of file diff --git a/docs/models/operations/queryparambreakdownby.md b/docs/models/operations/queryparambreakdownby.md index 1444f8b..6dacc0e 100644 --- a/docs/models/operations/queryparambreakdownby.md +++ b/docs/models/operations/queryparambreakdownby.md @@ -5,6 +5,7 @@ | Name | Value | | ------------------------------------ | ------------------------------------ | +| `QueryParamBreakdownByPlaybackID` | playbackId | | `QueryParamBreakdownByDeviceType` | deviceType | | `QueryParamBreakdownByDevice` | device | | `QueryParamBreakdownByCPU` | cpu | @@ -15,4 +16,6 @@ | `QueryParamBreakdownByCountry` | country | | `QueryParamBreakdownBySubdivision` | subdivision | | `QueryParamBreakdownByTimezone` | timezone | -| `QueryParamBreakdownByViewerID` | viewerId | \ No newline at end of file +| `QueryParamBreakdownByGeohash` | geohash | +| `QueryParamBreakdownByViewerID` | viewerId | +| `QueryParamBreakdownByCreatorID` | creatorId | \ No newline at end of file diff --git a/docs/models/operations/requestuploaddata.md b/docs/models/operations/requestuploaddata.md index 0833a57..576e62e 100644 --- a/docs/models/operations/requestuploaddata.md +++ b/docs/models/operations/requestuploaddata.md @@ -7,7 +7,7 @@ Success | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `URL` | *string* | :heavy_check_mark: | The direct upload endpoint for which supports PUT requests. **It is recommended to use the Tus endpoint for a better upload experience.** | https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q | -| `TusEndpoint` | *string* | :heavy_check_mark: | The [Tus-compatible](https://tus.io/) endpoint for resumable uploads. **This is the recommended way to upload assets.** See the [Tus-js](https://github.com/tus/tus-js-client) client for more information. | https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q | | `Asset` | [components.Asset](../../models/components/asset.md) | :heavy_check_mark: | N/A | | -| `Task` | [operations.Task](../../models/operations/task.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +| `Task` | [operations.Task](../../models/operations/task.md) | :heavy_check_mark: | N/A | | +| `TusEndpoint` | *string* | :heavy_check_mark: | The [Tus-compatible](https://tus.io/) endpoint for resumable uploads. **This is the recommended way to upload assets.** See the [Tus-js](https://github.com/tus/tus-js-client) client for more information. | https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q | +| `URL` | *string* | :heavy_check_mark: | The direct upload endpoint for which supports PUT requests. **It is recommended to use the Tus endpoint for a better upload experience.** | https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q | \ No newline at end of file diff --git a/docs/models/operations/timestep.md b/docs/models/operations/timestep.md index 478aaaf..1867275 100644 --- a/docs/models/operations/timestep.md +++ b/docs/models/operations/timestep.md @@ -3,12 +3,10 @@ The time step to aggregate viewership metrics by + ## Values -| Name | Value | -| --------------- | --------------- | -| `TimeStepHour` | hour | -| `TimeStepDay` | day | -| `TimeStepWeek` | week | -| `TimeStepMonth` | month | -| `TimeStepYear` | year | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `TimeStepHour` | hour | +| `TimeStepDay` | day | \ No newline at end of file diff --git a/docs/models/sdkerrors/error.md b/docs/models/sdkerrors/error.md index b644f4b..353e51e 100644 --- a/docs/models/sdkerrors/error.md +++ b/docs/models/sdkerrors/error.md @@ -1,5 +1,7 @@ # Error +Error + ## Fields diff --git a/docs/sdks/accesscontrol/README.md b/docs/sdks/accesscontrol/README.md index dc80ce8..b75bc11 100644 --- a/docs/sdks/accesscontrol/README.md +++ b/docs/sdks/accesscontrol/README.md @@ -7,17 +7,15 @@ Operations related to access control/signing keys api ### Available Operations -* [Create](#create) - Create a signing key * [GetAll](#getall) - Retrieves signing keys +* [Create](#create) - Create a signing key * [Delete](#delete) - Delete Signing Key * [Get](#get) - Retrieves a signing key * [Update](#update) - Update a signing key -## Create - -The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. -Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one. +## GetAll +Retrieves signing keys ### Example Usage @@ -36,11 +34,11 @@ func main() { ) ctx := context.Background() - res, err := s.AccessControl.Create(ctx) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.SigningKey != nil { + if res.Data != nil { // handle response } } @@ -55,14 +53,16 @@ func main() { ### Response -**[*operations.CreateSigningKeyResponse](../../models/operations/createsigningkeyresponse.md), error** +**[*operations.GetSigningKeysResponse](../../models/operations/getsigningkeysresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetAll +## Create + +The publicKey is a representation of the public key, encoded as base 64 and is passed as a string, and the privateKey is displayed only on creation. This is the only moment where the client can save the private key, otherwise it will be lost. Remember to decode your string when signing JWTs. +Up to 10 signing keys can be generated, after that you must delete at least one signing key to create a new one. -Retrieves signing keys ### Example Usage @@ -81,11 +81,11 @@ func main() { ) ctx := context.Background() - res, err := s.AccessControl.GetAll(ctx) + res, err := s.AccessControl.Create(ctx) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.SigningKey != nil { // handle response } } @@ -100,7 +100,7 @@ func main() { ### Response -**[*operations.GetSigningKeysResponse](../../models/operations/getsigningkeysresponse.md), error** +**[*operations.CreateSigningKeyResponse](../../models/operations/createsigningkeyresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/asset/README.md b/docs/sdks/asset/README.md index 1d2d426..2dc75b4 100644 --- a/docs/sdks/asset/README.md +++ b/docs/sdks/asset/README.md @@ -8,11 +8,11 @@ Operations related to asset/vod api ### Available Operations * [GetAll](#getall) - Retrieve assets -* [Create](#create) - Upload an asset -* [CreateViaURL](#createviaurl) - Upload asset via URL +* [Delete](#delete) - Delete an asset * [Get](#get) - Retrieves an asset * [Update](#update) - Patch an asset -* [Delete](#delete) - Delete an asset +* [Create](#create) - Upload an asset +* [CreateViaURL](#createviaurl) - Upload asset via URL ## GetAll @@ -59,6 +59,158 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | +## Delete + +Delete an asset + +### Example Usage + +```go +package main + +import( + livepeergo "github.com/livepeer/livepeer-go" + "context" + "log" +) + +func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) + var assetID string = "" + ctx := context.Background() + res, err := s.Asset.Delete(ctx, assetID) + if err != nil { + log.Fatal(err) + } + if res != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `assetID` | *string* | :heavy_check_mark: | ID of the asset | + + +### Response + +**[*operations.DeleteAssetResponse](../../models/operations/deleteassetresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## Get + +Retrieves an asset + +### Example Usage + +```go +package main + +import( + livepeergo "github.com/livepeer/livepeer-go" + "context" + "log" +) + +func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) + var assetID string = "" + ctx := context.Background() + res, err := s.Asset.Get(ctx, assetID) + if err != nil { + log.Fatal(err) + } + if res.Asset != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `assetID` | *string* | :heavy_check_mark: | ID of the asset | + + +### Response + +**[*operations.GetAssetResponse](../../models/operations/getassetresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## Update + +Patch an asset + +### Example Usage + +```go +package main + +import( + livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" + "context" + "log" +) + +func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) + var assetID string = "" + + assetPatchPayload := components.AssetPatchPayload{ + Name: livepeergo.String("filename.mp4"), + PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), + Type: components.TypeWebhook, + WebhookContext: map[string]any{ + "streamerId": "my-custom-id", + }, + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), + }, + } + ctx := context.Background() + res, err := s.Asset.Update(ctx, assetID, assetPatchPayload) + if err != nil { + log.Fatal(err) + } + if res.Asset != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `assetID` | *string* | :heavy_check_mark: | ID of the asset | +| `assetPatchPayload` | [components.AssetPatchPayload](../../models/components/assetpatchpayload.md) | :heavy_check_mark: | N/A | + + +### Response + +**[*operations.UpdateAssetResponse](../../models/operations/updateassetresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4xx-5xx | */* | + ## Create To upload an asset, your first need to request for a direct upload URL @@ -152,28 +304,28 @@ func main() { ) request := components.NewAssetPayload{ Name: "filename.mp4", - StaticMp4: livepeergo.Bool(true), PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, - RefreshInterval: livepeergo.Float64(600), + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), }, Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), Bitrate: 3000000, - Quality: livepeergo.Int64(23), + Encoder: components.EncoderH264.ToPointer(), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), - Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), - Encoder: components.TranscodeProfileEncoderH264.ToPointer(), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), }, }, + StaticMp4: livepeergo.Bool(true), } ctx := context.Background() res, err := s.Asset.Create(ctx, request) @@ -223,29 +375,29 @@ func main() { ) request := components.NewAssetFromURLPayload{ Name: "filename.mp4", - StaticMp4: livepeergo.Bool(true), PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, - RefreshInterval: livepeergo.Float64(600), + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), }, - URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), Bitrate: 3000000, - Quality: livepeergo.Int64(23), + Encoder: components.EncoderH264.ToPointer(), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), - Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), - Encoder: components.TranscodeProfileEncoderH264.ToPointer(), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), }, }, + StaticMp4: livepeergo.Bool(true), + URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", } ctx := context.Background() res, err := s.Asset.CreateViaURL(ctx, request) @@ -272,155 +424,3 @@ func main() { | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | - -## Get - -Retrieves an asset - -### Example Usage - -```go -package main - -import( - livepeergo "github.com/livepeer/livepeer-go" - "context" - "log" -) - -func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - var assetID string = "" - ctx := context.Background() - res, err := s.Asset.Get(ctx, assetID) - if err != nil { - log.Fatal(err) - } - if res.Asset != nil { - // handle response - } -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `assetID` | *string* | :heavy_check_mark: | ID of the asset | - - -### Response - -**[*operations.GetAssetResponse](../../models/operations/getassetresponse.md), error** -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | - -## Update - -Patch an asset - -### Example Usage - -```go -package main - -import( - livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" - "context" - "log" -) - -func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - var assetID string = "" - - assetPatchPayload := components.AssetPatchPayload{ - Name: livepeergo.String("filename.mp4"), - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - } - ctx := context.Background() - res, err := s.Asset.Update(ctx, assetID, assetPatchPayload) - if err != nil { - log.Fatal(err) - } - if res.Asset != nil { - // handle response - } -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `assetID` | *string* | :heavy_check_mark: | ID of the asset | -| `assetPatchPayload` | [components.AssetPatchPayload](../../models/components/assetpatchpayload.md) | :heavy_check_mark: | N/A | - - -### Response - -**[*operations.UpdateAssetResponse](../../models/operations/updateassetresponse.md), error** -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | - -## Delete - -Delete an asset - -### Example Usage - -```go -package main - -import( - livepeergo "github.com/livepeer/livepeer-go" - "context" - "log" -) - -func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - var assetID string = "" - ctx := context.Background() - res, err := s.Asset.Delete(ctx, assetID) - if err != nil { - log.Fatal(err) - } - if res != nil { - // handle response - } -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `assetID` | *string* | :heavy_check_mark: | ID of the asset | - - -### Response - -**[*operations.DeleteAssetResponse](../../models/operations/deleteassetresponse.md), error** -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/metrics/README.md b/docs/sdks/metrics/README.md index 0c6ea58..3c51fa7 100644 --- a/docs/sdks/metrics/README.md +++ b/docs/sdks/metrics/README.md @@ -7,15 +7,14 @@ Operations related to metrics api ### Available Operations +* [GetUsage](#getusage) - Query usage metrics * [GetViewership](#getviewership) - Query viewership metrics * [GetCreatorViewership](#getcreatorviewership) - Query creator viewership metrics * [GetPublicViewership](#getpublicviewership) - Query public total views metrics -* [GetUsage](#getusage) - Query usage metrics - -## GetViewership -Requires a private (non-CORS) API key to be used. +## GetUsage +Query usage metrics ### Example Usage @@ -33,13 +32,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetViewershipMetricsRequest{} + request := operations.GetUsageMetricsRequest{} ctx := context.Background() - res, err := s.Metrics.GetViewership(ctx, request) + res, err := s.Metrics.GetUsage(ctx, request) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.UsageMetric != nil { // handle response } } @@ -47,22 +46,22 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `request` | [operations.GetViewershipMetricsRequest](../../models/operations/getviewershipmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetUsageMetricsRequest](../../models/operations/getusagemetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[*operations.GetViewershipMetricsResponse](../../models/operations/getviewershipmetricsresponse.md), error** +**[*operations.GetUsageMetricsResponse](../../models/operations/getusagemetricsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetCreatorViewership +## GetViewership -Requires a proof of ownership to be sent in the request, which for now is just the assetId or streamId parameters (1 of those must be in the query-string). +Requires a private (non-CORS) API key to be used. ### Example Usage @@ -81,9 +80,9 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetCreatorViewershipMetricsRequest{} + request := operations.GetViewershipMetricsRequest{} ctx := context.Background() - res, err := s.Metrics.GetCreatorViewership(ctx, request) + res, err := s.Metrics.GetViewership(ctx, request) if err != nil { log.Fatal(err) } @@ -95,24 +94,22 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `request` | [operations.GetCreatorViewershipMetricsRequest](../../models/operations/getcreatorviewershipmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetViewershipMetricsRequest](../../models/operations/getviewershipmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[*operations.GetCreatorViewershipMetricsResponse](../../models/operations/getcreatorviewershipmetricsresponse.md), error** +**[*operations.GetViewershipMetricsResponse](../../models/operations/getviewershipmetricsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetPublicViewership +## GetCreatorViewership -Allows querying for the public metrics for viewership about a video. -This can be called from the frontend with a CORS key, or even -unauthenticated. +Requires a proof of ownership to be sent in the request, which for now is just the assetId or streamId parameters (1 of those must be in the query-string). ### Example Usage @@ -122,6 +119,7 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -130,9 +128,9 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - var playbackID string = "" + request := operations.GetCreatorViewershipMetricsRequest{} ctx := context.Background() - res, err := s.Metrics.GetPublicViewership(ctx, playbackID) + res, err := s.Metrics.GetCreatorViewership(ctx, request) if err != nil { log.Fatal(err) } @@ -144,22 +142,25 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `playbackID` | *string* | :heavy_check_mark: | The playback ID to filter the query results. This can be a canonical
playback ID from Livepeer assets or streams, or dStorage identifiers
for assets
| +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetCreatorViewershipMetricsRequest](../../models/operations/getcreatorviewershipmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response -**[*operations.GetPublicViewershipMetricsResponse](../../models/operations/getpublicviewershipmetricsresponse.md), error** +**[*operations.GetCreatorViewershipMetricsResponse](../../models/operations/getcreatorviewershipmetricsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetUsage +## GetPublicViewership + +Allows querying for the public metrics for viewership about a video. +This can be called from the frontend with a CORS key, or even +unauthenticated. -Query usage metrics ### Example Usage @@ -168,7 +169,6 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -177,13 +177,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetUsageMetricsRequest{} + var playbackID string = "" ctx := context.Background() - res, err := s.Metrics.GetUsage(ctx, request) + res, err := s.Metrics.GetPublicViewership(ctx, playbackID) if err != nil { log.Fatal(err) } - if res.UsageMetric != nil { + if res.Data != nil { // handle response } } @@ -191,15 +191,15 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `request` | [operations.GetUsageMetricsRequest](../../models/operations/getusagemetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playbackID` | *string* | :heavy_check_mark: | The playback ID to filter the query results. This can be a canonical
playback ID from Livepeer assets or streams, or dStorage identifiers
for assets
| ### Response -**[*operations.GetUsageMetricsResponse](../../models/operations/getusagemetricsresponse.md), error** +**[*operations.GetPublicViewershipMetricsResponse](../../models/operations/getpublicviewershipmetricsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/multistream/README.md b/docs/sdks/multistream/README.md index 664765d..41f1f8d 100644 --- a/docs/sdks/multistream/README.md +++ b/docs/sdks/multistream/README.md @@ -9,9 +9,9 @@ Operations related to multistream api * [GetAll](#getall) - Retrieve Multistream Targets * [Create](#create) - Create a multistream target +* [Delete](#delete) - Delete a multistream target * [Get](#get) - Retrieve a multistream target * [Update](#update) - Update Multistream Target -* [Delete](#delete) - Delete a multistream target ## GetAll @@ -107,9 +107,11 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Get +## Delete + +Make sure to remove any references to the target on existing +streams before actually deleting it from the API. -Retrieve a multistream target ### Example Usage @@ -128,11 +130,11 @@ func main() { ) var id string = "" ctx := context.Background() - res, err := s.Multistream.Get(ctx, id) + res, err := s.Multistream.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.MultistreamTarget != nil { + if res != nil { // handle response } } @@ -148,14 +150,14 @@ func main() { ### Response -**[*operations.GetMultistreamTargetResponse](../../models/operations/getmultistreamtargetresponse.md), error** +**[*operations.DeleteMultistreamTargetResponse](../../models/operations/deletemultistreamtargetresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Update +## Get -Update Multistream Target +Retrieve a multistream target ### Example Usage @@ -164,7 +166,6 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -174,16 +175,12 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" - - multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{ - URL: "rtmps://live.my-service.tv/channel/secretKey", - } ctx := context.Background() - res, err := s.Multistream.Update(ctx, id, multistreamTargetPatchPayload) + res, err := s.Multistream.Get(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.MultistreamTarget != nil { // handle response } } @@ -191,25 +188,22 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the multistream target | -| `multistreamTargetPatchPayload` | [components.MultistreamTargetPatchPayload](../../models/components/multistreamtargetpatchpayload.md) | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the multistream target | ### Response -**[*operations.UpdateMultistreamTargetResponse](../../models/operations/updatemultistreamtargetresponse.md), error** +**[*operations.GetMultistreamTargetResponse](../../models/operations/getmultistreamtargetresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Delete - -Make sure to remove any references to the target on existing -streams before actually deleting it from the API. +## Update +Update Multistream Target ### Example Usage @@ -218,6 +212,7 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -227,8 +222,12 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" + + multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{ + URL: "rtmps://live.my-service.tv/channel/secretKey", + } ctx := context.Background() - res, err := s.Multistream.Delete(ctx, id) + res, err := s.Multistream.Update(ctx, id, multistreamTargetPatchPayload) if err != nil { log.Fatal(err) } @@ -240,15 +239,16 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the multistream target | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the multistream target | +| `multistreamTargetPatchPayload` | [components.MultistreamTargetPatchPayload](../../models/components/multistreamtargetpatchpayload.md) | :heavy_check_mark: | N/A | ### Response -**[*operations.DeleteMultistreamTargetResponse](../../models/operations/deletemultistreamtargetresponse.md), error** +**[*operations.UpdateMultistreamTargetResponse](../../models/operations/updatemultistreamtargetresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/room/README.md b/docs/sdks/room/README.md index a0a0b01..6c5eeeb 100644 --- a/docs/sdks/room/README.md +++ b/docs/sdks/room/README.md @@ -8,14 +8,14 @@ Operations related to rooms api ### Available Operations * [~~Create~~](#create) - Create a room :warning: **Deprecated** -* [~~Get~~](#get) - Retrieve a room :warning: **Deprecated** * [~~Delete~~](#delete) - Delete a room :warning: **Deprecated** -* [~~StartEgress~~](#startegress) - Start room RTMP egress :warning: **Deprecated** +* [~~Get~~](#get) - Retrieve a room :warning: **Deprecated** * [~~StopEgress~~](#stopegress) - Stop room RTMP egress :warning: **Deprecated** +* [~~StartEgress~~](#startegress) - Start room RTMP egress :warning: **Deprecated** * [~~CreateUser~~](#createuser) - Create a room user :warning: **Deprecated** +* [~~DeleteUser~~](#deleteuser) - Remove a user from the room :warning: **Deprecated** * [~~GetUser~~](#getuser) - Get user details :warning: **Deprecated** * [~~UpdateUser~~](#updateuser) - Update a room user :warning: **Deprecated** -* [~~DeleteUser~~](#deleteuser) - Remove a user from the room :warning: **Deprecated** ## ~~Create~~ @@ -65,9 +65,9 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~Get~~ +## ~~Delete~~ -Retrieve a room +Delete a room > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -88,11 +88,11 @@ func main() { ) var id string = "" ctx := context.Background() - res, err := s.Room.Get(ctx, id) + res, err := s.Room.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.Room != nil { + if res != nil { // handle response } } @@ -108,14 +108,14 @@ func main() { ### Response -**[*operations.GetRoomResponse](../../models/operations/getroomresponse.md), error** +**[*operations.DeleteRoomResponse](../../models/operations/deleteroomresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~Delete~~ +## ~~Get~~ -Delete a room +Retrieve a room > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -136,11 +136,11 @@ func main() { ) var id string = "" ctx := context.Background() - res, err := s.Room.Delete(ctx, id) + res, err := s.Room.Get(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.Room != nil { // handle response } } @@ -156,16 +156,14 @@ func main() { ### Response -**[*operations.DeleteRoomResponse](../../models/operations/deleteroomresponse.md), error** +**[*operations.GetRoomResponse](../../models/operations/getroomresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~StartEgress~~ - -Create a livestream for your room. -This allows you to leverage livestreaming features like recording and HLS output. +## ~~StopEgress~~ +Stop room RTMP egress > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -176,7 +174,6 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -186,12 +183,8 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" - - roomEgressPayload := components.RoomEgressPayload{ - StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", - } ctx := context.Background() - res, err := s.Room.StartEgress(ctx, id, roomEgressPayload) + res, err := s.Room.StopEgress(ctx, id) if err != nil { log.Fatal(err) } @@ -203,23 +196,24 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | N/A | -| `roomEgressPayload` | [components.RoomEgressPayload](../../models/components/roomegresspayload.md) | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | N/A | ### Response -**[*operations.StartRoomEgressResponse](../../models/operations/startroomegressresponse.md), error** +**[*operations.StopRoomEgressResponse](../../models/operations/stoproomegressresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~StopEgress~~ +## ~~StartEgress~~ + +Create a livestream for your room. +This allows you to leverage livestreaming features like recording and HLS output. -Stop room RTMP egress > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -230,6 +224,7 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -239,8 +234,12 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" + + roomEgressPayload := components.RoomEgressPayload{ + StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", + } ctx := context.Background() - res, err := s.Room.StopEgress(ctx, id) + res, err := s.Room.StartEgress(ctx, id, roomEgressPayload) if err != nil { log.Fatal(err) } @@ -252,15 +251,16 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | N/A | +| `roomEgressPayload` | [components.RoomEgressPayload](../../models/components/roomegresspayload.md) | :heavy_check_mark: | N/A | ### Response -**[*operations.StopRoomEgressResponse](../../models/operations/stoproomegressresponse.md), error** +**[*operations.StartRoomEgressResponse](../../models/operations/startroomegressresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | @@ -293,9 +293,9 @@ func main() { var id string = "" roomUserPayload := components.RoomUserPayload{ - Name: "name", CanPublish: livepeergo.Bool(true), CanPublishData: livepeergo.Bool(true), + Name: "name", } ctx := context.Background() res, err := s.Room.CreateUser(ctx, id, roomUserPayload) @@ -324,9 +324,9 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~GetUser~~ +## ~~DeleteUser~~ -Get user details +Remove a user from the room > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -349,11 +349,11 @@ func main() { var userID string = "" ctx := context.Background() - res, err := s.Room.GetUser(ctx, id, userID) + res, err := s.Room.DeleteUser(ctx, id, userID) if err != nil { log.Fatal(err) } - if res.GetRoomUserResponse != nil { + if res != nil { // handle response } } @@ -370,14 +370,14 @@ func main() { ### Response -**[*operations.GetRoomUserResponse](../../models/operations/getroomuserresponse.md), error** +**[*operations.DeleteRoomUserResponse](../../models/operations/deleteroomuserresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~UpdateUser~~ +## ~~GetUser~~ -Update properties for a user. +Get user details > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -388,7 +388,6 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -400,17 +399,12 @@ func main() { var id string = "" var userID string = "" - - roomUserUpdatePayload := components.RoomUserUpdatePayload{ - CanPublish: livepeergo.Bool(true), - CanPublishData: livepeergo.Bool(true), - } ctx := context.Background() - res, err := s.Room.UpdateUser(ctx, id, userID, roomUserUpdatePayload) + res, err := s.Room.GetUser(ctx, id, userID) if err != nil { log.Fatal(err) } - if res != nil { + if res.GetRoomUserResponse != nil { // handle response } } @@ -418,24 +412,23 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | N/A | -| `userID` | *string* | :heavy_check_mark: | N/A | -| `roomUserUpdatePayload` | [components.RoomUserUpdatePayload](../../models/components/roomuserupdatepayload.md) | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | N/A | +| `userID` | *string* | :heavy_check_mark: | N/A | ### Response -**[*operations.UpdateRoomUserResponse](../../models/operations/updateroomuserresponse.md), error** +**[*operations.GetRoomUserResponse](../../models/operations/getroomuserresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## ~~DeleteUser~~ +## ~~UpdateUser~~ -Remove a user from the room +Update properties for a user. > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. @@ -446,6 +439,7 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -457,8 +451,13 @@ func main() { var id string = "" var userID string = "" + + roomUserUpdatePayload := components.RoomUserUpdatePayload{ + CanPublish: livepeergo.Bool(true), + CanPublishData: livepeergo.Bool(true), + } ctx := context.Background() - res, err := s.Room.DeleteUser(ctx, id, userID) + res, err := s.Room.UpdateUser(ctx, id, userID, roomUserUpdatePayload) if err != nil { log.Fatal(err) } @@ -470,16 +469,17 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | N/A | -| `userID` | *string* | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | N/A | +| `userID` | *string* | :heavy_check_mark: | N/A | +| `roomUserUpdatePayload` | [components.RoomUserUpdatePayload](../../models/components/roomuserupdatepayload.md) | :heavy_check_mark: | N/A | ### Response -**[*operations.DeleteRoomUserResponse](../../models/operations/deleteroomuserresponse.md), error** +**[*operations.UpdateRoomUserResponse](../../models/operations/updateroomuserresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/session/README.md b/docs/sdks/session/README.md index d08205d..bca7f31 100644 --- a/docs/sdks/session/README.md +++ b/docs/sdks/session/README.md @@ -7,14 +7,14 @@ Operations related to session api ### Available Operations -* [GetClips](#getclips) - Retrieve clips of a session * [GetAll](#getall) - Retrieve sessions * [Get](#get) - Retrieve a session +* [GetClips](#getclips) - Retrieve clips of a session * [GetRecorded](#getrecorded) - Retrieve Recorded Sessions -## GetClips +## GetAll -Retrieve clips of a session +Retrieve sessions ### Example Usage @@ -31,9 +31,9 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + ctx := context.Background() - res, err := s.Session.GetClips(ctx, id) + res, err := s.Session.GetAll(ctx) if err != nil { log.Fatal(err) } @@ -48,19 +48,18 @@ func main() { | Parameter | Type | Required | Description | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the parent session | ### Response -**[*operations.GetSessionClipsResponse](../../models/operations/getsessionclipsresponse.md), error** +**[*operations.GetSessionsResponse](../../models/operations/getsessionsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetAll +## Get -Retrieve sessions +Retrieve a session ### Example Usage @@ -77,13 +76,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - + var id string = "" ctx := context.Background() - res, err := s.Session.GetAll(ctx) + res, err := s.Session.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.Session != nil { // handle response } } @@ -94,18 +93,19 @@ func main() { | Parameter | Type | Required | Description | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the session | ### Response -**[*operations.GetSessionsResponse](../../models/operations/getsessionsresponse.md), error** +**[*operations.GetSessionResponse](../../models/operations/getsessionresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Get +## GetClips -Retrieve a session +Retrieve clips of a session ### Example Usage @@ -124,11 +124,11 @@ func main() { ) var id string = "" ctx := context.Background() - res, err := s.Session.Get(ctx, id) + res, err := s.Session.GetClips(ctx, id) if err != nil { log.Fatal(err) } - if res.Session != nil { + if res.Data != nil { // handle response } } @@ -139,12 +139,12 @@ func main() { | Parameter | Type | Required | Description | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the session | +| `id` | *string* | :heavy_check_mark: | ID of the parent session | ### Response -**[*operations.GetSessionResponse](../../models/operations/getsessionresponse.md), error** +**[*operations.GetSessionClipsResponse](../../models/operations/getsessionclipsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/stream/README.md b/docs/sdks/stream/README.md index bf9132e..dd601d8 100644 --- a/docs/sdks/stream/README.md +++ b/docs/sdks/stream/README.md @@ -7,17 +7,116 @@ Operations related to livestream api ### Available Operations -* [Create](#create) - Create a stream +* [CreateClip](#createclip) - Create a clip * [GetAll](#getall) - Retrieve streams +* [Create](#create) - Create a stream +* [Delete](#delete) - Delete a stream * [Get](#get) - Retrieve a stream * [Update](#update) - Update a stream -* [Delete](#delete) - Delete a stream -* [Terminate](#terminate) - Terminates a live stream -* [StartPull](#startpull) - Start ingest for a pull stream -* [CreateClip](#createclip) - Create a clip * [GetClips](#getclips) - Retrieve clips of a livestream * [AddMultistreamTarget](#addmultistreamtarget) - Add a multistream target * [RemoveMultistreamTarget](#removemultistreamtarget) - Remove a multistream target +* [StartPull](#startpull) - Start ingest for a pull stream +* [Terminate](#terminate) - Terminates a live stream + +## CreateClip + +Create a clip + +### Example Usage + +```go +package main + +import( + livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" + "context" + "log" +) + +func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) + request := components.ClipPayload{ + EndTime: livepeergo.Float64(1587667174725), + Name: livepeergo.String("My Clip"), + PlaybackID: "eaw4nk06ts2d0mzb", + SessionID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), + StartTime: 1587667174725, + } + ctx := context.Background() + res, err := s.Stream.CreateClip(ctx, request) + if err != nil { + log.Fatal(err) + } + if res.Data != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [components.ClipPayload](../../models/components/clippayload.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreateClipResponse](../../models/operations/createclipresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetAll + +Retrieve streams + +### Example Usage + +```go +package main + +import( + livepeergo "github.com/livepeer/livepeer-go" + "context" + "log" +) + +func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) + var streamsonly *string = livepeergo.String("") + ctx := context.Background() + res, err := s.Stream.GetAll(ctx, streamsonly) + if err != nil { + log.Fatal(err) + } + if res.Data != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `streamsonly` | **string* | :heavy_minus_sign: | N/A | + + +### Response + +**[*operations.GetStreamsResponse](../../models/operations/getstreamsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------ | ------------------ | ------------------ | +| sdkerrors.SDKError | 4xx-5xx | */* | ## Create @@ -53,64 +152,64 @@ func main() { livepeergo.WithSecurity(""), ) request := components.NewStreamPayload{ - Name: "test_stream", - Pull: &components.Pull{ - Source: "https://myservice.com/live/stream.flv", - Headers: map[string]string{ - "Authorization": "Bearer 123", - }, - Location: &components.Location{ - Lat: 39.739, - Lon: -104.988, + Multistream: &components.Multistream{ + Targets: []components.Target{ + components.Target{ + ID: livepeergo.String("PUSH123"), + Profile: "720p", + Spec: &components.TargetSpec{ + Name: livepeergo.String("My target"), + URL: "rtmps://live.my-service.tv/channel/secretKey", + }, + VideoOnly: livepeergo.Bool(false), + }, }, }, + Name: "test_stream", PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, - RefreshInterval: livepeergo.Float64(600), + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), }, Profiles: []components.FfmpegProfile{ components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 486589, Bitrate: 3000000, Fps: 30, FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), + Height: 486589, + Name: "720p", + Profile: components.FfmpegProfileProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: 1280, + }, + }, + Pull: &components.Pull{ + Headers: map[string]string{ + "Authorization": "Bearer 123", }, + Location: &components.Location{ + Lat: 39.739, + Lon: -104.988, + }, + Source: "https://myservice.com/live/stream.flv", }, Record: livepeergo.Bool(false), - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.FfmpegProfile{ - components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 489382, + RecordingSpec: &components.NewStreamPayloadRecordingSpec{ + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ Bitrate: 3000000, - Fps: 30, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - }, - Multistream: &components.Multistream{ - Targets: []components.Target{ - components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), }, }, }, @@ -141,9 +240,13 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetAll +## Delete + +This will also suspend any active stream sessions, so make sure to wait +until the stream has finished. To explicitly interrupt an active +session, consider instead updating the suspended field in the stream +using the PATCH stream API. -Retrieve streams ### Example Usage @@ -160,13 +263,13 @@ func main() { s := livepeergo.New( livepeergo.WithSecurity(""), ) - var streamsonly *string = livepeergo.String("") + var id string = "" ctx := context.Background() - res, err := s.Stream.GetAll(ctx, streamsonly) + res, err := s.Stream.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } @@ -177,12 +280,12 @@ func main() { | Parameter | Type | Required | Description | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `streamsonly` | **string* | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | ID of the stream | ### Response -**[*operations.GetStreamsResponse](../../models/operations/getstreamsresponse.md), error** +**[*operations.DeleteStreamResponse](../../models/operations/deletestreamresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | @@ -256,39 +359,54 @@ func main() { var id string = "" streamPatchPayload := components.StreamPatchPayload{ - Record: livepeergo.Bool(false), Multistream: &components.Multistream{ Targets: []components.Target{ components.Target{ - Profile: "720p", - VideoOnly: livepeergo.Bool(false), ID: livepeergo.String("PUSH123"), + Profile: "720p", Spec: &components.TargetSpec{ Name: livepeergo.String("My target"), URL: "rtmps://live.my-service.tv/channel/secretKey", }, + VideoOnly: livepeergo.Bool(false), }, }, }, PlaybackPolicy: &components.PlaybackPolicy{ + RefreshInterval: livepeergo.Float64(600), Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), WebhookContext: map[string]any{ "streamerId": "my-custom-id", }, - RefreshInterval: livepeergo.Float64(600), + WebhookID: livepeergo.String("1bde4o2i6xycudoy"), }, Profiles: []components.FfmpegProfile{ components.FfmpegProfile{ - Width: 1280, - Name: "720p", - Height: 857478, Bitrate: 3000000, Fps: 30, FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), + Height: 857478, + Name: "720p", + Profile: components.FfmpegProfileProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: 1280, + }, + }, + Record: livepeergo.Bool(false), + RecordingSpec: &components.RecordingSpec{ + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Bitrate: 3000000, + Encoder: components.EncoderH264.ToPointer(), + Fps: livepeergo.Int64(30), + FpsDen: livepeergo.Int64(1), + Gop: livepeergo.String("2"), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), + }, }, }, } @@ -319,13 +437,9 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Delete - -This will also suspend any active stream sessions, so make sure to wait -until the stream has finished. To explicitly interrupt an active -session, consider instead updating the suspended field in the stream -using the PATCH stream API. +## GetClips +Retrieve clips of a livestream ### Example Usage @@ -344,11 +458,11 @@ func main() { ) var id string = "" ctx := context.Background() - res, err := s.Stream.Delete(ctx, id) + res, err := s.Stream.GetClips(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } @@ -356,30 +470,22 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the stream | +| Parameter | Type | Required | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the parent stream or playbackId of parent stream | ### Response -**[*operations.DeleteStreamResponse](../../models/operations/deletestreamresponse.md), error** +**[*operations.GetClipsResponse](../../models/operations/getclipsresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Terminate - -`DELETE /stream/{id}/terminate` can be used to terminate an ongoing -session on a live stream. Unlike suspending the stream, it allows the -streamer to restart streaming even immediately, but it will force -terminate the current session and stop the recording. -\ -\ -A 204 No Content status response indicates the stream was successfully -terminated. +## AddMultistreamTarget +Add a multistream target ### Example Usage @@ -388,6 +494,7 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -397,8 +504,18 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" + + targetAddPayload := components.TargetAddPayload{ + ID: livepeergo.String("PUSH123"), + Profile: "720p0", + Spec: &components.TargetAddPayloadSpec{ + Name: livepeergo.String("My target"), + URL: "rtmps://live.my-service.tv/channel/secretKey", + }, + VideoOnly: livepeergo.Bool(false), + } ctx := context.Background() - res, err := s.Stream.Terminate(ctx, id) + res, err := s.Stream.AddMultistreamTarget(ctx, id, targetAddPayload) if err != nil { log.Fatal(err) } @@ -410,29 +527,23 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the stream | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the parent stream | +| `targetAddPayload` | [components.TargetAddPayload](../../models/components/targetaddpayload.md) | :heavy_check_mark: | N/A | ### Response -**[*operations.TerminateStreamResponse](../../models/operations/terminatestreamresponse.md), error** +**[*operations.AddMultistreamTargetResponse](../../models/operations/addmultistreamtargetresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## StartPull - -`POST /stream/{id}/start-pull` can be used to start ingest for a stream -configured with a pull source. If the stream has recording configured, -it will also start recording. -\ -\ -A 204 No Content status response indicates the stream was successfully -started. +## RemoveMultistreamTarget +Remove a multistream target ### Example Usage @@ -450,8 +561,10 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" + + var targetID string = "" ctx := context.Background() - res, err := s.Stream.StartPull(ctx, id) + res, err := s.Stream.RemoveMultistreamTarget(ctx, id, targetID) if err != nil { log.Fatal(err) } @@ -466,118 +579,27 @@ func main() { | Parameter | Type | Required | Description | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the stream | - - -### Response - -**[*operations.StartPullStreamResponse](../../models/operations/startpullstreamresponse.md), error** -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | - -## CreateClip - -Create a clip - -### Example Usage - -```go -package main - -import( - livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" - "context" - "log" -) - -func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - request := components.ClipPayload{ - PlaybackID: "eaw4nk06ts2d0mzb", - StartTime: 1587667174725, - EndTime: livepeergo.Float64(1587667174725), - Name: livepeergo.String("My Clip"), - SessionID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), - } - ctx := context.Background() - res, err := s.Stream.CreateClip(ctx, request) - if err != nil { - log.Fatal(err) - } - if res.Data != nil { - // handle response - } -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `request` | [components.ClipPayload](../../models/components/clippayload.md) | :heavy_check_mark: | The request object to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the parent stream | +| `targetID` | *string* | :heavy_check_mark: | ID of the multistream target | ### Response -**[*operations.CreateClipResponse](../../models/operations/createclipresponse.md), error** +**[*operations.RemoveMultistreamTargetResponse](../../models/operations/removemultistreamtargetresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## GetClips - -Retrieve clips of a livestream - -### Example Usage - -```go -package main - -import( - livepeergo "github.com/livepeer/livepeer-go" - "context" - "log" -) - -func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - var id string = "" - ctx := context.Background() - res, err := s.Stream.GetClips(ctx, id) - if err != nil { - log.Fatal(err) - } - if res.Data != nil { - // handle response - } -} -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the parent stream or playbackId of parent stream | - - -### Response - -**[*operations.GetClipsResponse](../../models/operations/getclipsresponse.md), error** -| Error Object | Status Code | Content Type | -| ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | +## StartPull -## AddMultistreamTarget +`POST /stream/{id}/start-pull` can be used to start ingest for a stream +configured with a pull source. If the stream has recording configured, +it will also start recording. +\ +\ +A 204 No Content status response indicates the stream was successfully +started. -Add a multistream target ### Example Usage @@ -586,7 +608,6 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -596,18 +617,8 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" - - targetAddPayload := components.TargetAddPayload{ - Profile: "720p0", - VideoOnly: livepeergo.Bool(false), - ID: livepeergo.String("PUSH123"), - Spec: &components.TargetAddPayloadSpec{ - Name: livepeergo.String("My target"), - URL: "rtmps://live.my-service.tv/channel/secretKey", - }, - } ctx := context.Background() - res, err := s.Stream.AddMultistreamTarget(ctx, id, targetAddPayload) + res, err := s.Stream.StartPull(ctx, id) if err != nil { log.Fatal(err) } @@ -619,23 +630,30 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the parent stream | -| `targetAddPayload` | [components.TargetAddPayload](../../models/components/targetaddpayload.md) | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | ID of the stream | ### Response -**[*operations.AddMultistreamTargetResponse](../../models/operations/addmultistreamtargetresponse.md), error** +**[*operations.StartPullStreamResponse](../../models/operations/startpullstreamresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## RemoveMultistreamTarget +## Terminate + +`DELETE /stream/{id}/terminate` can be used to terminate an ongoing +session on a live stream. Unlike suspending the stream, it allows the +streamer to restart streaming even immediately, but it will force +terminate the current session and stop the recording. +\ +\ +A 204 No Content status response indicates the stream was successfully +terminated. -Remove a multistream target ### Example Usage @@ -653,10 +671,8 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" - - var targetID string = "" ctx := context.Background() - res, err := s.Stream.RemoveMultistreamTarget(ctx, id, targetID) + res, err := s.Stream.Terminate(ctx, id) if err != nil { log.Fatal(err) } @@ -671,13 +687,12 @@ func main() { | Parameter | Type | Required | Description | | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | ID of the parent stream | -| `targetID` | *string* | :heavy_check_mark: | ID of the multistream target | +| `id` | *string* | :heavy_check_mark: | ID of the stream | ### Response -**[*operations.RemoveMultistreamTargetResponse](../../models/operations/removemultistreamtargetresponse.md), error** +**[*operations.TerminateStreamResponse](../../models/operations/terminatestreamresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/transcode/README.md b/docs/sdks/transcode/README.md index 596f8de..373c647 100644 --- a/docs/sdks/transcode/README.md +++ b/docs/sdks/transcode/README.md @@ -156,41 +156,41 @@ func main() { URL: "https://s3.amazonaws.com/bucket/file.mp4", }, ), - Storage: components.CreateTranscodePayloadStorageStorage1( - components.Storage1{ - Type: components.StorageTypeS3, - Endpoint: "https://gateway.storjshare.io", - Bucket: "outputbucket", - Credentials: components.StorageCredentials{ - AccessKeyID: "AKIAIOSFODNN7EXAMPLE", - SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", - }, - }, - ), Outputs: components.Outputs{ + Fmp4: &components.Fmp4{ + Path: "/samplevideo/fmp4", + }, Hls: &components.Hls{ Path: "/samplevideo/hls", }, Mp4: &components.Mp4{ Path: "/samplevideo/mp4", }, - Fmp4: &components.Fmp4{ - Path: "/samplevideo/fmp4", - }, }, Profiles: []components.TranscodeProfile{ components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), Bitrate: 3000000, - Quality: livepeergo.Int64(23), + Encoder: components.EncoderH264.ToPointer(), Fps: livepeergo.Int64(30), FpsDen: livepeergo.Int64(1), Gop: livepeergo.String("2"), - Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(), - Encoder: components.TranscodeProfileEncoderH264.ToPointer(), + Name: livepeergo.String("720p"), + Profile: components.ProfileH264Baseline.ToPointer(), + Quality: livepeergo.Int64(23), + Width: livepeergo.Int64(1280), }, }, + Storage: components.CreateTranscodePayloadStorageStorage1( + components.Storage1{ + Bucket: "outputbucket", + Credentials: components.StorageCredentials{ + AccessKeyID: "AKIAIOSFODNN7EXAMPLE", + SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", + }, + Endpoint: "https://gateway.storjshare.io", + Type: components.StorageTypeS3, + }, + ), } ctx := context.Background() res, err := s.Transcode.Create(ctx, request) diff --git a/docs/sdks/webhook/README.md b/docs/sdks/webhook/README.md index 1f3bc5b..66003f5 100644 --- a/docs/sdks/webhook/README.md +++ b/docs/sdks/webhook/README.md @@ -9,9 +9,9 @@ Operations related to webhook api * [GetAll](#getall) - Retrieve a Webhook * [Create](#create) - Create a webhook +* [Delete](#delete) - Delete a webhook * [Get](#get) - Retrieve a webhook * [Update](#update) - Update a webhook -* [Delete](#delete) - Delete a webhook * [GetLogs](#getlogs) - Retrieve webhook logs * [GetLog](#getlog) - Retrieve a webhook log * [ResendLog](#resendlog) - Resend a webhook @@ -83,15 +83,15 @@ func main() { livepeergo.WithSecurity(""), ) request := components.WebhookInput{ - Name: "test_webhook", - ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), Events: []components.Events{ components.EventsStreamStarted, components.EventsStreamIdle, }, - URL: "https://my-service.com/webhook", + Name: "test_webhook", + ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), SharedSecret: livepeergo.String("my-secret"), StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), + URL: "https://my-service.com/webhook", } ctx := context.Background() res, err := s.Webhook.Create(ctx, request) @@ -119,9 +119,9 @@ func main() { | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Get +## Delete -Retrieve a webhook +Delete a webhook ### Example Usage @@ -140,7 +140,7 @@ func main() { ) var id string = "" ctx := context.Background() - res, err := s.Webhook.Get(ctx, id) + res, err := s.Webhook.Delete(ctx, id) if err != nil { log.Fatal(err) } @@ -160,14 +160,14 @@ func main() { ### Response -**[*operations.GetWebhookResponse](../../models/operations/getwebhookresponse.md), error** +**[*operations.DeleteWebhookResponse](../../models/operations/deletewebhookresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Update +## Get -Update a webhook +Retrieve a webhook ### Example Usage @@ -176,7 +176,6 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -186,20 +185,8 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" - - webhook := components.WebhookInput{ - Name: "test_webhook", - ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), - Events: []components.Events{ - components.EventsStreamStarted, - components.EventsStreamIdle, - }, - URL: "https://my-service.com/webhook", - SharedSecret: livepeergo.String("my-secret"), - StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), - } ctx := context.Background() - res, err := s.Webhook.Update(ctx, id, webhook) + res, err := s.Webhook.Get(ctx, id) if err != nil { log.Fatal(err) } @@ -211,23 +198,22 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | N/A | -| `webhook` | [components.WebhookInput](../../models/components/webhookinput.md) | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | N/A | ### Response -**[*operations.UpdateWebhookResponse](../../models/operations/updatewebhookresponse.md), error** +**[*operations.GetWebhookResponse](../../models/operations/getwebhookresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | -## Delete +## Update -Delete a webhook +Update a webhook ### Example Usage @@ -236,6 +222,7 @@ package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -245,8 +232,20 @@ func main() { livepeergo.WithSecurity(""), ) var id string = "" + + webhook := components.WebhookInput{ + Events: []components.Events{ + components.EventsStreamStarted, + components.EventsStreamIdle, + }, + Name: "test_webhook", + ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), + SharedSecret: livepeergo.String("my-secret"), + StreamID: livepeergo.String("de7818e7-610a-4057-8f6f-b785dc1e6f88"), + URL: "https://my-service.com/webhook", + } ctx := context.Background() - res, err := s.Webhook.Delete(ctx, id) + res, err := s.Webhook.Update(ctx, id, webhook) if err != nil { log.Fatal(err) } @@ -258,15 +257,16 @@ func main() { ### Parameters -| Parameter | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | -| `id` | *string* | :heavy_check_mark: | N/A | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `id` | *string* | :heavy_check_mark: | N/A | +| `webhook` | [components.WebhookInput](../../models/components/webhookinput.md) | :heavy_check_mark: | N/A | ### Response -**[*operations.DeleteWebhookResponse](../../models/operations/deletewebhookresponse.md), error** +**[*operations.UpdateWebhookResponse](../../models/operations/updatewebhookresponse.md), error** | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/internal/utils/contenttype.go b/internal/utils/contenttype.go index 8ed13e2..763f2d6 100644 --- a/internal/utils/contenttype.go +++ b/internal/utils/contenttype.go @@ -9,6 +9,10 @@ import ( ) func MatchContentType(contentType string, pattern string) bool { + if contentType == "" { + contentType = "application/octet-stream" + } + if contentType == pattern || pattern == "*" || pattern == "*/*" { return true } diff --git a/livepeer.go b/livepeer.go index 79aba98..5303b28 100644 --- a/livepeer.go +++ b/livepeer.go @@ -66,28 +66,28 @@ func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) { // endpoints exposed on the standard Livepeer API, learn how to use them and // what they return. type Livepeer struct { + // Operations related to access control/signing keys api + AccessControl *AccessControl + // Operations related to asset/vod api + Asset *Asset // Operations related to livestream api Stream *Stream + // Operations related to metrics api + Metrics *Metrics // Operations related to multistream api Multistream *Multistream - // Operations related to webhook api - Webhook *Webhook - // Operations related to asset/vod api - Asset *Asset - // Operations related to session api - Session *Session + // Operations related to playback api + Playback *Playback // Operations related to rooms api Room *Room - // Operations related to metrics api - Metrics *Metrics - // Operations related to access control/signing keys api - AccessControl *AccessControl + // Operations related to session api + Session *Session // Operations related to tasks api Task *Task // Operations related to transcode api Transcode *Transcode - // Operations related to playback api - Playback *Playback + // Operations related to webhook api + Webhook *Webhook sdkConfiguration sdkConfiguration } @@ -159,9 +159,9 @@ func New(opts ...SDKOption) *Livepeer { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.1.11", - GenVersion: "2.340.3", - UserAgent: "speakeasy-sdk/go 0.1.11 2.340.3 1.0.0 github.com/livepeer/livepeer-go", + SDKVersion: "0.1.12", + GenVersion: "2.354.2", + UserAgent: "speakeasy-sdk/go 0.1.12 2.354.2 1.0.0 github.com/livepeer/livepeer-go", Hooks: hooks.New(), }, } @@ -181,27 +181,27 @@ func New(opts ...SDKOption) *Livepeer { sdk.sdkConfiguration.ServerURL = serverURL } - sdk.Stream = newStream(sdk.sdkConfiguration) + sdk.AccessControl = newAccessControl(sdk.sdkConfiguration) - sdk.Multistream = newMultistream(sdk.sdkConfiguration) + sdk.Asset = newAsset(sdk.sdkConfiguration) - sdk.Webhook = newWebhook(sdk.sdkConfiguration) + sdk.Stream = newStream(sdk.sdkConfiguration) - sdk.Asset = newAsset(sdk.sdkConfiguration) + sdk.Metrics = newMetrics(sdk.sdkConfiguration) - sdk.Session = newSession(sdk.sdkConfiguration) + sdk.Multistream = newMultistream(sdk.sdkConfiguration) - sdk.Room = newRoom(sdk.sdkConfiguration) + sdk.Playback = newPlayback(sdk.sdkConfiguration) - sdk.Metrics = newMetrics(sdk.sdkConfiguration) + sdk.Room = newRoom(sdk.sdkConfiguration) - sdk.AccessControl = newAccessControl(sdk.sdkConfiguration) + sdk.Session = newSession(sdk.sdkConfiguration) sdk.Task = newTask(sdk.sdkConfiguration) sdk.Transcode = newTranscode(sdk.sdkConfiguration) - sdk.Playback = newPlayback(sdk.sdkConfiguration) + sdk.Webhook = newWebhook(sdk.sdkConfiguration) return sdk } diff --git a/metrics.go b/metrics.go index 1a5abff..e2bbef0 100644 --- a/metrics.go +++ b/metrics.go @@ -27,18 +27,17 @@ func newMetrics(sdkConfig sdkConfiguration) *Metrics { } } -// GetViewership - Query viewership metrics -// Requires a private (non-CORS) API key to be used. -func (s *Metrics) GetViewership(ctx context.Context, request operations.GetViewershipMetricsRequest) (*operations.GetViewershipMetricsResponse, error) { +// GetUsage - Query usage metrics +func (s *Metrics) GetUsage(ctx context.Context, request operations.GetUsageMetricsRequest) (*operations.GetUsageMetricsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getViewershipMetrics", + OperationID: "getUsageMetrics", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/data/views/query") + opURL, err := url.JoinPath(baseURL, "/data/usage/query") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -87,7 +86,7 @@ func (s *Metrics) GetViewership(ctx context.Context, request operations.GetViewe } } - res := &operations.GetViewershipMetricsResponse{ + res := &operations.GetUsageMetricsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -105,12 +104,12 @@ func (s *Metrics) GetViewership(ctx context.Context, request operations.GetViewe case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out []components.ViewershipMetric + var out components.UsageMetric if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Data = out + res.UsageMetric = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -136,18 +135,18 @@ func (s *Metrics) GetViewership(ctx context.Context, request operations.GetViewe } -// GetCreatorViewership - Query creator viewership metrics -// Requires a proof of ownership to be sent in the request, which for now is just the assetId or streamId parameters (1 of those must be in the query-string). -func (s *Metrics) GetCreatorViewership(ctx context.Context, request operations.GetCreatorViewershipMetricsRequest) (*operations.GetCreatorViewershipMetricsResponse, error) { +// GetViewership - Query viewership metrics +// Requires a private (non-CORS) API key to be used. +func (s *Metrics) GetViewership(ctx context.Context, request operations.GetViewershipMetricsRequest) (*operations.GetViewershipMetricsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getCreatorViewershipMetrics", + OperationID: "getViewershipMetrics", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/data/views/query/creator") + opURL, err := url.JoinPath(baseURL, "/data/views/query") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -196,7 +195,7 @@ func (s *Metrics) GetCreatorViewership(ctx context.Context, request operations.G } } - res := &operations.GetCreatorViewershipMetricsResponse{ + res := &operations.GetViewershipMetricsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -245,24 +244,18 @@ func (s *Metrics) GetCreatorViewership(ctx context.Context, request operations.G } -// GetPublicViewership - Query public total views metrics -// Allows querying for the public metrics for viewership about a video. -// This can be called from the frontend with a CORS key, or even -// unauthenticated. -func (s *Metrics) GetPublicViewership(ctx context.Context, playbackID string) (*operations.GetPublicViewershipMetricsResponse, error) { +// GetCreatorViewership - Query creator viewership metrics +// Requires a proof of ownership to be sent in the request, which for now is just the assetId or streamId parameters (1 of those must be in the query-string). +func (s *Metrics) GetCreatorViewership(ctx context.Context, request operations.GetCreatorViewershipMetricsRequest) (*operations.GetCreatorViewershipMetricsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getPublicViewershipMetrics", + OperationID: "getCreatorViewershipMetrics", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetPublicViewershipMetricsRequest{ - PlaybackID: playbackID, - } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/data/views/query/total/{playbackId}", request, nil) + opURL, err := url.JoinPath(baseURL, "/data/views/query/creator") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -274,6 +267,10 @@ func (s *Metrics) GetPublicViewership(ctx context.Context, playbackID string) (* req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -307,7 +304,7 @@ func (s *Metrics) GetPublicViewership(ctx context.Context, playbackID string) (* } } - res := &operations.GetPublicViewershipMetricsResponse{ + res := &operations.GetCreatorViewershipMetricsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -325,12 +322,12 @@ func (s *Metrics) GetPublicViewership(ctx context.Context, playbackID string) (* case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out operations.GetPublicViewershipMetricsData + var out []components.ViewershipMetric if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Data = &out + res.Data = out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -356,17 +353,24 @@ func (s *Metrics) GetPublicViewership(ctx context.Context, playbackID string) (* } -// GetUsage - Query usage metrics -func (s *Metrics) GetUsage(ctx context.Context, request operations.GetUsageMetricsRequest) (*operations.GetUsageMetricsResponse, error) { +// GetPublicViewership - Query public total views metrics +// Allows querying for the public metrics for viewership about a video. +// This can be called from the frontend with a CORS key, or even +// unauthenticated. +func (s *Metrics) GetPublicViewership(ctx context.Context, playbackID string) (*operations.GetPublicViewershipMetricsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getUsageMetrics", + OperationID: "getPublicViewershipMetrics", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } + request := operations.GetPublicViewershipMetricsRequest{ + PlaybackID: playbackID, + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/data/usage/query") + opURL, err := utils.GenerateURL(ctx, baseURL, "/data/views/query/total/{playbackId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -378,10 +382,6 @@ func (s *Metrics) GetUsage(ctx context.Context, request operations.GetUsageMetri req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { - return nil, fmt.Errorf("error populating query params: %w", err) - } - if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err } @@ -415,7 +415,7 @@ func (s *Metrics) GetUsage(ctx context.Context, request operations.GetUsageMetri } } - res := &operations.GetUsageMetricsResponse{ + res := &operations.GetPublicViewershipMetricsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -433,12 +433,12 @@ func (s *Metrics) GetUsage(ctx context.Context, request operations.GetUsageMetri case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.UsageMetric + var out operations.GetPublicViewershipMetricsData if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.UsageMetric = &out + res.Data = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/models/components/asset.go b/models/components/asset.go index e4ff481..b05e982 100644 --- a/models/components/asset.go +++ b/models/components/asset.go @@ -9,31 +9,25 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) -// AssetType - Type of the asset. -type AssetType string - -const ( - AssetTypeVideo AssetType = "video" - AssetTypeAudio AssetType = "audio" -) - -func (e AssetType) ToPointer() *AssetType { - return &e +type Hash struct { + // Hash algorithm used to compute the hash + Algorithm *string `json:"algorithm,omitempty"` + // Hash of the asset + Hash *string `json:"hash,omitempty"` } -func (e *AssetType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err + +func (o *Hash) GetAlgorithm() *string { + if o == nil { + return nil } - switch v { - case "video": - fallthrough - case "audio": - *e = AssetType(v) + return o.Algorithm +} + +func (o *Hash) GetHash() *string { + if o == nil { return nil - default: - return fmt.Errorf("invalid value for AssetType: %v", v) } + return o.Hash } type AssetSource3Type string @@ -63,25 +57,25 @@ func (e *AssetSource3Type) UnmarshalJSON(data []byte) error { } type Source3 struct { - Type AssetSource3Type `json:"type"` + // ID of the asset from which this asset was created. + AssetID *string `json:"assetId,omitempty"` Encryption *EncryptionOutput `json:"encryption,omitempty"` - // ID of the asset or stream from which this asset was created. - SourceID *string `json:"sourceId,omitempty"` - // ID of the session from which this asset was created. - SessionID *string `json:"sessionId,omitempty"` // Playback ID of the asset or stream from which this asset was created. PlaybackID *string `json:"playbackId,omitempty"` // ID of the requester from which this asset was created. RequesterID *string `json:"requesterId,omitempty"` - // ID of the asset from which this asset was created. - AssetID *string `json:"assetId,omitempty"` + // ID of the session from which this asset was created. + SessionID *string `json:"sessionId,omitempty"` + // ID of the asset or stream from which this asset was created. + SourceID *string `json:"sourceId,omitempty"` + Type AssetSource3Type `json:"type"` } -func (o *Source3) GetType() AssetSource3Type { +func (o *Source3) GetAssetID() *string { if o == nil { - return AssetSource3Type("") + return nil } - return o.Type + return o.AssetID } func (o *Source3) GetEncryption() *EncryptionOutput { @@ -91,39 +85,39 @@ func (o *Source3) GetEncryption() *EncryptionOutput { return o.Encryption } -func (o *Source3) GetSourceID() *string { +func (o *Source3) GetPlaybackID() *string { if o == nil { return nil } - return o.SourceID + return o.PlaybackID } -func (o *Source3) GetSessionID() *string { +func (o *Source3) GetRequesterID() *string { if o == nil { return nil } - return o.SessionID + return o.RequesterID } -func (o *Source3) GetPlaybackID() *string { +func (o *Source3) GetSessionID() *string { if o == nil { return nil } - return o.PlaybackID + return o.SessionID } -func (o *Source3) GetRequesterID() *string { +func (o *Source3) GetSourceID() *string { if o == nil { return nil } - return o.RequesterID + return o.SourceID } -func (o *Source3) GetAssetID() *string { +func (o *Source3) GetType() AssetSource3Type { if o == nil { - return nil + return AssetSource3Type("") } - return o.AssetID + return o.Type } type AssetSourceType string @@ -150,23 +144,23 @@ func (e *AssetSourceType) UnmarshalJSON(data []byte) error { } type Two struct { - Type AssetSourceType `json:"type"` // ID of the session from which this asset was created - SessionID string `json:"sessionId"` + SessionID string `json:"sessionId"` + Type AssetSourceType `json:"type"` } -func (o *Two) GetType() AssetSourceType { +func (o *Two) GetSessionID() string { if o == nil { - return AssetSourceType("") + return "" } - return o.Type + return o.SessionID } -func (o *Two) GetSessionID() string { +func (o *Two) GetType() AssetSourceType { if o == nil { - return "" + return AssetSourceType("") } - return o.SessionID + return o.Type } type SourceType string @@ -193,40 +187,40 @@ func (e *SourceType) UnmarshalJSON(data []byte) error { } type Source1 struct { - Type SourceType `json:"type"` + Encryption *EncryptionOutput `json:"encryption,omitempty"` + // Gateway URL from asset if parsed from provided URL on upload. + GatewayURL *string `json:"gatewayUrl,omitempty"` + Type SourceType `json:"type"` // URL from which the asset was uploaded. URL string `json:"url"` - // Gateway URL from asset if parsed from provided URL on upload. - GatewayURL *string `json:"gatewayUrl,omitempty"` - Encryption *EncryptionOutput `json:"encryption,omitempty"` } -func (o *Source1) GetType() SourceType { +func (o *Source1) GetEncryption() *EncryptionOutput { if o == nil { - return SourceType("") + return nil } - return o.Type + return o.Encryption } -func (o *Source1) GetURL() string { +func (o *Source1) GetGatewayURL() *string { if o == nil { - return "" + return nil } - return o.URL + return o.GatewayURL } -func (o *Source1) GetGatewayURL() *string { +func (o *Source1) GetType() SourceType { if o == nil { - return nil + return SourceType("") } - return o.GatewayURL + return o.Type } -func (o *Source1) GetEncryption() *EncryptionOutput { +func (o *Source1) GetURL() string { if o == nil { - return nil + return "" } - return o.Encryption + return o.URL } type SourceUnionType string @@ -314,6 +308,94 @@ func (u Source) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type Source: all fields are null") } +// AssetPhase - Phase of the asset +type AssetPhase string + +const ( + AssetPhaseUploading AssetPhase = "uploading" + AssetPhaseWaiting AssetPhase = "waiting" + AssetPhaseProcessing AssetPhase = "processing" + AssetPhaseReady AssetPhase = "ready" + AssetPhaseFailed AssetPhase = "failed" + AssetPhaseDeleting AssetPhase = "deleting" + AssetPhaseDeleted AssetPhase = "deleted" +) + +func (e AssetPhase) ToPointer() *AssetPhase { + return &e +} +func (e *AssetPhase) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "uploading": + fallthrough + case "waiting": + fallthrough + case "processing": + fallthrough + case "ready": + fallthrough + case "failed": + fallthrough + case "deleting": + fallthrough + case "deleted": + *e = AssetPhase(v) + return nil + default: + return fmt.Errorf("invalid value for AssetPhase: %v", v) + } +} + +// Status of the asset +type Status struct { + // Error message if the asset creation failed. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Phase of the asset + Phase AssetPhase `json:"phase"` + // Current progress of the task creating this asset. + Progress *float64 `json:"progress,omitempty"` + // Timestamp (in milliseconds) at which the asset was last updated + UpdatedAt float64 `json:"updatedAt"` +} + +func (o *Status) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage +} + +func (o *Status) GetPhase() AssetPhase { + if o == nil { + return AssetPhase("") + } + return o.Phase +} + +func (o *Status) GetProgress() *float64 { + if o == nil { + return nil + } + return o.Progress +} + +func (o *Status) GetUpdatedAt() float64 { + if o == nil { + return 0.0 + } + return o.UpdatedAt +} + +// AssetNftMetadata - Additional data to add to the NFT metadata exported to +// IPFS. Will be deep merged with the default metadata +// exported. +type AssetNftMetadata struct { +} + // AssetNftMetadataTemplate - Name of the NFT metadata template to export. 'player' // will embed the Livepeer Player on the NFT while 'file' // will reference only the immutable MP4 files. @@ -343,23 +425,17 @@ func (e *AssetNftMetadataTemplate) UnmarshalJSON(data []byte) error { } } -// AssetNftMetadata - Additional data to add to the NFT metadata exported to -// IPFS. Will be deep merged with the default metadata -// exported. -type AssetNftMetadata struct { -} - type AssetSpec struct { - // Name of the NFT metadata template to export. 'player' - // will embed the Livepeer Player on the NFT while 'file' - // will reference only the immutable MP4 files. - // - NftMetadataTemplate *AssetNftMetadataTemplate `default:"file" json:"nftMetadataTemplate"` // Additional data to add to the NFT metadata exported to // IPFS. Will be deep merged with the default metadata // exported. // NftMetadata *AssetNftMetadata `json:"nftMetadata,omitempty"` + // Name of the NFT metadata template to export. 'player' + // will embed the Livepeer Player on the NFT while 'file' + // will reference only the immutable MP4 files. + // + NftMetadataTemplate *AssetNftMetadataTemplate `default:"file" json:"nftMetadataTemplate"` } func (a AssetSpec) MarshalJSON() ([]byte, error) { @@ -373,49 +449,49 @@ func (a *AssetSpec) UnmarshalJSON(data []byte) error { return nil } -func (o *AssetSpec) GetNftMetadataTemplate() *AssetNftMetadataTemplate { +func (o *AssetSpec) GetNftMetadata() *AssetNftMetadata { if o == nil { return nil } - return o.NftMetadataTemplate + return o.NftMetadata } -func (o *AssetSpec) GetNftMetadata() *AssetNftMetadata { +func (o *AssetSpec) GetNftMetadataTemplate() *AssetNftMetadataTemplate { if o == nil { return nil } - return o.NftMetadata + return o.NftMetadataTemplate } type AssetIpfs struct { - Spec *AssetSpec `json:"spec,omitempty"` DollarRef any `json:"$ref,omitempty"` NftMetadata *IpfsFileInfo `json:"nftMetadata,omitempty"` + Spec *AssetSpec `json:"spec,omitempty"` // Timestamp (in milliseconds) at which IPFS export task was // updated // UpdatedAt *float64 `json:"updatedAt,omitempty"` } -func (o *AssetIpfs) GetSpec() *AssetSpec { +func (o *AssetIpfs) GetDollarRef() any { if o == nil { return nil } - return o.Spec + return o.DollarRef } -func (o *AssetIpfs) GetDollarRef() any { +func (o *AssetIpfs) GetNftMetadata() *IpfsFileInfo { if o == nil { return nil } - return o.DollarRef + return o.NftMetadata } -func (o *AssetIpfs) GetNftMetadata() *IpfsFileInfo { +func (o *AssetIpfs) GetSpec() *AssetSpec { if o == nil { return nil } - return o.NftMetadata + return o.Spec } func (o *AssetIpfs) GetUpdatedAt() *float64 { @@ -444,107 +520,31 @@ func (o *AssetStorage) GetStatus() *StorageStatus { return o.Status } -// AssetPhase - Phase of the asset -type AssetPhase string +// AssetType - Type of the asset. +type AssetType string const ( - AssetPhaseUploading AssetPhase = "uploading" - AssetPhaseWaiting AssetPhase = "waiting" - AssetPhaseProcessing AssetPhase = "processing" - AssetPhaseReady AssetPhase = "ready" - AssetPhaseFailed AssetPhase = "failed" - AssetPhaseDeleting AssetPhase = "deleting" - AssetPhaseDeleted AssetPhase = "deleted" + AssetTypeVideo AssetType = "video" + AssetTypeAudio AssetType = "audio" ) -func (e AssetPhase) ToPointer() *AssetPhase { +func (e AssetType) ToPointer() *AssetType { return &e } -func (e *AssetPhase) UnmarshalJSON(data []byte) error { +func (e *AssetType) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "uploading": - fallthrough - case "waiting": - fallthrough - case "processing": + case "video": fallthrough - case "ready": - fallthrough - case "failed": - fallthrough - case "deleting": - fallthrough - case "deleted": - *e = AssetPhase(v) + case "audio": + *e = AssetType(v) return nil default: - return fmt.Errorf("invalid value for AssetPhase: %v", v) - } -} - -// AssetStatus - Status of the asset -type AssetStatus struct { - // Phase of the asset - Phase AssetPhase `json:"phase"` - // Timestamp (in milliseconds) at which the asset was last updated - UpdatedAt float64 `json:"updatedAt"` - // Current progress of the task creating this asset. - Progress *float64 `json:"progress,omitempty"` - // Error message if the asset creation failed. - ErrorMessage *string `json:"errorMessage,omitempty"` -} - -func (o *AssetStatus) GetPhase() AssetPhase { - if o == nil { - return AssetPhase("") - } - return o.Phase -} - -func (o *AssetStatus) GetUpdatedAt() float64 { - if o == nil { - return 0.0 - } - return o.UpdatedAt -} - -func (o *AssetStatus) GetProgress() *float64 { - if o == nil { - return nil - } - return o.Progress -} - -func (o *AssetStatus) GetErrorMessage() *string { - if o == nil { - return nil - } - return o.ErrorMessage -} - -type Hash struct { - // Hash of the asset - Hash *string `json:"hash,omitempty"` - // Hash algorithm used to compute the hash - Algorithm *string `json:"algorithm,omitempty"` -} - -func (o *Hash) GetHash() *string { - if o == nil { - return nil - } - return o.Hash -} - -func (o *Hash) GetAlgorithm() *string { - if o == nil { - return nil + return fmt.Errorf("invalid value for AssetType: %v", v) } - return o.Algorithm } // AssetVideoSpecType - type of track @@ -575,74 +575,74 @@ func (e *AssetVideoSpecType) UnmarshalJSON(data []byte) error { } type Tracks struct { - // type of track - Type AssetVideoSpecType `json:"type"` + // Bit depth of the track - only for audio tracks + BitDepth *float64 `json:"bitDepth,omitempty"` + // Bitrate of the track in bits per second + Bitrate *float64 `json:"bitrate,omitempty"` + // Amount of audio channels in the track + Channels *float64 `json:"channels,omitempty"` // Codec of the track Codec string `json:"codec"` - // Start time of the track in seconds - StartTime *float64 `json:"startTime,omitempty"` // Duration of the track in seconds Duration *float64 `json:"duration,omitempty"` - // Bitrate of the track in bits per second - Bitrate *float64 `json:"bitrate,omitempty"` - // Width of the track - only for video tracks - Width *float64 `json:"width,omitempty"` + // Frame rate of the track - only for video tracks + Fps *float64 `json:"fps,omitempty"` // Height of the track - only for video tracks Height *float64 `json:"height,omitempty"` // Pixel format of the track - only for video tracks PixelFormat *string `json:"pixelFormat,omitempty"` - // Frame rate of the track - only for video tracks - Fps *float64 `json:"fps,omitempty"` - // Amount of audio channels in the track - Channels *float64 `json:"channels,omitempty"` // Sample rate of the track in samples per second - only for // audio tracks // SampleRate *float64 `json:"sampleRate,omitempty"` - // Bit depth of the track - only for audio tracks - BitDepth *float64 `json:"bitDepth,omitempty"` + // Start time of the track in seconds + StartTime *float64 `json:"startTime,omitempty"` + // type of track + Type AssetVideoSpecType `json:"type"` + // Width of the track - only for video tracks + Width *float64 `json:"width,omitempty"` } -func (o *Tracks) GetType() AssetVideoSpecType { +func (o *Tracks) GetBitDepth() *float64 { if o == nil { - return AssetVideoSpecType("") + return nil } - return o.Type + return o.BitDepth } -func (o *Tracks) GetCodec() string { +func (o *Tracks) GetBitrate() *float64 { if o == nil { - return "" + return nil } - return o.Codec + return o.Bitrate } -func (o *Tracks) GetStartTime() *float64 { +func (o *Tracks) GetChannels() *float64 { if o == nil { return nil } - return o.StartTime + return o.Channels } -func (o *Tracks) GetDuration() *float64 { +func (o *Tracks) GetCodec() string { if o == nil { - return nil + return "" } - return o.Duration + return o.Codec } -func (o *Tracks) GetBitrate() *float64 { +func (o *Tracks) GetDuration() *float64 { if o == nil { return nil } - return o.Bitrate + return o.Duration } -func (o *Tracks) GetWidth() *float64 { +func (o *Tracks) GetFps() *float64 { if o == nil { return nil } - return o.Width + return o.Fps } func (o *Tracks) GetHeight() *float64 { @@ -659,53 +659,53 @@ func (o *Tracks) GetPixelFormat() *string { return o.PixelFormat } -func (o *Tracks) GetFps() *float64 { +func (o *Tracks) GetSampleRate() *float64 { if o == nil { return nil } - return o.Fps + return o.SampleRate } -func (o *Tracks) GetChannels() *float64 { +func (o *Tracks) GetStartTime() *float64 { if o == nil { return nil } - return o.Channels + return o.StartTime } -func (o *Tracks) GetSampleRate() *float64 { +func (o *Tracks) GetType() AssetVideoSpecType { if o == nil { - return nil + return AssetVideoSpecType("") } - return o.SampleRate + return o.Type } -func (o *Tracks) GetBitDepth() *float64 { +func (o *Tracks) GetWidth() *float64 { if o == nil { return nil } - return o.BitDepth + return o.Width } // VideoSpec - Video metadata type VideoSpec struct { - // Format of the asset - Format *string `json:"format,omitempty"` - // Duration of the asset in seconds (float) - Duration *float64 `json:"duration,omitempty"` // Bitrate of the video in bits per second Bitrate *float64 `json:"bitrate,omitempty"` + // Duration of the asset in seconds (float) + Duration *float64 `json:"duration,omitempty"` + // Format of the asset + Format *string `json:"format,omitempty"` // List of tracks associated with the asset when the format // contemplates them (e.g. mp4) // Tracks []Tracks `json:"tracks,omitempty"` } -func (o *VideoSpec) GetFormat() *string { +func (o *VideoSpec) GetBitrate() *float64 { if o == nil { return nil } - return o.Format + return o.Bitrate } func (o *VideoSpec) GetDuration() *float64 { @@ -715,11 +715,11 @@ func (o *VideoSpec) GetDuration() *float64 { return o.Duration } -func (o *VideoSpec) GetBitrate() *float64 { +func (o *VideoSpec) GetFormat() *string { if o == nil { return nil } - return o.Bitrate + return o.Format } func (o *VideoSpec) GetTracks() []Tracks { @@ -730,158 +730,172 @@ func (o *VideoSpec) GetTracks() []Tracks { } type Asset struct { - ID string `json:"id"` - // Type of the asset. - Type *AssetType `json:"type,omitempty"` - // The playback ID to use with the Playback Info endpoint to retrieve playback URLs. - PlaybackID *string `json:"playbackId,omitempty"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - UserID *string `json:"userId,omitempty"` - // URL for HLS playback. **It is recommended to not use this URL**, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8). - PlaybackURL *string `json:"playbackUrl,omitempty"` + // Timestamp (in milliseconds) at which asset was created + CreatedAt *float64 `json:"createdAt,omitempty"` + // Name of the token used to create this object + CreatedByTokenName *string `json:"createdByTokenName,omitempty"` + CreatorID *CreatorID `json:"creatorId,omitempty"` // The URL to directly download the asset, e.g. `https://livepeercdn.com/asset/eawrrk06ts2d0mzb/video`. It is not recommended to use this for playback. DownloadURL *string `json:"downloadUrl,omitempty"` - // Whether the playback policy for an asset or stream is public or signed - PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - Source Source `json:"source"` - CreatorID *CreatorID `json:"creatorId,omitempty"` - Storage *AssetStorage `json:"storage,omitempty"` - // Status of the asset - Status *AssetStatus `json:"status,omitempty"` + // Hash of the asset + Hash []Hash `json:"hash,omitempty"` + ID string `json:"id"` // The name of the asset. This is not necessarily the filename - it can be a custom name or title. // Name string `json:"name"` + // The playback ID to use with the Playback Info endpoint to retrieve playback URLs. + PlaybackID *string `json:"playbackId,omitempty"` + // Whether the playback policy for an asset or stream is public or signed + PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` + // URL for HLS playback. **It is recommended to not use this URL**, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8). + PlaybackURL *string `json:"playbackUrl,omitempty"` + // Requested profiles for the asset to be transcoded into. Configured + // on the upload APIs payload or through the `stream.recordingSpec` + // field for recordings. If not specified, default profiles are derived + // based on the source input. If this is a recording, the source will + // not be present in this list but will be available for playback. + // + Profiles []TranscodeProfile `json:"profiles,omitempty"` // The ID of the project ProjectID *string `json:"projectId,omitempty"` - // Timestamp (in milliseconds) at which asset was created - CreatedAt *float64 `json:"createdAt,omitempty"` - // Name of the token used to create this object - CreatedByTokenName *string `json:"createdByTokenName,omitempty"` // Size of the asset in bytes - Size *float64 `json:"size,omitempty"` - // Hash of the asset - Hash []Hash `json:"hash,omitempty"` + Size *float64 `json:"size,omitempty"` + Source Source `json:"source"` + // Status of the asset + Status *Status `json:"status,omitempty"` + Storage *AssetStorage `json:"storage,omitempty"` + // Type of the asset. + Type *AssetType `json:"type,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + UserID *string `json:"userId,omitempty"` // Video metadata VideoSpec *VideoSpec `json:"videoSpec,omitempty"` } -func (o *Asset) GetID() string { +func (o *Asset) GetCreatedAt() *float64 { if o == nil { - return "" + return nil } - return o.ID + return o.CreatedAt } -func (o *Asset) GetType() *AssetType { +func (o *Asset) GetCreatedByTokenName() *string { if o == nil { return nil } - return o.Type + return o.CreatedByTokenName } -func (o *Asset) GetPlaybackID() *string { +func (o *Asset) GetCreatorID() *CreatorID { if o == nil { return nil } - return o.PlaybackID + return o.CreatorID } -func (o *Asset) GetUserID() *string { +func (o *Asset) GetDownloadURL() *string { if o == nil { return nil } - return o.UserID + return o.DownloadURL } -func (o *Asset) GetPlaybackURL() *string { +func (o *Asset) GetHash() []Hash { if o == nil { return nil } - return o.PlaybackURL + return o.Hash } -func (o *Asset) GetDownloadURL() *string { +func (o *Asset) GetID() string { if o == nil { - return nil + return "" } - return o.DownloadURL + return o.ID } -func (o *Asset) GetPlaybackPolicy() *PlaybackPolicy { +func (o *Asset) GetName() string { if o == nil { - return nil + return "" } - return o.PlaybackPolicy + return o.Name } -func (o *Asset) GetSource() Source { +func (o *Asset) GetPlaybackID() *string { if o == nil { - return Source{} + return nil } - return o.Source + return o.PlaybackID } -func (o *Asset) GetCreatorID() *CreatorID { +func (o *Asset) GetPlaybackPolicy() *PlaybackPolicy { if o == nil { return nil } - return o.CreatorID + return o.PlaybackPolicy } -func (o *Asset) GetStorage() *AssetStorage { +func (o *Asset) GetPlaybackURL() *string { if o == nil { return nil } - return o.Storage + return o.PlaybackURL } -func (o *Asset) GetStatus() *AssetStatus { +func (o *Asset) GetProfiles() []TranscodeProfile { if o == nil { return nil } - return o.Status + return o.Profiles } -func (o *Asset) GetName() string { +func (o *Asset) GetProjectID() *string { if o == nil { - return "" + return nil } - return o.Name + return o.ProjectID } -func (o *Asset) GetProjectID() *string { +func (o *Asset) GetSize() *float64 { if o == nil { return nil } - return o.ProjectID + return o.Size } -func (o *Asset) GetCreatedAt() *float64 { +func (o *Asset) GetSource() Source { + if o == nil { + return Source{} + } + return o.Source +} + +func (o *Asset) GetStatus() *Status { if o == nil { return nil } - return o.CreatedAt + return o.Status } -func (o *Asset) GetCreatedByTokenName() *string { +func (o *Asset) GetStorage() *AssetStorage { if o == nil { return nil } - return o.CreatedByTokenName + return o.Storage } -func (o *Asset) GetSize() *float64 { +func (o *Asset) GetType() *AssetType { if o == nil { return nil } - return o.Size + return o.Type } -func (o *Asset) GetHash() []Hash { +func (o *Asset) GetUserID() *string { if o == nil { return nil } - return o.Hash + return o.UserID } func (o *Asset) GetVideoSpec() *VideoSpec { diff --git a/models/components/assetpatchpayload.go b/models/components/assetpatchpayload.go index 3842ddb..4817c85 100644 --- a/models/components/assetpatchpayload.go +++ b/models/components/assetpatchpayload.go @@ -3,27 +3,27 @@ package components type AssetPatchPayload struct { + CreatorID *InputCreatorID `json:"creatorId,omitempty"` // The name of the asset. This is not necessarily the filename - it can be a custom name or title. // - Name *string `json:"name,omitempty"` - CreatorID *InputCreatorID `json:"creatorId,omitempty"` + Name *string `json:"name,omitempty"` // Whether the playback policy for an asset or stream is public or signed PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` Storage *Storage `json:"storage,omitempty"` } -func (o *AssetPatchPayload) GetName() *string { +func (o *AssetPatchPayload) GetCreatorID() *InputCreatorID { if o == nil { return nil } - return o.Name + return o.CreatorID } -func (o *AssetPatchPayload) GetCreatorID() *InputCreatorID { +func (o *AssetPatchPayload) GetName() *string { if o == nil { return nil } - return o.CreatorID + return o.Name } func (o *AssetPatchPayload) GetPlaybackPolicy() *PlaybackPolicy { diff --git a/models/components/attestation.go b/models/components/attestation.go index 6897e40..03432e0 100644 --- a/models/components/attestation.go +++ b/models/components/attestation.go @@ -7,30 +7,6 @@ import ( "fmt" ) -// PrimaryType - Video Metadata EIP-712 primaryType -type PrimaryType string - -const ( - PrimaryTypeVideoAttestation PrimaryType = "VideoAttestation" -) - -func (e PrimaryType) ToPointer() *PrimaryType { - return &e -} -func (e *PrimaryType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "VideoAttestation": - *e = PrimaryType(v) - return nil - default: - return fmt.Errorf("invalid value for PrimaryType: %v", v) - } -} - type Name string const ( @@ -98,37 +74,30 @@ func (o *Domain) GetVersion() Version { } type Attestations struct { - Role string `json:"role"` Address string `json:"address"` + Role string `json:"role"` } -func (o *Attestations) GetRole() string { +func (o *Attestations) GetAddress() string { if o == nil { return "" } - return o.Role + return o.Address } -func (o *Attestations) GetAddress() string { +func (o *Attestations) GetRole() string { if o == nil { return "" } - return o.Address + return o.Role } // Message - Video Metadata EIP-712 message content type Message struct { - Video string `json:"video"` Attestations []Attestations `json:"attestations"` Signer string `json:"signer"` Timestamp float64 `json:"timestamp"` -} - -func (o *Message) GetVideo() string { - if o == nil { - return "" - } - return o.Video + Video string `json:"video"` } func (o *Message) GetAttestations() []Attestations { @@ -152,6 +121,37 @@ func (o *Message) GetTimestamp() float64 { return o.Timestamp } +func (o *Message) GetVideo() string { + if o == nil { + return "" + } + return o.Video +} + +// PrimaryType - Video Metadata EIP-712 primaryType +type PrimaryType string + +const ( + PrimaryTypeVideoAttestation PrimaryType = "VideoAttestation" +) + +func (e PrimaryType) ToPointer() *PrimaryType { + return &e +} +func (e *PrimaryType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "VideoAttestation": + *e = PrimaryType(v) + return nil + default: + return fmt.Errorf("invalid value for PrimaryType: %v", v) + } +} + type SignatureType string const ( @@ -219,40 +219,40 @@ func (o *AttestationStorage) GetStatus() *StorageStatus { } type Attestation struct { - ID *string `json:"id,omitempty"` - // Video Metadata EIP-712 primaryType - PrimaryType PrimaryType `json:"primaryType"` + // Timestamp (in milliseconds) at which the object was created + CreatedAt *float64 `json:"createdAt,omitempty"` // Video Metadata EIP-712 domain - Domain Domain `json:"domain"` + Domain Domain `json:"domain"` + ID *string `json:"id,omitempty"` // Video Metadata EIP-712 message content Message Message `json:"message"` + // Video Metadata EIP-712 primaryType + PrimaryType PrimaryType `json:"primaryType"` // Video Metadata EIP-712 message signature - Signature string `json:"signature"` - // Timestamp (in milliseconds) at which the object was created - CreatedAt *float64 `json:"createdAt,omitempty"` + Signature string `json:"signature"` SignatureType *SignatureType `json:"signatureType,omitempty"` Storage *AttestationStorage `json:"storage,omitempty"` } -func (o *Attestation) GetID() *string { +func (o *Attestation) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *Attestation) GetPrimaryType() PrimaryType { +func (o *Attestation) GetDomain() Domain { if o == nil { - return PrimaryType("") + return Domain{} } - return o.PrimaryType + return o.Domain } -func (o *Attestation) GetDomain() Domain { +func (o *Attestation) GetID() *string { if o == nil { - return Domain{} + return nil } - return o.Domain + return o.ID } func (o *Attestation) GetMessage() Message { @@ -262,18 +262,18 @@ func (o *Attestation) GetMessage() Message { return o.Message } -func (o *Attestation) GetSignature() string { +func (o *Attestation) GetPrimaryType() PrimaryType { if o == nil { - return "" + return PrimaryType("") } - return o.Signature + return o.PrimaryType } -func (o *Attestation) GetCreatedAt() *float64 { +func (o *Attestation) GetSignature() string { if o == nil { - return nil + return "" } - return o.CreatedAt + return o.Signature } func (o *Attestation) GetSignatureType() *SignatureType { diff --git a/models/components/clippayload.go b/models/components/clippayload.go index 8cb2ca8..c53e0e5 100644 --- a/models/components/clippayload.go +++ b/models/components/clippayload.go @@ -3,30 +3,16 @@ package components type ClipPayload struct { - // The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. - PlaybackID string `json:"playbackId"` - // The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ - StartTime float64 `json:"startTime"` // The end timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ EndTime *float64 `json:"endTime,omitempty"` // The optional friendly name of the clip to create. Name *string `json:"name,omitempty"` + // The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. + PlaybackID string `json:"playbackId"` // The optional session ID of the stream to clip. This can be used to clip _recordings_ - if it is not specified, it will clip the ongoing livestream. SessionID *string `json:"sessionId,omitempty"` -} - -func (o *ClipPayload) GetPlaybackID() string { - if o == nil { - return "" - } - return o.PlaybackID -} - -func (o *ClipPayload) GetStartTime() float64 { - if o == nil { - return 0.0 - } - return o.StartTime + // The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ + StartTime float64 `json:"startTime"` } func (o *ClipPayload) GetEndTime() *float64 { @@ -43,9 +29,23 @@ func (o *ClipPayload) GetName() *string { return o.Name } +func (o *ClipPayload) GetPlaybackID() string { + if o == nil { + return "" + } + return o.PlaybackID +} + func (o *ClipPayload) GetSessionID() *string { if o == nil { return nil } return o.SessionID } + +func (o *ClipPayload) GetStartTime() float64 { + if o == nil { + return 0.0 + } + return o.StartTime +} diff --git a/models/components/exporttaskparams.go b/models/components/exporttaskparams.go index 2587d0f..9fc1256 100644 --- a/models/components/exporttaskparams.go +++ b/models/components/exporttaskparams.go @@ -21,12 +21,12 @@ func (o *ExportTaskParams2) GetIpfs() IpfsExportParams { // Custom - custom URL parameters for the export task type Custom struct { - // URL where to export the asset - URL string `json:"url"` - // Method to use on the export request - Method *string `default:"PUT" json:"method"` // Headers to add to the export request Headers map[string]string `json:"headers,omitempty"` + // Method to use on the export request + Method *string `default:"PUT" json:"method"` + // URL where to export the asset + URL string `json:"url"` } func (c Custom) MarshalJSON() ([]byte, error) { @@ -40,11 +40,11 @@ func (c *Custom) UnmarshalJSON(data []byte) error { return nil } -func (o *Custom) GetURL() string { +func (o *Custom) GetHeaders() map[string]string { if o == nil { - return "" + return nil } - return o.URL + return o.Headers } func (o *Custom) GetMethod() *string { @@ -54,11 +54,11 @@ func (o *Custom) GetMethod() *string { return o.Method } -func (o *Custom) GetHeaders() map[string]string { +func (o *Custom) GetURL() string { if o == nil { - return nil + return "" } - return o.Headers + return o.URL } type ExportTaskParams1 struct { diff --git a/models/components/ffmpegprofile.go b/models/components/ffmpegprofile.go index 707db8e..bcd7b47 100644 --- a/models/components/ffmpegprofile.go +++ b/models/components/ffmpegprofile.go @@ -7,143 +7,143 @@ import ( "fmt" ) -type Profile string +type FfmpegProfileEncoder string const ( - ProfileH264Baseline Profile = "H264Baseline" - ProfileH264Main Profile = "H264Main" - ProfileH264High Profile = "H264High" - ProfileH264ConstrainedHigh Profile = "H264ConstrainedHigh" + FfmpegProfileEncoderH264 FfmpegProfileEncoder = "H.264" ) -func (e Profile) ToPointer() *Profile { +func (e FfmpegProfileEncoder) ToPointer() *FfmpegProfileEncoder { return &e } -func (e *Profile) UnmarshalJSON(data []byte) error { +func (e *FfmpegProfileEncoder) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "H264Baseline": - fallthrough - case "H264Main": - fallthrough - case "H264High": - fallthrough - case "H264ConstrainedHigh": - *e = Profile(v) + case "H.264": + *e = FfmpegProfileEncoder(v) return nil default: - return fmt.Errorf("invalid value for Profile: %v", v) + return fmt.Errorf("invalid value for FfmpegProfileEncoder: %v", v) } } -type Encoder string +type FfmpegProfileProfile string const ( - EncoderH264 Encoder = "H.264" + FfmpegProfileProfileH264Baseline FfmpegProfileProfile = "H264Baseline" + FfmpegProfileProfileH264Main FfmpegProfileProfile = "H264Main" + FfmpegProfileProfileH264High FfmpegProfileProfile = "H264High" + FfmpegProfileProfileH264ConstrainedHigh FfmpegProfileProfile = "H264ConstrainedHigh" ) -func (e Encoder) ToPointer() *Encoder { +func (e FfmpegProfileProfile) ToPointer() *FfmpegProfileProfile { return &e } -func (e *Encoder) UnmarshalJSON(data []byte) error { +func (e *FfmpegProfileProfile) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "H.264": - *e = Encoder(v) + case "H264Baseline": + fallthrough + case "H264Main": + fallthrough + case "H264High": + fallthrough + case "H264ConstrainedHigh": + *e = FfmpegProfileProfile(v) return nil default: - return fmt.Errorf("invalid value for Encoder: %v", v) + return fmt.Errorf("invalid value for FfmpegProfileProfile: %v", v) } } // FfmpegProfile - Transcode profile type FfmpegProfile struct { - Width int64 `json:"width"` - Name string `json:"name"` - Height int64 `json:"height"` - Bitrate int64 `json:"bitrate"` - Fps int64 `json:"fps"` - FpsDen *int64 `json:"fpsDen,omitempty"` + Bitrate int64 `json:"bitrate"` + Encoder *FfmpegProfileEncoder `json:"encoder,omitempty"` + Fps int64 `json:"fps"` + FpsDen *int64 `json:"fpsDen,omitempty"` + Gop *string `json:"gop,omitempty"` + Height int64 `json:"height"` + Name string `json:"name"` + Profile *FfmpegProfileProfile `json:"profile,omitempty"` // Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it. // - Quality *int64 `json:"quality,omitempty"` - Gop *string `json:"gop,omitempty"` - Profile *Profile `json:"profile,omitempty"` - Encoder *Encoder `json:"encoder,omitempty"` + Quality *int64 `json:"quality,omitempty"` + Width int64 `json:"width"` } -func (o *FfmpegProfile) GetWidth() int64 { +func (o *FfmpegProfile) GetBitrate() int64 { if o == nil { return 0 } - return o.Width + return o.Bitrate } -func (o *FfmpegProfile) GetName() string { +func (o *FfmpegProfile) GetEncoder() *FfmpegProfileEncoder { if o == nil { - return "" + return nil } - return o.Name + return o.Encoder } -func (o *FfmpegProfile) GetHeight() int64 { +func (o *FfmpegProfile) GetFps() int64 { if o == nil { return 0 } - return o.Height + return o.Fps } -func (o *FfmpegProfile) GetBitrate() int64 { +func (o *FfmpegProfile) GetFpsDen() *int64 { if o == nil { - return 0 + return nil } - return o.Bitrate + return o.FpsDen } -func (o *FfmpegProfile) GetFps() int64 { +func (o *FfmpegProfile) GetGop() *string { if o == nil { - return 0 + return nil } - return o.Fps + return o.Gop } -func (o *FfmpegProfile) GetFpsDen() *int64 { +func (o *FfmpegProfile) GetHeight() int64 { if o == nil { - return nil + return 0 } - return o.FpsDen + return o.Height } -func (o *FfmpegProfile) GetQuality() *int64 { +func (o *FfmpegProfile) GetName() string { if o == nil { - return nil + return "" } - return o.Quality + return o.Name } -func (o *FfmpegProfile) GetGop() *string { +func (o *FfmpegProfile) GetProfile() *FfmpegProfileProfile { if o == nil { return nil } - return o.Gop + return o.Profile } -func (o *FfmpegProfile) GetProfile() *Profile { +func (o *FfmpegProfile) GetQuality() *int64 { if o == nil { return nil } - return o.Profile + return o.Quality } -func (o *FfmpegProfile) GetEncoder() *Encoder { +func (o *FfmpegProfile) GetWidth() int64 { if o == nil { - return nil + return 0 } - return o.Encoder + return o.Width } diff --git a/models/components/getroomuserresponse.go b/models/components/getroomuserresponse.go index ea9b187..87bbf76 100644 --- a/models/components/getroomuserresponse.go +++ b/models/components/getroomuserresponse.go @@ -9,14 +9,14 @@ import ( type GetRoomUserResponse struct { // The ID of the user ID *string `json:"id,omitempty"` - // Timestamp (in milliseconds) at which the user joined - JoinedAt *int64 `json:"joinedAt,omitempty"` - // The display name of the user - Name *string `json:"name,omitempty"` // Whether a user is allowed to publish audio/video tracks IsPublisher *bool `default:"true" json:"isPublisher"` + // Timestamp (in milliseconds) at which the user joined + JoinedAt *int64 `json:"joinedAt,omitempty"` // User defined payload to store for the participant Metadata *string `json:"metadata,omitempty"` + // The display name of the user + Name *string `json:"name,omitempty"` } func (g GetRoomUserResponse) MarshalJSON() ([]byte, error) { @@ -37,30 +37,30 @@ func (o *GetRoomUserResponse) GetID() *string { return o.ID } -func (o *GetRoomUserResponse) GetJoinedAt() *int64 { +func (o *GetRoomUserResponse) GetIsPublisher() *bool { if o == nil { return nil } - return o.JoinedAt + return o.IsPublisher } -func (o *GetRoomUserResponse) GetName() *string { +func (o *GetRoomUserResponse) GetJoinedAt() *int64 { if o == nil { return nil } - return o.Name + return o.JoinedAt } -func (o *GetRoomUserResponse) GetIsPublisher() *bool { +func (o *GetRoomUserResponse) GetMetadata() *string { if o == nil { return nil } - return o.IsPublisher + return o.Metadata } -func (o *GetRoomUserResponse) GetMetadata() *string { +func (o *GetRoomUserResponse) GetName() *string { if o == nil { return nil } - return o.Metadata + return o.Name } diff --git a/models/components/ipfsfileinfo.go b/models/components/ipfsfileinfo.go index 5be414f..b17cd40 100644 --- a/models/components/ipfsfileinfo.go +++ b/models/components/ipfsfileinfo.go @@ -5,10 +5,10 @@ package components type IpfsFileInfo struct { // CID of the file on IPFS Cid string `json:"cid"` - // URL with IPFS scheme for the file - URL *string `json:"url,omitempty"` // URL to access file via HTTP through an IPFS gateway GatewayURL *string `json:"gatewayUrl,omitempty"` + // URL with IPFS scheme for the file + URL *string `json:"url,omitempty"` } func (o *IpfsFileInfo) GetCid() string { @@ -18,16 +18,16 @@ func (o *IpfsFileInfo) GetCid() string { return o.Cid } -func (o *IpfsFileInfo) GetURL() *string { +func (o *IpfsFileInfo) GetGatewayURL() *string { if o == nil { return nil } - return o.URL + return o.GatewayURL } -func (o *IpfsFileInfo) GetGatewayURL() *string { +func (o *IpfsFileInfo) GetURL() *string { if o == nil { return nil } - return o.GatewayURL + return o.URL } diff --git a/models/components/multistreamtarget.go b/models/components/multistreamtarget.go index a6b42b0..b595443 100644 --- a/models/components/multistreamtarget.go +++ b/models/components/multistreamtarget.go @@ -3,51 +3,51 @@ package components type MultistreamTarget struct { - ID *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - UserID *string `json:"userId,omitempty"` - // If true then this multistream target will not be used for pushing - // even if it is configured in a stream object. - // - Disabled *bool `json:"disabled,omitempty"` // Timestamp (in milliseconds) at which multistream target object was // created // CreatedAt *float64 `json:"createdAt,omitempty"` + // If true then this multistream target will not be used for pushing + // even if it is configured in a stream object. + // + Disabled *bool `json:"disabled,omitempty"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + UserID *string `json:"userId,omitempty"` } -func (o *MultistreamTarget) GetID() *string { +func (o *MultistreamTarget) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *MultistreamTarget) GetName() *string { +func (o *MultistreamTarget) GetDisabled() *bool { if o == nil { return nil } - return o.Name + return o.Disabled } -func (o *MultistreamTarget) GetUserID() *string { +func (o *MultistreamTarget) GetID() *string { if o == nil { return nil } - return o.UserID + return o.ID } -func (o *MultistreamTarget) GetDisabled() *bool { +func (o *MultistreamTarget) GetName() *string { if o == nil { return nil } - return o.Disabled + return o.Name } -func (o *MultistreamTarget) GetCreatedAt() *float64 { +func (o *MultistreamTarget) GetUserID() *string { if o == nil { return nil } - return o.CreatedAt + return o.UserID } diff --git a/models/components/multistreamtargetinput.go b/models/components/multistreamtargetinput.go index 5b6873e..e75d382 100644 --- a/models/components/multistreamtargetinput.go +++ b/models/components/multistreamtargetinput.go @@ -3,13 +3,20 @@ package components type MultistreamTargetInput struct { - Name *string `json:"name,omitempty"` - // Livepeer-compatible multistream target URL (RTMP(S) or SRT) - URL string `json:"url"` // If true then this multistream target will not be used for pushing // even if it is configured in a stream object. // - Disabled *bool `json:"disabled,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Name *string `json:"name,omitempty"` + // Livepeer-compatible multistream target URL (RTMP(S) or SRT) + URL string `json:"url"` +} + +func (o *MultistreamTargetInput) GetDisabled() *bool { + if o == nil { + return nil + } + return o.Disabled } func (o *MultistreamTargetInput) GetName() *string { @@ -25,10 +32,3 @@ func (o *MultistreamTargetInput) GetURL() string { } return o.URL } - -func (o *MultistreamTargetInput) GetDisabled() *bool { - if o == nil { - return nil - } - return o.Disabled -} diff --git a/models/components/multistreamtargetpatchpayload.go b/models/components/multistreamtargetpatchpayload.go index f626e55..1bdc3e7 100644 --- a/models/components/multistreamtargetpatchpayload.go +++ b/models/components/multistreamtargetpatchpayload.go @@ -3,13 +3,20 @@ package components type MultistreamTargetPatchPayload struct { - Name *string `json:"name,omitempty"` - // Livepeer-compatible multistream target URL (RTMP(S) or SRT) - URL string `json:"url"` // If true then this multistream target will not be used for pushing // even if it is configured in a stream object. // - Disabled *bool `json:"disabled,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + Name *string `json:"name,omitempty"` + // Livepeer-compatible multistream target URL (RTMP(S) or SRT) + URL string `json:"url"` +} + +func (o *MultistreamTargetPatchPayload) GetDisabled() *bool { + if o == nil { + return nil + } + return o.Disabled } func (o *MultistreamTargetPatchPayload) GetName() *string { @@ -25,10 +32,3 @@ func (o *MultistreamTargetPatchPayload) GetURL() string { } return o.URL } - -func (o *MultistreamTargetPatchPayload) GetDisabled() *bool { - if o == nil { - return nil - } - return o.Disabled -} diff --git a/models/components/newassetfromurlpayload.go b/models/components/newassetfromurlpayload.go index 572ae6e..6888e0a 100644 --- a/models/components/newassetfromurlpayload.go +++ b/models/components/newassetfromurlpayload.go @@ -3,94 +3,94 @@ package components type NewAssetFromURLPayload struct { + // Decides if the output video should include C2PA signature + C2pa *bool `json:"c2pa,omitempty"` + CreatorID *InputCreatorID `json:"creatorId,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` // The name of the asset. This is not necessarily the filename - it can be a custom name or title. // Name string `json:"name"` - // Whether to generate MP4s for the asset. - StaticMp4 *bool `json:"staticMp4,omitempty"` // Whether the playback policy for an asset or stream is public or signed - PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - CreatorID *InputCreatorID `json:"creatorId,omitempty"` - Storage *Storage `json:"storage,omitempty"` + PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` + Profiles []TranscodeProfile `json:"profiles,omitempty"` + // Whether to generate MP4s for the asset. + StaticMp4 *bool `json:"staticMp4,omitempty"` + Storage *Storage `json:"storage,omitempty"` + // How many seconds the duration of each output segment should be + TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` // URL where the asset contents can be retrieved, e.g. `https://s3.amazonaws.com/my-bucket/path/filename.mp4`. // For an IPFS source, this should be similar to: `ipfs://{CID}`. For an Arweave // source: `ar://{CID}`. // - URL string `json:"url"` - Encryption *Encryption `json:"encryption,omitempty"` - // Decides if the output video should include C2PA signature - C2pa *bool `json:"c2pa,omitempty"` - Profiles []TranscodeProfile `json:"profiles,omitempty"` - // How many seconds the duration of each output segment should be - TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` + URL string `json:"url"` } -func (o *NewAssetFromURLPayload) GetName() string { +func (o *NewAssetFromURLPayload) GetC2pa() *bool { if o == nil { - return "" + return nil } - return o.Name + return o.C2pa } -func (o *NewAssetFromURLPayload) GetStaticMp4() *bool { +func (o *NewAssetFromURLPayload) GetCreatorID() *InputCreatorID { if o == nil { return nil } - return o.StaticMp4 + return o.CreatorID } -func (o *NewAssetFromURLPayload) GetPlaybackPolicy() *PlaybackPolicy { +func (o *NewAssetFromURLPayload) GetEncryption() *Encryption { if o == nil { return nil } - return o.PlaybackPolicy + return o.Encryption } -func (o *NewAssetFromURLPayload) GetCreatorID() *InputCreatorID { +func (o *NewAssetFromURLPayload) GetName() string { if o == nil { - return nil + return "" } - return o.CreatorID + return o.Name } -func (o *NewAssetFromURLPayload) GetStorage() *Storage { +func (o *NewAssetFromURLPayload) GetPlaybackPolicy() *PlaybackPolicy { if o == nil { return nil } - return o.Storage + return o.PlaybackPolicy } -func (o *NewAssetFromURLPayload) GetURL() string { +func (o *NewAssetFromURLPayload) GetProfiles() []TranscodeProfile { if o == nil { - return "" + return nil } - return o.URL + return o.Profiles } -func (o *NewAssetFromURLPayload) GetEncryption() *Encryption { +func (o *NewAssetFromURLPayload) GetStaticMp4() *bool { if o == nil { return nil } - return o.Encryption + return o.StaticMp4 } -func (o *NewAssetFromURLPayload) GetC2pa() *bool { +func (o *NewAssetFromURLPayload) GetStorage() *Storage { if o == nil { return nil } - return o.C2pa + return o.Storage } -func (o *NewAssetFromURLPayload) GetProfiles() []TranscodeProfile { +func (o *NewAssetFromURLPayload) GetTargetSegmentSizeSecs() *float64 { if o == nil { return nil } - return o.Profiles + return o.TargetSegmentSizeSecs } -func (o *NewAssetFromURLPayload) GetTargetSegmentSizeSecs() *float64 { +func (o *NewAssetFromURLPayload) GetURL() string { if o == nil { - return nil + return "" } - return o.TargetSegmentSizeSecs + return o.URL } diff --git a/models/components/newassetpayload.go b/models/components/newassetpayload.go index 52e4077..7c24884 100644 --- a/models/components/newassetpayload.go +++ b/models/components/newassetpayload.go @@ -8,11 +8,23 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) -type NewAssetPayloadIpfs1 struct { +type NewAssetPayloadEncryption struct { + // Encryption key used to encrypt the asset. Only writable in the upload asset endpoints and cannot be retrieved back. + EncryptedKey string `json:"encryptedKey"` +} + +func (o *NewAssetPayloadEncryption) GetEncryptedKey() string { + if o == nil { + return "" + } + return o.EncryptedKey +} + +type Ipfs1 struct { Spec *Spec `json:"spec,omitempty"` } -func (o *NewAssetPayloadIpfs1) GetSpec() *Spec { +func (o *Ipfs1) GetSpec() *Spec { if o == nil { return nil } @@ -22,26 +34,26 @@ func (o *NewAssetPayloadIpfs1) GetSpec() *Spec { type NewAssetPayloadIpfsType string const ( - NewAssetPayloadIpfsTypeNewAssetPayloadIpfs1 NewAssetPayloadIpfsType = "new-asset-payload_ipfs_1" - NewAssetPayloadIpfsTypeBoolean NewAssetPayloadIpfsType = "boolean" + NewAssetPayloadIpfsTypeIpfs1 NewAssetPayloadIpfsType = "ipfs_1" + NewAssetPayloadIpfsTypeBoolean NewAssetPayloadIpfsType = "boolean" ) // NewAssetPayloadIpfs - Set to true to make default export to IPFS. To customize the // pinned files, specify an object with a spec field. False or null // means to unpin from IPFS, but it's unsupported right now. type NewAssetPayloadIpfs struct { - NewAssetPayloadIpfs1 *NewAssetPayloadIpfs1 - Boolean *bool + Ipfs1 *Ipfs1 + Boolean *bool Type NewAssetPayloadIpfsType } -func CreateNewAssetPayloadIpfsNewAssetPayloadIpfs1(newAssetPayloadIpfs1 NewAssetPayloadIpfs1) NewAssetPayloadIpfs { - typ := NewAssetPayloadIpfsTypeNewAssetPayloadIpfs1 +func CreateNewAssetPayloadIpfsIpfs1(ipfs1 Ipfs1) NewAssetPayloadIpfs { + typ := NewAssetPayloadIpfsTypeIpfs1 return NewAssetPayloadIpfs{ - NewAssetPayloadIpfs1: &newAssetPayloadIpfs1, - Type: typ, + Ipfs1: &ipfs1, + Type: typ, } } @@ -56,10 +68,10 @@ func CreateNewAssetPayloadIpfsBoolean(boolean bool) NewAssetPayloadIpfs { func (u *NewAssetPayloadIpfs) UnmarshalJSON(data []byte) error { - var newAssetPayloadIpfs1 NewAssetPayloadIpfs1 = NewAssetPayloadIpfs1{} - if err := utils.UnmarshalJSON(data, &newAssetPayloadIpfs1, "", true, true); err == nil { - u.NewAssetPayloadIpfs1 = &newAssetPayloadIpfs1 - u.Type = NewAssetPayloadIpfsTypeNewAssetPayloadIpfs1 + var ipfs1 Ipfs1 = Ipfs1{} + if err := utils.UnmarshalJSON(data, &ipfs1, "", true, true); err == nil { + u.Ipfs1 = &ipfs1 + u.Type = NewAssetPayloadIpfsTypeIpfs1 return nil } @@ -74,8 +86,8 @@ func (u *NewAssetPayloadIpfs) UnmarshalJSON(data []byte) error { } func (u NewAssetPayloadIpfs) MarshalJSON() ([]byte, error) { - if u.NewAssetPayloadIpfs1 != nil { - return utils.MarshalJSON(u.NewAssetPayloadIpfs1, "", true) + if u.Ipfs1 != nil { + return utils.MarshalJSON(u.Ipfs1, "", true) } if u.Boolean != nil { @@ -100,90 +112,78 @@ func (o *NewAssetPayloadStorage) GetIpfs() *NewAssetPayloadIpfs { return o.Ipfs } -type NewAssetPayloadEncryption struct { - // Encryption key used to encrypt the asset. Only writable in the upload asset endpoints and cannot be retrieved back. - EncryptedKey string `json:"encryptedKey"` -} - -func (o *NewAssetPayloadEncryption) GetEncryptedKey() string { - if o == nil { - return "" - } - return o.EncryptedKey -} - type NewAssetPayload struct { + // Decides if the output video should include C2PA signature + C2pa *bool `json:"c2pa,omitempty"` + CreatorID *InputCreatorID `json:"creatorId,omitempty"` + Encryption *NewAssetPayloadEncryption `json:"encryption,omitempty"` // The name of the asset. This is not necessarily the filename - it can be a custom name or title. // Name string `json:"name"` - // Whether to generate MP4s for the asset. - StaticMp4 *bool `json:"staticMp4,omitempty"` // Whether the playback policy for an asset or stream is public or signed - PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - CreatorID *InputCreatorID `json:"creatorId,omitempty"` - Storage *NewAssetPayloadStorage `json:"storage,omitempty"` - Encryption *NewAssetPayloadEncryption `json:"encryption,omitempty"` - // Decides if the output video should include C2PA signature - C2pa *bool `json:"c2pa,omitempty"` - Profiles []TranscodeProfile `json:"profiles,omitempty"` + PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` + Profiles []TranscodeProfile `json:"profiles,omitempty"` + // Whether to generate MP4s for the asset. + StaticMp4 *bool `json:"staticMp4,omitempty"` + Storage *NewAssetPayloadStorage `json:"storage,omitempty"` // How many seconds the duration of each output segment should be TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` } -func (o *NewAssetPayload) GetName() string { +func (o *NewAssetPayload) GetC2pa() *bool { if o == nil { - return "" + return nil } - return o.Name + return o.C2pa } -func (o *NewAssetPayload) GetStaticMp4() *bool { +func (o *NewAssetPayload) GetCreatorID() *InputCreatorID { if o == nil { return nil } - return o.StaticMp4 + return o.CreatorID } -func (o *NewAssetPayload) GetPlaybackPolicy() *PlaybackPolicy { +func (o *NewAssetPayload) GetEncryption() *NewAssetPayloadEncryption { if o == nil { return nil } - return o.PlaybackPolicy + return o.Encryption } -func (o *NewAssetPayload) GetCreatorID() *InputCreatorID { +func (o *NewAssetPayload) GetName() string { if o == nil { - return nil + return "" } - return o.CreatorID + return o.Name } -func (o *NewAssetPayload) GetStorage() *NewAssetPayloadStorage { +func (o *NewAssetPayload) GetPlaybackPolicy() *PlaybackPolicy { if o == nil { return nil } - return o.Storage + return o.PlaybackPolicy } -func (o *NewAssetPayload) GetEncryption() *NewAssetPayloadEncryption { +func (o *NewAssetPayload) GetProfiles() []TranscodeProfile { if o == nil { return nil } - return o.Encryption + return o.Profiles } -func (o *NewAssetPayload) GetC2pa() *bool { +func (o *NewAssetPayload) GetStaticMp4() *bool { if o == nil { return nil } - return o.C2pa + return o.StaticMp4 } -func (o *NewAssetPayload) GetProfiles() []TranscodeProfile { +func (o *NewAssetPayload) GetStorage() *NewAssetPayloadStorage { if o == nil { return nil } - return o.Profiles + return o.Storage } func (o *NewAssetPayload) GetTargetSegmentSizeSecs() *float64 { diff --git a/models/components/newstreampayload.go b/models/components/newstreampayload.go index e6da024..0d39d44 100644 --- a/models/components/newstreampayload.go +++ b/models/components/newstreampayload.go @@ -2,48 +2,56 @@ package components +type NewStreamPayloadRecordingSpec struct { + Profiles []TranscodeProfile `json:"profiles,omitempty"` +} + +func (o *NewStreamPayloadRecordingSpec) GetProfiles() []TranscodeProfile { + if o == nil { + return nil + } + return o.Profiles +} + type NewStreamPayload struct { - Name string `json:"name"` - // Configuration for a stream that should be actively pulled from an - // external source, rather than pushed to Livepeer. If specified, the - // stream will not have a streamKey. - Pull *Pull `json:"pull,omitempty"` - CreatorID *InputCreatorID `json:"creatorId,omitempty"` + CreatorID *InputCreatorID `json:"creatorId,omitempty"` + Multistream *Multistream `json:"multistream,omitempty"` + Name string `json:"name"` // Whether the playback policy for an asset or stream is public or signed PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` Profiles []FfmpegProfile `json:"profiles"` + // Configuration for a stream that should be actively pulled from an + // external source, rather than pushed to Livepeer. If specified, the + // stream will not have a streamKey. + Pull *Pull `json:"pull,omitempty"` // Should this stream be recorded? Uses default settings. For more // customization, create and configure an object store. // - Record *bool `json:"record,omitempty"` - // Configuration for recording the stream. This can only be set if - // `record` is true. - // - RecordingSpec *RecordingSpec `json:"recordingSpec,omitempty"` - Multistream *Multistream `json:"multistream,omitempty"` + Record *bool `json:"record,omitempty"` + RecordingSpec *NewStreamPayloadRecordingSpec `json:"recordingSpec,omitempty"` // User input tags associated with the stream UserTags map[string]UserTags `json:"userTags,omitempty"` } -func (o *NewStreamPayload) GetName() string { +func (o *NewStreamPayload) GetCreatorID() *InputCreatorID { if o == nil { - return "" + return nil } - return o.Name + return o.CreatorID } -func (o *NewStreamPayload) GetPull() *Pull { +func (o *NewStreamPayload) GetMultistream() *Multistream { if o == nil { return nil } - return o.Pull + return o.Multistream } -func (o *NewStreamPayload) GetCreatorID() *InputCreatorID { +func (o *NewStreamPayload) GetName() string { if o == nil { - return nil + return "" } - return o.CreatorID + return o.Name } func (o *NewStreamPayload) GetPlaybackPolicy() *PlaybackPolicy { @@ -60,25 +68,25 @@ func (o *NewStreamPayload) GetProfiles() []FfmpegProfile { return o.Profiles } -func (o *NewStreamPayload) GetRecord() *bool { +func (o *NewStreamPayload) GetPull() *Pull { if o == nil { return nil } - return o.Record + return o.Pull } -func (o *NewStreamPayload) GetRecordingSpec() *RecordingSpec { +func (o *NewStreamPayload) GetRecord() *bool { if o == nil { return nil } - return o.RecordingSpec + return o.Record } -func (o *NewStreamPayload) GetMultistream() *Multistream { +func (o *NewStreamPayload) GetRecordingSpec() *NewStreamPayloadRecordingSpec { if o == nil { return nil } - return o.Multistream + return o.RecordingSpec } func (o *NewStreamPayload) GetUserTags() map[string]UserTags { diff --git a/models/components/playbackinfo.go b/models/components/playbackinfo.go index e5226c9..c511340 100644 --- a/models/components/playbackinfo.go +++ b/models/components/playbackinfo.go @@ -7,35 +7,87 @@ import ( "fmt" ) -type PlaybackInfoType string +type Hrn string const ( - PlaybackInfoTypeLive PlaybackInfoType = "live" - PlaybackInfoTypeVod PlaybackInfoType = "vod" - PlaybackInfoTypeRecording PlaybackInfoType = "recording" + HrnHlsTs Hrn = "HLS (TS)" ) -func (e PlaybackInfoType) ToPointer() *PlaybackInfoType { +func (e Hrn) ToPointer() *Hrn { return &e } -func (e *PlaybackInfoType) UnmarshalJSON(data []byte) error { +func (e *Hrn) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "live": - fallthrough - case "vod": - fallthrough - case "recording": - *e = PlaybackInfoType(v) + case "HLS (TS)": + *e = Hrn(v) return nil default: - return fmt.Errorf("invalid value for PlaybackInfoType: %v", v) + return fmt.Errorf("invalid value for Hrn: %v", v) } } +type PlaybackInfoMetaDvrPlaybackType string + +const ( + PlaybackInfoMetaDvrPlaybackTypeHtml5ApplicationVndAppleMpegurl PlaybackInfoMetaDvrPlaybackType = "html5/application/vnd.apple.mpegurl" +) + +func (e PlaybackInfoMetaDvrPlaybackType) ToPointer() *PlaybackInfoMetaDvrPlaybackType { + return &e +} +func (e *PlaybackInfoMetaDvrPlaybackType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "html5/application/vnd.apple.mpegurl": + *e = PlaybackInfoMetaDvrPlaybackType(v) + return nil + default: + return fmt.Errorf("invalid value for PlaybackInfoMetaDvrPlaybackType: %v", v) + } +} + +type DvrPlayback struct { + Error *string `json:"error,omitempty"` + Hrn *Hrn `json:"hrn,omitempty"` + Type *PlaybackInfoMetaDvrPlaybackType `json:"type,omitempty"` + URL *string `json:"url,omitempty"` +} + +func (o *DvrPlayback) GetError() *string { + if o == nil { + return nil + } + return o.Error +} + +func (o *DvrPlayback) GetHrn() *Hrn { + if o == nil { + return nil + } + return o.Hrn +} + +func (o *DvrPlayback) GetType() *PlaybackInfoMetaDvrPlaybackType { + if o == nil { + return nil + } + return o.Type +} + +func (o *DvrPlayback) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + type Live int64 const ( @@ -62,22 +114,22 @@ func (e *Live) UnmarshalJSON(data []byte) error { } } -// Hrn - Human Readable Name -type Hrn string +// PlaybackInfoHrn - Human Readable Name +type PlaybackInfoHrn string const ( - HrnHlsTs Hrn = "HLS (TS)" - HrnMp4 Hrn = "MP4" - HrnWebRtcH264 Hrn = "WebRTC (H264)" - HrnFlvH264 Hrn = "FLV (H264)" - HrnThumbnailJpeg Hrn = "Thumbnail (JPEG)" - HrnThumbnails Hrn = "Thumbnails" + PlaybackInfoHrnHlsTs PlaybackInfoHrn = "HLS (TS)" + PlaybackInfoHrnMp4 PlaybackInfoHrn = "MP4" + PlaybackInfoHrnWebRtcH264 PlaybackInfoHrn = "WebRTC (H264)" + PlaybackInfoHrnFlvH264 PlaybackInfoHrn = "FLV (H264)" + PlaybackInfoHrnThumbnailJpeg PlaybackInfoHrn = "Thumbnail (JPEG)" + PlaybackInfoHrnThumbnails PlaybackInfoHrn = "Thumbnails" ) -func (e Hrn) ToPointer() *Hrn { +func (e PlaybackInfoHrn) ToPointer() *PlaybackInfoHrn { return &e } -func (e *Hrn) UnmarshalJSON(data []byte) error { +func (e *PlaybackInfoHrn) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -94,10 +146,10 @@ func (e *Hrn) UnmarshalJSON(data []byte) error { case "Thumbnail (JPEG)": fallthrough case "Thumbnails": - *e = Hrn(v) + *e = PlaybackInfoHrn(v) return nil default: - return fmt.Errorf("invalid value for Hrn: %v", v) + return fmt.Errorf("invalid value for PlaybackInfoHrn: %v", v) } } @@ -140,35 +192,35 @@ func (e *PlaybackInfoMetaType) UnmarshalJSON(data []byte) error { } type PlaybackInfoSource struct { + Bitrate *float64 `json:"bitrate,omitempty"` + Height *float64 `json:"height,omitempty"` // Human Readable Name - Hrn Hrn `json:"hrn"` - Type PlaybackInfoMetaType `json:"type"` - URL string `json:"url"` - Size *float64 `json:"size,omitempty"` - Width *float64 `json:"width,omitempty"` - Height *float64 `json:"height,omitempty"` - Bitrate *float64 `json:"bitrate,omitempty"` + Hrn PlaybackInfoHrn `json:"hrn"` + Size *float64 `json:"size,omitempty"` + Type PlaybackInfoMetaType `json:"type"` + URL string `json:"url"` + Width *float64 `json:"width,omitempty"` } -func (o *PlaybackInfoSource) GetHrn() Hrn { +func (o *PlaybackInfoSource) GetBitrate() *float64 { if o == nil { - return Hrn("") + return nil } - return o.Hrn + return o.Bitrate } -func (o *PlaybackInfoSource) GetType() PlaybackInfoMetaType { +func (o *PlaybackInfoSource) GetHeight() *float64 { if o == nil { - return PlaybackInfoMetaType("") + return nil } - return o.Type + return o.Height } -func (o *PlaybackInfoSource) GetURL() string { +func (o *PlaybackInfoSource) GetHrn() PlaybackInfoHrn { if o == nil { - return "" + return PlaybackInfoHrn("") } - return o.URL + return o.Hrn } func (o *PlaybackInfoSource) GetSize() *float64 { @@ -178,115 +230,48 @@ func (o *PlaybackInfoSource) GetSize() *float64 { return o.Size } -func (o *PlaybackInfoSource) GetWidth() *float64 { - if o == nil { - return nil - } - return o.Width -} - -func (o *PlaybackInfoSource) GetHeight() *float64 { +func (o *PlaybackInfoSource) GetType() PlaybackInfoMetaType { if o == nil { - return nil + return PlaybackInfoMetaType("") } - return o.Height + return o.Type } -func (o *PlaybackInfoSource) GetBitrate() *float64 { +func (o *PlaybackInfoSource) GetURL() string { if o == nil { - return nil - } - return o.Bitrate -} - -type PlaybackInfoHrn string - -const ( - PlaybackInfoHrnHlsTs PlaybackInfoHrn = "HLS (TS)" -) - -func (e PlaybackInfoHrn) ToPointer() *PlaybackInfoHrn { - return &e -} -func (e *PlaybackInfoHrn) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "HLS (TS)": - *e = PlaybackInfoHrn(v) - return nil - default: - return fmt.Errorf("invalid value for PlaybackInfoHrn: %v", v) - } -} - -type PlaybackInfoMetaDvrPlaybackType string - -const ( - PlaybackInfoMetaDvrPlaybackTypeHtml5ApplicationVndAppleMpegurl PlaybackInfoMetaDvrPlaybackType = "html5/application/vnd.apple.mpegurl" -) - -func (e PlaybackInfoMetaDvrPlaybackType) ToPointer() *PlaybackInfoMetaDvrPlaybackType { - return &e -} -func (e *PlaybackInfoMetaDvrPlaybackType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "html5/application/vnd.apple.mpegurl": - *e = PlaybackInfoMetaDvrPlaybackType(v) - return nil - default: - return fmt.Errorf("invalid value for PlaybackInfoMetaDvrPlaybackType: %v", v) + return "" } + return o.URL } -type DvrPlayback struct { - Hrn *PlaybackInfoHrn `json:"hrn,omitempty"` - Type *PlaybackInfoMetaDvrPlaybackType `json:"type,omitempty"` - URL *string `json:"url,omitempty"` - Error *string `json:"error,omitempty"` -} - -func (o *DvrPlayback) GetHrn() *PlaybackInfoHrn { +func (o *PlaybackInfoSource) GetWidth() *float64 { if o == nil { return nil } - return o.Hrn + return o.Width } -func (o *DvrPlayback) GetType() *PlaybackInfoMetaDvrPlaybackType { - if o == nil { - return nil - } - return o.Type +type Meta struct { + Attestation *Attestation `json:"attestation,omitempty"` + DvrPlayback []DvrPlayback `json:"dvrPlayback,omitempty"` + Live *Live `json:"live,omitempty"` + // Whether the playback policy for an asset or stream is public or signed + PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` + Source []PlaybackInfoSource `json:"source"` } -func (o *DvrPlayback) GetURL() *string { +func (o *Meta) GetAttestation() *Attestation { if o == nil { return nil } - return o.URL + return o.Attestation } -func (o *DvrPlayback) GetError() *string { +func (o *Meta) GetDvrPlayback() []DvrPlayback { if o == nil { return nil } - return o.Error -} - -type Meta struct { - Live *Live `json:"live,omitempty"` - // Whether the playback policy for an asset or stream is public or signed - PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - Source []PlaybackInfoSource `json:"source"` - DvrPlayback []DvrPlayback `json:"dvrPlayback,omitempty"` - Attestation *Attestation `json:"attestation,omitempty"` + return o.DvrPlayback } func (o *Meta) GetLive() *Live { @@ -310,35 +295,50 @@ func (o *Meta) GetSource() []PlaybackInfoSource { return o.Source } -func (o *Meta) GetDvrPlayback() []DvrPlayback { - if o == nil { - return nil - } - return o.DvrPlayback -} +type PlaybackInfoType string -func (o *Meta) GetAttestation() *Attestation { - if o == nil { +const ( + PlaybackInfoTypeLive PlaybackInfoType = "live" + PlaybackInfoTypeVod PlaybackInfoType = "vod" + PlaybackInfoTypeRecording PlaybackInfoType = "recording" +) + +func (e PlaybackInfoType) ToPointer() *PlaybackInfoType { + return &e +} +func (e *PlaybackInfoType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "live": + fallthrough + case "vod": + fallthrough + case "recording": + *e = PlaybackInfoType(v) return nil + default: + return fmt.Errorf("invalid value for PlaybackInfoType: %v", v) } - return o.Attestation } type PlaybackInfo struct { - Type PlaybackInfoType `json:"type"` Meta Meta `json:"meta"` + Type PlaybackInfoType `json:"type"` } -func (o *PlaybackInfo) GetType() PlaybackInfoType { +func (o *PlaybackInfo) GetMeta() Meta { if o == nil { - return PlaybackInfoType("") + return Meta{} } - return o.Type + return o.Meta } -func (o *PlaybackInfo) GetMeta() Meta { +func (o *PlaybackInfo) GetType() PlaybackInfoType { if o == nil { - return Meta{} + return PlaybackInfoType("") } - return o.Meta + return o.Type } diff --git a/models/components/playbackpolicy.go b/models/components/playbackpolicy.go index b3ed685..cd9d28b 100644 --- a/models/components/playbackpolicy.go +++ b/models/components/playbackpolicy.go @@ -38,50 +38,50 @@ func (e *Type) UnmarshalJSON(data []byte) error { // PlaybackPolicy - Whether the playback policy for an asset or stream is public or signed type PlaybackPolicy struct { - Type Type `json:"type"` - // ID of the webhook to use for playback policy - WebhookID *string `json:"webhookId,omitempty"` - // User-defined webhook context - WebhookContext map[string]any `json:"webhookContext,omitempty"` + // List of allowed origins for CORS playback (://:, ://) + AllowedOrigins []string `json:"allowedOrigins,omitempty"` // Interval (in seconds) at which the playback policy should be // refreshed (default 600 seconds) // RefreshInterval *float64 `json:"refreshInterval,omitempty"` - // List of allowed origins for CORS playback (://:, ://) - AllowedOrigins []string `json:"allowedOrigins,omitempty"` + Type Type `json:"type"` + // User-defined webhook context + WebhookContext map[string]any `json:"webhookContext,omitempty"` + // ID of the webhook to use for playback policy + WebhookID *string `json:"webhookId,omitempty"` } -func (o *PlaybackPolicy) GetType() Type { +func (o *PlaybackPolicy) GetAllowedOrigins() []string { if o == nil { - return Type("") + return nil } - return o.Type + return o.AllowedOrigins } -func (o *PlaybackPolicy) GetWebhookID() *string { +func (o *PlaybackPolicy) GetRefreshInterval() *float64 { if o == nil { return nil } - return o.WebhookID + return o.RefreshInterval } -func (o *PlaybackPolicy) GetWebhookContext() map[string]any { +func (o *PlaybackPolicy) GetType() Type { if o == nil { - return nil + return Type("") } - return o.WebhookContext + return o.Type } -func (o *PlaybackPolicy) GetRefreshInterval() *float64 { +func (o *PlaybackPolicy) GetWebhookContext() map[string]any { if o == nil { return nil } - return o.RefreshInterval + return o.WebhookContext } -func (o *PlaybackPolicy) GetAllowedOrigins() []string { +func (o *PlaybackPolicy) GetWebhookID() *string { if o == nil { return nil } - return o.AllowedOrigins + return o.WebhookID } diff --git a/models/components/pull.go b/models/components/pull.go index 629c258..4696f8f 100644 --- a/models/components/pull.go +++ b/models/components/pull.go @@ -9,19 +9,19 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) -// One - 0: not mobile, 1: mobile screen share, 2: mobile camera. -type One int64 +// IsMobile1 - 0: not mobile, 1: mobile screen share, 2: mobile camera. +type IsMobile1 int64 const ( - OneZero One = 0 - OneOne One = 1 - OneTwo One = 2 + IsMobile1Zero IsMobile1 = 0 + IsMobile1One IsMobile1 = 1 + IsMobile1Two IsMobile1 = 2 ) -func (e One) ToPointer() *One { +func (e IsMobile1) ToPointer() *IsMobile1 { return &e } -func (e *One) UnmarshalJSON(data []byte) error { +func (e *IsMobile1) UnmarshalJSON(data []byte) error { var v int64 if err := json.Unmarshal(data, &v); err != nil { return err @@ -32,34 +32,34 @@ func (e *One) UnmarshalJSON(data []byte) error { case 1: fallthrough case 2: - *e = One(v) + *e = IsMobile1(v) return nil default: - return fmt.Errorf("invalid value for One: %v", v) + return fmt.Errorf("invalid value for IsMobile1: %v", v) } } type IsMobileType string const ( - IsMobileTypeOne IsMobileType = "1" - IsMobileTypeBoolean IsMobileType = "boolean" + IsMobileTypeIsMobile1 IsMobileType = "isMobile_1" + IsMobileTypeBoolean IsMobileType = "boolean" ) // IsMobile - Indicates whether the stream will be pulled from a mobile source. type IsMobile struct { - One *One - Boolean *bool + IsMobile1 *IsMobile1 + Boolean *bool Type IsMobileType } -func CreateIsMobileOne(one One) IsMobile { - typ := IsMobileTypeOne +func CreateIsMobileIsMobile1(isMobile1 IsMobile1) IsMobile { + typ := IsMobileTypeIsMobile1 return IsMobile{ - One: &one, - Type: typ, + IsMobile1: &isMobile1, + Type: typ, } } @@ -74,10 +74,10 @@ func CreateIsMobileBoolean(boolean bool) IsMobile { func (u *IsMobile) UnmarshalJSON(data []byte) error { - var one One = One(0) - if err := utils.UnmarshalJSON(data, &one, "", true, true); err == nil { - u.One = &one - u.Type = IsMobileTypeOne + var isMobile1 IsMobile1 = IsMobile1(0) + if err := utils.UnmarshalJSON(data, &isMobile1, "", true, true); err == nil { + u.IsMobile1 = &isMobile1 + u.Type = IsMobileTypeIsMobile1 return nil } @@ -92,8 +92,8 @@ func (u *IsMobile) UnmarshalJSON(data []byte) error { } func (u IsMobile) MarshalJSON() ([]byte, error) { - if u.One != nil { - return utils.MarshalJSON(u.One, "", true) + if u.IsMobile1 != nil { + return utils.MarshalJSON(u.IsMobile1, "", true) } if u.Boolean != nil { @@ -132,8 +132,6 @@ func (o *Location) GetLon() float64 { // external source, rather than pushed to Livepeer. If specified, the // stream will not have a streamKey. type Pull struct { - // URL from which to pull from. - Source string `json:"source"` // Headers to be sent with the request to the pull source. Headers map[string]string `json:"headers,omitempty"` // Indicates whether the stream will be pulled from a mobile source. @@ -141,13 +139,8 @@ type Pull struct { // Approximate location of the pull source. The location is used to // determine the closest Livepeer region to pull the stream from. Location *Location `json:"location,omitempty"` -} - -func (o *Pull) GetSource() string { - if o == nil { - return "" - } - return o.Source + // URL from which to pull from. + Source string `json:"source"` } func (o *Pull) GetHeaders() map[string]string { @@ -170,3 +163,10 @@ func (o *Pull) GetLocation() *Location { } return o.Location } + +func (o *Pull) GetSource() string { + if o == nil { + return "" + } + return o.Source +} diff --git a/models/components/recordingspec.go b/models/components/recordingspec.go index 4102b17..3de11a9 100644 --- a/models/components/recordingspec.go +++ b/models/components/recordingspec.go @@ -5,14 +5,14 @@ package components // RecordingSpec - Configuration for recording the stream. This can only be set if // `record` is true. type RecordingSpec struct { - // Profiles to record the stream in. If not specified, the stream - // will be recorded in the same profiles as the stream itself. Keep - // in mind that the source rendition will always be recorded. + // Profiles to process the recording of this stream into. If not + // specified, default profiles will be derived based on the stream + // input. Keep in mind that the source rendition is always kept. // - Profiles []FfmpegProfile `json:"profiles,omitempty"` + Profiles []TranscodeProfile `json:"profiles,omitempty"` } -func (o *RecordingSpec) GetProfiles() []FfmpegProfile { +func (o *RecordingSpec) GetProfiles() []TranscodeProfile { if o == nil { return nil } diff --git a/models/components/room.go b/models/components/room.go index cdb9943..6ff2b41 100644 --- a/models/components/room.go +++ b/models/components/room.go @@ -5,12 +5,12 @@ package components type Participants struct { // participant ID Identity *string `json:"identity,omitempty"` - // user defined participant name - Name *string `json:"name,omitempty"` // the time the participant joined JoinedAt *int64 `json:"joinedAt,omitempty"` // the time the participant left LeftAt *int64 `json:"leftAt,omitempty"` + // user defined participant name + Name *string `json:"name,omitempty"` } func (o *Participants) GetIdentity() *string { @@ -20,44 +20,37 @@ func (o *Participants) GetIdentity() *string { return o.Identity } -func (o *Participants) GetName() *string { +func (o *Participants) GetJoinedAt() *int64 { if o == nil { return nil } - return o.Name + return o.JoinedAt } -func (o *Participants) GetJoinedAt() *int64 { +func (o *Participants) GetLeftAt() *int64 { if o == nil { return nil } - return o.JoinedAt + return o.LeftAt } -func (o *Participants) GetLeftAt() *int64 { +func (o *Participants) GetName() *string { if o == nil { return nil } - return o.LeftAt + return o.Name } type Room struct { - // room ID - ID string `json:"id"` // Timestamp (in milliseconds) at which the room was created CreatedAt *float64 `json:"createdAt,omitempty"` - // Timestamp (in milliseconds) at which room was updated - UpdatedAt *float64 `json:"updatedAt,omitempty"` // internal ID for egress output - EgressID *string `json:"egressId,omitempty"` + EgressID *string `json:"egressId,omitempty"` + // room ID + ID string `json:"id"` Participants map[string]Participants `json:"participants"` -} - -func (o *Room) GetID() string { - if o == nil { - return "" - } - return o.ID + // Timestamp (in milliseconds) at which room was updated + UpdatedAt *float64 `json:"updatedAt,omitempty"` } func (o *Room) GetCreatedAt() *float64 { @@ -67,18 +60,18 @@ func (o *Room) GetCreatedAt() *float64 { return o.CreatedAt } -func (o *Room) GetUpdatedAt() *float64 { +func (o *Room) GetEgressID() *string { if o == nil { return nil } - return o.UpdatedAt + return o.EgressID } -func (o *Room) GetEgressID() *string { +func (o *Room) GetID() string { if o == nil { - return nil + return "" } - return o.EgressID + return o.ID } func (o *Room) GetParticipants() map[string]Participants { @@ -87,3 +80,10 @@ func (o *Room) GetParticipants() map[string]Participants { } return o.Participants } + +func (o *Room) GetUpdatedAt() *float64 { + if o == nil { + return nil + } + return o.UpdatedAt +} diff --git a/models/components/roomuserpayload.go b/models/components/roomuserpayload.go index f892f1f..d634f3c 100644 --- a/models/components/roomuserpayload.go +++ b/models/components/roomuserpayload.go @@ -3,21 +3,14 @@ package components type RoomUserPayload struct { - // Display name - Name string `json:"name"` // Whether a user is allowed to publish audio/video tracks CanPublish *bool `json:"canPublish,omitempty"` // Whether a user is allowed to publish data messages to the room CanPublishData *bool `json:"canPublishData,omitempty"` // User defined payload to store for the participant Metadata *string `json:"metadata,omitempty"` -} - -func (o *RoomUserPayload) GetName() string { - if o == nil { - return "" - } - return o.Name + // Display name + Name string `json:"name"` } func (o *RoomUserPayload) GetCanPublish() *bool { @@ -40,3 +33,10 @@ func (o *RoomUserPayload) GetMetadata() *string { } return o.Metadata } + +func (o *RoomUserPayload) GetName() string { + if o == nil { + return "" + } + return o.Name +} diff --git a/models/components/session.go b/models/components/session.go index 617c64b..f358553 100644 --- a/models/components/session.go +++ b/models/components/session.go @@ -41,224 +41,228 @@ func (e *RecordingStatus) UnmarshalJSON(data []byte) error { } type Session struct { - ID *string `json:"id,omitempty"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - Kind *string `json:"kind,omitempty"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - UserID *string `json:"userId,omitempty"` - Name string `json:"name"` - LastSeen *float64 `json:"lastSeen,omitempty"` - SourceSegments *float64 `json:"sourceSegments,omitempty"` - TranscodedSegments *float64 `json:"transcodedSegments,omitempty"` - // Duration of all the source segments, sec - SourceSegmentsDuration *float64 `json:"sourceSegmentsDuration,omitempty"` - // Duration of all the transcoded segments, sec - TranscodedSegmentsDuration *float64 `json:"transcodedSegmentsDuration,omitempty"` - SourceBytes *float64 `json:"sourceBytes,omitempty"` - TranscodedBytes *float64 `json:"transcodedBytes,omitempty"` + // Timestamp (in milliseconds) at which stream object was created + CreatedAt *float64 `json:"createdAt,omitempty"` + ID *string `json:"id,omitempty"` // Rate at which sourceBytes increases (bytes/second) IngestRate *float64 `json:"ingestRate,omitempty"` - // Rate at which transcodedBytes increases (bytes/second) - OutgoingRate *float64 `json:"outgoingRate,omitempty"` // Indicates whether the stream is healthy or not. IsHealthy *bool `json:"isHealthy,omitempty"` // A string array of human-readable errors describing issues affecting the stream, if any. Issues []string `json:"issues,omitempty"` - // Timestamp (in milliseconds) at which stream object was created - CreatedAt *float64 `json:"createdAt,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + Kind *string `json:"kind,omitempty"` + LastSeen *float64 `json:"lastSeen,omitempty"` + // The URL for the stream session recording packaged in an MP4. + Mp4URL *string `json:"mp4Url,omitempty"` + Name string `json:"name"` + // Rate at which transcodedBytes increases (bytes/second) + OutgoingRate *float64 `json:"outgoingRate,omitempty"` // Points to parent stream object ParentID *string `json:"parentId,omitempty"` + // The playback ID to use with the Playback Info endpoint to retrieve playback URLs. + PlaybackID *string `json:"playbackId,omitempty"` + // Profiles to transcode the stream into. If not specified, a default + // set of profiles will be used with 240p, 360p, 480p and 720p + // resolutions. Keep in mind that the source rendition is always kept. + // + Profiles []FfmpegProfile `json:"profiles,omitempty"` // The ID of the project ProjectID *string `json:"projectId,omitempty"` // Whether the stream should be recorded. Uses default settings. For more customization, create and configure an object store. // Record *bool `json:"record,omitempty"` - // The status of the recording process of this stream session. - RecordingStatus *RecordingStatus `json:"recordingStatus,omitempty"` - // URL for accessing the recording of this stream session. - RecordingURL *string `json:"recordingUrl,omitempty"` - // The URL for the stream session recording packaged in an MP4. - Mp4URL *string `json:"mp4Url,omitempty"` - // The playback ID to use with the Playback Info endpoint to retrieve playback URLs. - PlaybackID *string `json:"playbackId,omitempty"` - Profiles []FfmpegProfile `json:"profiles,omitempty"` // Configuration for recording the stream. This can only be set if // `record` is true. // RecordingSpec *RecordingSpec `json:"recordingSpec,omitempty"` + // The status of the recording process of this stream session. + RecordingStatus *RecordingStatus `json:"recordingStatus,omitempty"` + // URL for accessing the recording of this stream session. + RecordingURL *string `json:"recordingUrl,omitempty"` + SourceBytes *float64 `json:"sourceBytes,omitempty"` + SourceSegments *float64 `json:"sourceSegments,omitempty"` + // Duration of all the source segments, sec + SourceSegmentsDuration *float64 `json:"sourceSegmentsDuration,omitempty"` + TranscodedBytes *float64 `json:"transcodedBytes,omitempty"` + TranscodedSegments *float64 `json:"transcodedSegments,omitempty"` + // Duration of all the transcoded segments, sec + TranscodedSegmentsDuration *float64 `json:"transcodedSegmentsDuration,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + UserID *string `json:"userId,omitempty"` } -func (o *Session) GetID() *string { +func (o *Session) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *Session) GetKind() *string { +func (o *Session) GetID() *string { if o == nil { return nil } - return o.Kind + return o.ID } -func (o *Session) GetUserID() *string { +func (o *Session) GetIngestRate() *float64 { if o == nil { return nil } - return o.UserID + return o.IngestRate } -func (o *Session) GetName() string { +func (o *Session) GetIsHealthy() *bool { if o == nil { - return "" + return nil } - return o.Name + return o.IsHealthy } -func (o *Session) GetLastSeen() *float64 { +func (o *Session) GetIssues() []string { if o == nil { return nil } - return o.LastSeen + return o.Issues } -func (o *Session) GetSourceSegments() *float64 { +func (o *Session) GetKind() *string { if o == nil { return nil } - return o.SourceSegments + return o.Kind } -func (o *Session) GetTranscodedSegments() *float64 { +func (o *Session) GetLastSeen() *float64 { if o == nil { return nil } - return o.TranscodedSegments + return o.LastSeen } -func (o *Session) GetSourceSegmentsDuration() *float64 { +func (o *Session) GetMp4URL() *string { if o == nil { return nil } - return o.SourceSegmentsDuration + return o.Mp4URL } -func (o *Session) GetTranscodedSegmentsDuration() *float64 { +func (o *Session) GetName() string { if o == nil { - return nil + return "" } - return o.TranscodedSegmentsDuration + return o.Name } -func (o *Session) GetSourceBytes() *float64 { +func (o *Session) GetOutgoingRate() *float64 { if o == nil { return nil } - return o.SourceBytes + return o.OutgoingRate } -func (o *Session) GetTranscodedBytes() *float64 { +func (o *Session) GetParentID() *string { if o == nil { return nil } - return o.TranscodedBytes + return o.ParentID } -func (o *Session) GetIngestRate() *float64 { +func (o *Session) GetPlaybackID() *string { if o == nil { return nil } - return o.IngestRate + return o.PlaybackID } -func (o *Session) GetOutgoingRate() *float64 { +func (o *Session) GetProfiles() []FfmpegProfile { if o == nil { return nil } - return o.OutgoingRate + return o.Profiles } -func (o *Session) GetIsHealthy() *bool { +func (o *Session) GetProjectID() *string { if o == nil { return nil } - return o.IsHealthy + return o.ProjectID } -func (o *Session) GetIssues() []string { +func (o *Session) GetRecord() *bool { if o == nil { return nil } - return o.Issues + return o.Record } -func (o *Session) GetCreatedAt() *float64 { +func (o *Session) GetRecordingSpec() *RecordingSpec { if o == nil { return nil } - return o.CreatedAt + return o.RecordingSpec } -func (o *Session) GetParentID() *string { +func (o *Session) GetRecordingStatus() *RecordingStatus { if o == nil { return nil } - return o.ParentID + return o.RecordingStatus } -func (o *Session) GetProjectID() *string { +func (o *Session) GetRecordingURL() *string { if o == nil { return nil } - return o.ProjectID + return o.RecordingURL } -func (o *Session) GetRecord() *bool { +func (o *Session) GetSourceBytes() *float64 { if o == nil { return nil } - return o.Record + return o.SourceBytes } -func (o *Session) GetRecordingStatus() *RecordingStatus { +func (o *Session) GetSourceSegments() *float64 { if o == nil { return nil } - return o.RecordingStatus + return o.SourceSegments } -func (o *Session) GetRecordingURL() *string { +func (o *Session) GetSourceSegmentsDuration() *float64 { if o == nil { return nil } - return o.RecordingURL + return o.SourceSegmentsDuration } -func (o *Session) GetMp4URL() *string { +func (o *Session) GetTranscodedBytes() *float64 { if o == nil { return nil } - return o.Mp4URL + return o.TranscodedBytes } -func (o *Session) GetPlaybackID() *string { +func (o *Session) GetTranscodedSegments() *float64 { if o == nil { return nil } - return o.PlaybackID + return o.TranscodedSegments } -func (o *Session) GetProfiles() []FfmpegProfile { +func (o *Session) GetTranscodedSegmentsDuration() *float64 { if o == nil { return nil } - return o.Profiles + return o.TranscodedSegmentsDuration } -func (o *Session) GetRecordingSpec() *RecordingSpec { +func (o *Session) GetUserID() *string { if o == nil { return nil } - return o.RecordingSpec + return o.UserID } diff --git a/models/components/signingkey.go b/models/components/signingkey.go index 82299c9..3d3b1ca 100644 --- a/models/components/signingkey.go +++ b/models/components/signingkey.go @@ -3,74 +3,74 @@ package components type SigningKey struct { - ID *string `json:"id,omitempty"` - // Name of the signing key - Name *string `json:"name,omitempty"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - UserID *string `json:"userId,omitempty"` // Timestamp (in milliseconds) at which the signing-key was created CreatedAt *float64 `json:"createdAt,omitempty"` - // Timestamp (in milliseconds) at which the signing-key was last used - LastSeen *float64 `json:"lastSeen,omitempty"` - PublicKey string `json:"publicKey"` // Disable the signing key to allow rotation safely - Disabled *bool `json:"disabled,omitempty"` + Disabled *bool `json:"disabled,omitempty"` + ID *string `json:"id,omitempty"` + // Timestamp (in milliseconds) at which the signing-key was last used + LastSeen *float64 `json:"lastSeen,omitempty"` + // Name of the signing key + Name *string `json:"name,omitempty"` // The ID of the project ProjectID *string `json:"projectId,omitempty"` + PublicKey string `json:"publicKey"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + UserID *string `json:"userId,omitempty"` } -func (o *SigningKey) GetID() *string { +func (o *SigningKey) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *SigningKey) GetName() *string { +func (o *SigningKey) GetDisabled() *bool { if o == nil { return nil } - return o.Name + return o.Disabled } -func (o *SigningKey) GetUserID() *string { +func (o *SigningKey) GetID() *string { if o == nil { return nil } - return o.UserID + return o.ID } -func (o *SigningKey) GetCreatedAt() *float64 { +func (o *SigningKey) GetLastSeen() *float64 { if o == nil { return nil } - return o.CreatedAt + return o.LastSeen } -func (o *SigningKey) GetLastSeen() *float64 { +func (o *SigningKey) GetName() *string { if o == nil { return nil } - return o.LastSeen + return o.Name } -func (o *SigningKey) GetPublicKey() string { +func (o *SigningKey) GetProjectID() *string { if o == nil { - return "" + return nil } - return o.PublicKey + return o.ProjectID } -func (o *SigningKey) GetDisabled() *bool { +func (o *SigningKey) GetPublicKey() string { if o == nil { - return nil + return "" } - return o.Disabled + return o.PublicKey } -func (o *SigningKey) GetProjectID() *string { +func (o *SigningKey) GetUserID() *string { if o == nil { return nil } - return o.ProjectID + return o.UserID } diff --git a/models/components/spec.go b/models/components/spec.go index e55c07e..e8b5bc9 100644 --- a/models/components/spec.go +++ b/models/components/spec.go @@ -8,6 +8,12 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) +// NftMetadata - Additional data to add to the NFT metadata exported to +// IPFS. Will be deep merged with the default metadata +// exported. +type NftMetadata struct { +} + // NftMetadataTemplate - Name of the NFT metadata template to export. 'player' // will embed the Livepeer Player on the NFT while 'file' // will reference only the immutable MP4 files. @@ -37,23 +43,17 @@ func (e *NftMetadataTemplate) UnmarshalJSON(data []byte) error { } } -// NftMetadata - Additional data to add to the NFT metadata exported to -// IPFS. Will be deep merged with the default metadata -// exported. -type NftMetadata struct { -} - type Spec struct { - // Name of the NFT metadata template to export. 'player' - // will embed the Livepeer Player on the NFT while 'file' - // will reference only the immutable MP4 files. - // - NftMetadataTemplate *NftMetadataTemplate `default:"file" json:"nftMetadataTemplate"` // Additional data to add to the NFT metadata exported to // IPFS. Will be deep merged with the default metadata // exported. // NftMetadata *NftMetadata `json:"nftMetadata,omitempty"` + // Name of the NFT metadata template to export. 'player' + // will embed the Livepeer Player on the NFT while 'file' + // will reference only the immutable MP4 files. + // + NftMetadataTemplate *NftMetadataTemplate `default:"file" json:"nftMetadataTemplate"` } func (s Spec) MarshalJSON() ([]byte, error) { @@ -67,16 +67,16 @@ func (s *Spec) UnmarshalJSON(data []byte) error { return nil } -func (o *Spec) GetNftMetadataTemplate() *NftMetadataTemplate { +func (o *Spec) GetNftMetadata() *NftMetadata { if o == nil { return nil } - return o.NftMetadataTemplate + return o.NftMetadata } -func (o *Spec) GetNftMetadata() *NftMetadata { +func (o *Spec) GetNftMetadataTemplate() *NftMetadataTemplate { if o == nil { return nil } - return o.NftMetadata + return o.NftMetadataTemplate } diff --git a/models/components/storage.go b/models/components/storage.go index b2ec898..29f5e02 100644 --- a/models/components/storage.go +++ b/models/components/storage.go @@ -8,11 +8,11 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) -type Ipfs1 struct { +type One struct { Spec *Spec `json:"spec,omitempty"` } -func (o *Ipfs1) GetSpec() *Spec { +func (o *One) GetSpec() *Spec { if o == nil { return nil } @@ -22,7 +22,7 @@ func (o *Ipfs1) GetSpec() *Spec { type IpfsType string const ( - IpfsTypeIpfs1 IpfsType = "ipfs_1" + IpfsTypeOne IpfsType = "1" IpfsTypeBoolean IpfsType = "boolean" ) @@ -30,18 +30,18 @@ const ( // pinned files, specify an object with a spec field. False or null // means to unpin from IPFS, but it's unsupported right now. type Ipfs struct { - Ipfs1 *Ipfs1 + One *One Boolean *bool Type IpfsType } -func CreateIpfsIpfs1(ipfs1 Ipfs1) Ipfs { - typ := IpfsTypeIpfs1 +func CreateIpfsOne(one One) Ipfs { + typ := IpfsTypeOne return Ipfs{ - Ipfs1: &ipfs1, - Type: typ, + One: &one, + Type: typ, } } @@ -56,10 +56,10 @@ func CreateIpfsBoolean(boolean bool) Ipfs { func (u *Ipfs) UnmarshalJSON(data []byte) error { - var ipfs1 Ipfs1 = Ipfs1{} - if err := utils.UnmarshalJSON(data, &ipfs1, "", true, true); err == nil { - u.Ipfs1 = &ipfs1 - u.Type = IpfsTypeIpfs1 + var one One = One{} + if err := utils.UnmarshalJSON(data, &one, "", true, true); err == nil { + u.One = &one + u.Type = IpfsTypeOne return nil } @@ -74,8 +74,8 @@ func (u *Ipfs) UnmarshalJSON(data []byte) error { } func (u Ipfs) MarshalJSON() ([]byte, error) { - if u.Ipfs1 != nil { - return utils.MarshalJSON(u.Ipfs1, "", true) + if u.One != nil { + return utils.MarshalJSON(u.One, "", true) } if u.Boolean != nil { diff --git a/models/components/storagestatus.go b/models/components/storagestatus.go index d24e55f..5f994c9 100644 --- a/models/components/storagestatus.go +++ b/models/components/storagestatus.go @@ -44,23 +44,23 @@ func (e *Phase) UnmarshalJSON(data []byte) error { } type Tasks struct { - // ID of any currently running task that is exporting this - // asset to IPFS. - // - Pending *string `json:"pending,omitempty"` + // ID of the last task to fail execution. + Failed *string `json:"failed,omitempty"` // ID of the last task to run successfully, that created // the currently saved data. // Last *string `json:"last,omitempty"` - // ID of the last task to fail execution. - Failed *string `json:"failed,omitempty"` + // ID of any currently running task that is exporting this + // asset to IPFS. + // + Pending *string `json:"pending,omitempty"` } -func (o *Tasks) GetPending() *string { +func (o *Tasks) GetFailed() *string { if o == nil { return nil } - return o.Pending + return o.Failed } func (o *Tasks) GetLast() *string { @@ -70,21 +70,28 @@ func (o *Tasks) GetLast() *string { return o.Last } -func (o *Tasks) GetFailed() *string { +func (o *Tasks) GetPending() *string { if o == nil { return nil } - return o.Failed + return o.Pending } type StorageStatus struct { + // Error message if the last storage changed failed. + ErrorMessage *string `json:"errorMessage,omitempty"` // Phase of the asset storage Phase Phase `json:"phase"` // Current progress of the task updating the storage. Progress *float64 `json:"progress,omitempty"` - // Error message if the last storage changed failed. - ErrorMessage *string `json:"errorMessage,omitempty"` - Tasks Tasks `json:"tasks"` + Tasks Tasks `json:"tasks"` +} + +func (o *StorageStatus) GetErrorMessage() *string { + if o == nil { + return nil + } + return o.ErrorMessage } func (o *StorageStatus) GetPhase() Phase { @@ -101,13 +108,6 @@ func (o *StorageStatus) GetProgress() *float64 { return o.Progress } -func (o *StorageStatus) GetErrorMessage() *string { - if o == nil { - return nil - } - return o.ErrorMessage -} - func (o *StorageStatus) GetTasks() Tasks { if o == nil { return Tasks{} diff --git a/models/components/stream.go b/models/components/stream.go index 4001b32..d242152 100644 --- a/models/components/stream.go +++ b/models/components/stream.go @@ -9,167 +9,33 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) -type ThreeType string - -const ( - ThreeTypeStr ThreeType = "str" - ThreeTypeNumber ThreeType = "number" -) - -type Three struct { - Str *string - Number *float64 - - Type ThreeType -} - -func CreateThreeStr(str string) Three { - typ := ThreeTypeStr - - return Three{ - Str: &str, - Type: typ, - } -} - -func CreateThreeNumber(number float64) Three { - typ := ThreeTypeNumber - - return Three{ - Number: &number, - Type: typ, - } -} - -func (u *Three) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = ThreeTypeStr - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = ThreeTypeNumber - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Three", string(data)) -} - -func (u Three) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - return nil, errors.New("could not marshal union type Three: all fields are null") -} - -type StreamUserTagsType string - -const ( - StreamUserTagsTypeStr StreamUserTagsType = "str" - StreamUserTagsTypeNumber StreamUserTagsType = "number" - StreamUserTagsTypeArrayOf3 StreamUserTagsType = "arrayOf3" -) - -type StreamUserTags struct { - Str *string - Number *float64 - ArrayOf3 []Three - - Type StreamUserTagsType -} - -func CreateStreamUserTagsStr(str string) StreamUserTags { - typ := StreamUserTagsTypeStr - - return StreamUserTags{ - Str: &str, - Type: typ, - } -} - -func CreateStreamUserTagsNumber(number float64) StreamUserTags { - typ := StreamUserTagsTypeNumber - - return StreamUserTags{ - Number: &number, - Type: typ, - } -} - -func CreateStreamUserTagsArrayOf3(arrayOf3 []Three) StreamUserTags { - typ := StreamUserTagsTypeArrayOf3 - - return StreamUserTags{ - ArrayOf3: arrayOf3, - Type: typ, - } +type StreamMultistream struct { + // References to targets where this stream will be simultaneously + // streamed to + // + Targets []TargetOutput `json:"targets,omitempty"` } -func (u *StreamUserTags) UnmarshalJSON(data []byte) error { - - var str string = "" - if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { - u.Str = &str - u.Type = StreamUserTagsTypeStr - return nil - } - - var number float64 = float64(0) - if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { - u.Number = &number - u.Type = StreamUserTagsTypeNumber - return nil - } - - var arrayOf3 []Three = []Three{} - if err := utils.UnmarshalJSON(data, &arrayOf3, "", true, true); err == nil { - u.ArrayOf3 = arrayOf3 - u.Type = StreamUserTagsTypeArrayOf3 +func (o *StreamMultistream) GetTargets() []TargetOutput { + if o == nil { return nil } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for StreamUserTags", string(data)) -} - -func (u StreamUserTags) MarshalJSON() ([]byte, error) { - if u.Str != nil { - return utils.MarshalJSON(u.Str, "", true) - } - - if u.Number != nil { - return utils.MarshalJSON(u.Number, "", true) - } - - if u.ArrayOf3 != nil { - return utils.MarshalJSON(u.ArrayOf3, "", true) - } - - return nil, errors.New("could not marshal union type StreamUserTags: all fields are null") + return o.Targets } -// IsMobile1 - 0: not mobile, 1: mobile screen share, 2: mobile camera. -type IsMobile1 int64 +// StreamIsMobile1 - 0: not mobile, 1: mobile screen share, 2: mobile camera. +type StreamIsMobile1 int64 const ( - IsMobile1Zero IsMobile1 = 0 - IsMobile1One IsMobile1 = 1 - IsMobile1Two IsMobile1 = 2 + StreamIsMobile1Zero StreamIsMobile1 = 0 + StreamIsMobile1One StreamIsMobile1 = 1 + StreamIsMobile1Two StreamIsMobile1 = 2 ) -func (e IsMobile1) ToPointer() *IsMobile1 { +func (e StreamIsMobile1) ToPointer() *StreamIsMobile1 { return &e } -func (e *IsMobile1) UnmarshalJSON(data []byte) error { +func (e *StreamIsMobile1) UnmarshalJSON(data []byte) error { var v int64 if err := json.Unmarshal(data, &v); err != nil { return err @@ -180,34 +46,34 @@ func (e *IsMobile1) UnmarshalJSON(data []byte) error { case 1: fallthrough case 2: - *e = IsMobile1(v) + *e = StreamIsMobile1(v) return nil default: - return fmt.Errorf("invalid value for IsMobile1: %v", v) + return fmt.Errorf("invalid value for StreamIsMobile1: %v", v) } } type StreamIsMobileType string const ( - StreamIsMobileTypeIsMobile1 StreamIsMobileType = "isMobile_1" - StreamIsMobileTypeBoolean StreamIsMobileType = "boolean" + StreamIsMobileTypeStreamIsMobile1 StreamIsMobileType = "stream_isMobile_1" + StreamIsMobileTypeBoolean StreamIsMobileType = "boolean" ) // StreamIsMobile - Indicates whether the stream will be pulled from a mobile source. type StreamIsMobile struct { - IsMobile1 *IsMobile1 - Boolean *bool + StreamIsMobile1 *StreamIsMobile1 + Boolean *bool Type StreamIsMobileType } -func CreateStreamIsMobileIsMobile1(isMobile1 IsMobile1) StreamIsMobile { - typ := StreamIsMobileTypeIsMobile1 +func CreateStreamIsMobileStreamIsMobile1(streamIsMobile1 StreamIsMobile1) StreamIsMobile { + typ := StreamIsMobileTypeStreamIsMobile1 return StreamIsMobile{ - IsMobile1: &isMobile1, - Type: typ, + StreamIsMobile1: &streamIsMobile1, + Type: typ, } } @@ -222,10 +88,10 @@ func CreateStreamIsMobileBoolean(boolean bool) StreamIsMobile { func (u *StreamIsMobile) UnmarshalJSON(data []byte) error { - var isMobile1 IsMobile1 = IsMobile1(0) - if err := utils.UnmarshalJSON(data, &isMobile1, "", true, true); err == nil { - u.IsMobile1 = &isMobile1 - u.Type = StreamIsMobileTypeIsMobile1 + var streamIsMobile1 StreamIsMobile1 = StreamIsMobile1(0) + if err := utils.UnmarshalJSON(data, &streamIsMobile1, "", true, true); err == nil { + u.StreamIsMobile1 = &streamIsMobile1 + u.Type = StreamIsMobileTypeStreamIsMobile1 return nil } @@ -240,8 +106,8 @@ func (u *StreamIsMobile) UnmarshalJSON(data []byte) error { } func (u StreamIsMobile) MarshalJSON() ([]byte, error) { - if u.IsMobile1 != nil { - return utils.MarshalJSON(u.IsMobile1, "", true) + if u.StreamIsMobile1 != nil { + return utils.MarshalJSON(u.StreamIsMobile1, "", true) } if u.Boolean != nil { @@ -280,8 +146,6 @@ func (o *StreamLocation) GetLon() float64 { // external source, rather than pushed to Livepeer. If specified, the // stream will not have a streamKey. type StreamPull struct { - // URL from which to pull from. - Source string `json:"source"` // Headers to be sent with the request to the pull source. Headers map[string]string `json:"headers,omitempty"` // Indicates whether the stream will be pulled from a mobile source. @@ -289,13 +153,8 @@ type StreamPull struct { // Approximate location of the pull source. The location is used to // determine the closest Livepeer region to pull the stream from. Location *StreamLocation `json:"location,omitempty"` -} - -func (o *StreamPull) GetSource() string { - if o == nil { - return "" - } - return o.Source + // URL from which to pull from. + Source string `json:"source"` } func (o *StreamPull) GetHeaders() map[string]string { @@ -319,86 +178,222 @@ func (o *StreamPull) GetLocation() *StreamLocation { return o.Location } +func (o *StreamPull) GetSource() string { + if o == nil { + return "" + } + return o.Source +} + // StreamRecordingSpec - Configuration for recording the stream. This can only be set if // `record` is true. type StreamRecordingSpec struct { - // Profiles to record the stream in. If not specified, the stream - // will be recorded in the same profiles as the stream itself. Keep - // in mind that the source rendition will always be recorded. + // Profiles to process the recording of this stream into. If not + // specified, default profiles will be derived based on the stream + // input. Keep in mind that the source rendition is always kept. // - Profiles []FfmpegProfile `json:"profiles,omitempty"` + Profiles []TranscodeProfile `json:"profiles,omitempty"` } -func (o *StreamRecordingSpec) GetProfiles() []FfmpegProfile { +func (o *StreamRecordingSpec) GetProfiles() []TranscodeProfile { if o == nil { return nil } return o.Profiles } -type StreamMultistream struct { - // References to targets where this stream will be simultaneously - // streamed to - // - Targets []TargetOutput `json:"targets,omitempty"` +type Renditions struct { } -func (o *StreamMultistream) GetTargets() []TargetOutput { - if o == nil { +type ThreeType string + +const ( + ThreeTypeStr ThreeType = "str" + ThreeTypeNumber ThreeType = "number" +) + +type Three struct { + Str *string + Number *float64 + + Type ThreeType +} + +func CreateThreeStr(str string) Three { + typ := ThreeTypeStr + + return Three{ + Str: &str, + Type: typ, + } +} + +func CreateThreeNumber(number float64) Three { + typ := ThreeTypeNumber + + return Three{ + Number: &number, + Type: typ, + } +} + +func (u *Three) UnmarshalJSON(data []byte) error { + + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { + u.Str = &str + u.Type = ThreeTypeStr return nil } - return o.Targets + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { + u.Number = &number + u.Type = ThreeTypeNumber + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Three", string(data)) } -type Renditions struct { +func (u Three) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + return nil, errors.New("could not marshal union type Three: all fields are null") +} + +type StreamUserTagsType string + +const ( + StreamUserTagsTypeStr StreamUserTagsType = "str" + StreamUserTagsTypeNumber StreamUserTagsType = "number" + StreamUserTagsTypeArrayOf3 StreamUserTagsType = "arrayOf3" +) + +type StreamUserTags struct { + Str *string + Number *float64 + ArrayOf3 []Three + + Type StreamUserTagsType +} + +func CreateStreamUserTagsStr(str string) StreamUserTags { + typ := StreamUserTagsTypeStr + + return StreamUserTags{ + Str: &str, + Type: typ, + } +} + +func CreateStreamUserTagsNumber(number float64) StreamUserTags { + typ := StreamUserTagsTypeNumber + + return StreamUserTags{ + Number: &number, + Type: typ, + } +} + +func CreateStreamUserTagsArrayOf3(arrayOf3 []Three) StreamUserTags { + typ := StreamUserTagsTypeArrayOf3 + + return StreamUserTags{ + ArrayOf3: arrayOf3, + Type: typ, + } +} + +func (u *StreamUserTags) UnmarshalJSON(data []byte) error { + + var str string = "" + if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil { + u.Str = &str + u.Type = StreamUserTagsTypeStr + return nil + } + + var number float64 = float64(0) + if err := utils.UnmarshalJSON(data, &number, "", true, true); err == nil { + u.Number = &number + u.Type = StreamUserTagsTypeNumber + return nil + } + + var arrayOf3 []Three = []Three{} + if err := utils.UnmarshalJSON(data, &arrayOf3, "", true, true); err == nil { + u.ArrayOf3 = arrayOf3 + u.Type = StreamUserTagsTypeArrayOf3 + return nil + } + + return fmt.Errorf("could not unmarshal `%s` into any supported union types for StreamUserTags", string(data)) +} + +func (u StreamUserTags) MarshalJSON() ([]byte, error) { + if u.Str != nil { + return utils.MarshalJSON(u.Str, "", true) + } + + if u.Number != nil { + return utils.MarshalJSON(u.Number, "", true) + } + + if u.ArrayOf3 != nil { + return utils.MarshalJSON(u.ArrayOf3, "", true) + } + + return nil, errors.New("could not marshal union type StreamUserTags: all fields are null") } type Stream struct { - ID *string `json:"id,omitempty"` - Name string `json:"name"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - Kind *string `json:"kind,omitempty"` - CreatorID *CreatorID `json:"creatorId,omitempty"` - // User input tags associated with the stream - UserTags map[string]StreamUserTags `json:"userTags,omitempty"` - LastSeen *float64 `json:"lastSeen,omitempty"` - SourceSegments *float64 `json:"sourceSegments,omitempty"` - TranscodedSegments *float64 `json:"transcodedSegments,omitempty"` - // Duration of all the source segments, sec - SourceSegmentsDuration *float64 `json:"sourceSegmentsDuration,omitempty"` - // Duration of all the transcoded segments, sec - TranscodedSegmentsDuration *float64 `json:"transcodedSegmentsDuration,omitempty"` - SourceBytes *float64 `json:"sourceBytes,omitempty"` - TranscodedBytes *float64 `json:"transcodedBytes,omitempty"` + // Timestamp (in milliseconds) at which stream object was created + CreatedAt *float64 `json:"createdAt,omitempty"` + // Name of the token used to create this object + CreatedByTokenName *string `json:"createdByTokenName,omitempty"` + CreatorID *CreatorID `json:"creatorId,omitempty"` + ID *string `json:"id,omitempty"` // Rate at which sourceBytes increases (bytes/second) IngestRate *float64 `json:"ingestRate,omitempty"` - // Rate at which transcodedBytes increases (bytes/second) - OutgoingRate *float64 `json:"outgoingRate,omitempty"` // If currently active IsActive *bool `json:"isActive,omitempty"` // Indicates whether the stream is healthy or not. IsHealthy *bool `json:"isHealthy,omitempty"` // A string array of human-readable errors describing issues affecting the stream, if any. Issues []string `json:"issues,omitempty"` - // Name of the token used to create this object - CreatedByTokenName *string `json:"createdByTokenName,omitempty"` - // Timestamp (in milliseconds) at which stream object was created - CreatedAt *float64 `json:"createdAt,omitempty"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + Kind *string `json:"kind,omitempty"` + LastSeen *float64 `json:"lastSeen,omitempty"` + // Timestamp (in milliseconds) when the stream was last terminated + LastTerminatedAt *float64 `json:"lastTerminatedAt,omitempty"` + Multistream *StreamMultistream `json:"multistream,omitempty"` + Name string `json:"name"` + // Rate at which transcodedBytes increases (bytes/second) + OutgoingRate *float64 `json:"outgoingRate,omitempty"` // Points to parent stream object ParentID *string `json:"parentId,omitempty"` - // Used to form RTMP ingest URL - StreamKey *string `json:"streamKey,omitempty"` - // Configuration for a stream that should be actively pulled from an - // external source, rather than pushed to Livepeer. If specified, the - // stream will not have a streamKey. - Pull *StreamPull `json:"pull,omitempty"` // The playback ID to use with the Playback Info endpoint to retrieve playback URLs. PlaybackID *string `json:"playbackId,omitempty"` // Whether the playback policy for an asset or stream is public or signed PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - Profiles []FfmpegProfile `json:"profiles,omitempty"` + // Profiles to transcode the stream into. If not specified, a default + // set of profiles will be used with 240p, 360p, 480p and 720p + // resolutions. Keep in mind that the source rendition is always kept. + // + Profiles []FfmpegProfile `json:"profiles,omitempty"` // The ID of the project ProjectID *string `json:"projectId,omitempty"` + // Configuration for a stream that should be actively pulled from an + // external source, rather than pushed to Livepeer. If specified, the + // stream will not have a streamKey. + Pull *StreamPull `json:"pull,omitempty"` // Should this stream be recorded? Uses default settings. For more // customization, create and configure an object store. // @@ -406,106 +401,115 @@ type Stream struct { // Configuration for recording the stream. This can only be set if // `record` is true. // - RecordingSpec *StreamRecordingSpec `json:"recordingSpec,omitempty"` - Multistream *StreamMultistream `json:"multistream,omitempty"` + RecordingSpec *StreamRecordingSpec `json:"recordingSpec,omitempty"` + Renditions *Renditions `json:"renditions,omitempty"` + SourceBytes *float64 `json:"sourceBytes,omitempty"` + SourceSegments *float64 `json:"sourceSegments,omitempty"` + // Duration of all the source segments, sec + SourceSegmentsDuration *float64 `json:"sourceSegmentsDuration,omitempty"` + // Used to form RTMP ingest URL + StreamKey *string `json:"streamKey,omitempty"` // If currently suspended - Suspended *bool `json:"suspended,omitempty"` - // Timestamp (in milliseconds) when the stream was last terminated - LastTerminatedAt *float64 `json:"lastTerminatedAt,omitempty"` + Suspended *bool `json:"suspended,omitempty"` + TranscodedBytes *float64 `json:"transcodedBytes,omitempty"` + TranscodedSegments *float64 `json:"transcodedSegments,omitempty"` + // Duration of all the transcoded segments, sec + TranscodedSegmentsDuration *float64 `json:"transcodedSegmentsDuration,omitempty"` // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - UserID *string `json:"userId,omitempty"` - Renditions *Renditions `json:"renditions,omitempty"` + UserID *string `json:"userId,omitempty"` + // User input tags associated with the stream + UserTags map[string]StreamUserTags `json:"userTags,omitempty"` } -func (o *Stream) GetID() *string { +func (o *Stream) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *Stream) GetName() string { +func (o *Stream) GetCreatedByTokenName() *string { if o == nil { - return "" + return nil } - return o.Name + return o.CreatedByTokenName } -func (o *Stream) GetKind() *string { +func (o *Stream) GetCreatorID() *CreatorID { if o == nil { return nil } - return o.Kind + return o.CreatorID } -func (o *Stream) GetCreatorID() *CreatorID { +func (o *Stream) GetID() *string { if o == nil { return nil } - return o.CreatorID + return o.ID } -func (o *Stream) GetUserTags() map[string]StreamUserTags { +func (o *Stream) GetIngestRate() *float64 { if o == nil { return nil } - return o.UserTags + return o.IngestRate } -func (o *Stream) GetLastSeen() *float64 { +func (o *Stream) GetIsActive() *bool { if o == nil { return nil } - return o.LastSeen + return o.IsActive } -func (o *Stream) GetSourceSegments() *float64 { +func (o *Stream) GetIsHealthy() *bool { if o == nil { return nil } - return o.SourceSegments + return o.IsHealthy } -func (o *Stream) GetTranscodedSegments() *float64 { +func (o *Stream) GetIssues() []string { if o == nil { return nil } - return o.TranscodedSegments + return o.Issues } -func (o *Stream) GetSourceSegmentsDuration() *float64 { +func (o *Stream) GetKind() *string { if o == nil { return nil } - return o.SourceSegmentsDuration + return o.Kind } -func (o *Stream) GetTranscodedSegmentsDuration() *float64 { +func (o *Stream) GetLastSeen() *float64 { if o == nil { return nil } - return o.TranscodedSegmentsDuration + return o.LastSeen } -func (o *Stream) GetSourceBytes() *float64 { +func (o *Stream) GetLastTerminatedAt() *float64 { if o == nil { return nil } - return o.SourceBytes + return o.LastTerminatedAt } -func (o *Stream) GetTranscodedBytes() *float64 { +func (o *Stream) GetMultistream() *StreamMultistream { if o == nil { return nil } - return o.TranscodedBytes + return o.Multistream } -func (o *Stream) GetIngestRate() *float64 { +func (o *Stream) GetName() string { if o == nil { - return nil + return "" } - return o.IngestRate + return o.Name } func (o *Stream) GetOutgoingRate() *float64 { @@ -515,123 +519,123 @@ func (o *Stream) GetOutgoingRate() *float64 { return o.OutgoingRate } -func (o *Stream) GetIsActive() *bool { +func (o *Stream) GetParentID() *string { if o == nil { return nil } - return o.IsActive + return o.ParentID } -func (o *Stream) GetIsHealthy() *bool { +func (o *Stream) GetPlaybackID() *string { if o == nil { return nil } - return o.IsHealthy + return o.PlaybackID } -func (o *Stream) GetIssues() []string { +func (o *Stream) GetPlaybackPolicy() *PlaybackPolicy { if o == nil { return nil } - return o.Issues + return o.PlaybackPolicy } -func (o *Stream) GetCreatedByTokenName() *string { +func (o *Stream) GetProfiles() []FfmpegProfile { if o == nil { return nil } - return o.CreatedByTokenName + return o.Profiles } -func (o *Stream) GetCreatedAt() *float64 { +func (o *Stream) GetProjectID() *string { if o == nil { return nil } - return o.CreatedAt + return o.ProjectID } -func (o *Stream) GetParentID() *string { +func (o *Stream) GetPull() *StreamPull { if o == nil { return nil } - return o.ParentID + return o.Pull } -func (o *Stream) GetStreamKey() *string { +func (o *Stream) GetRecord() *bool { if o == nil { return nil } - return o.StreamKey + return o.Record } -func (o *Stream) GetPull() *StreamPull { +func (o *Stream) GetRecordingSpec() *StreamRecordingSpec { if o == nil { return nil } - return o.Pull + return o.RecordingSpec } -func (o *Stream) GetPlaybackID() *string { +func (o *Stream) GetRenditions() *Renditions { if o == nil { return nil } - return o.PlaybackID + return o.Renditions } -func (o *Stream) GetPlaybackPolicy() *PlaybackPolicy { +func (o *Stream) GetSourceBytes() *float64 { if o == nil { return nil } - return o.PlaybackPolicy + return o.SourceBytes } -func (o *Stream) GetProfiles() []FfmpegProfile { +func (o *Stream) GetSourceSegments() *float64 { if o == nil { return nil } - return o.Profiles + return o.SourceSegments } -func (o *Stream) GetProjectID() *string { +func (o *Stream) GetSourceSegmentsDuration() *float64 { if o == nil { return nil } - return o.ProjectID + return o.SourceSegmentsDuration } -func (o *Stream) GetRecord() *bool { +func (o *Stream) GetStreamKey() *string { if o == nil { return nil } - return o.Record + return o.StreamKey } -func (o *Stream) GetRecordingSpec() *StreamRecordingSpec { +func (o *Stream) GetSuspended() *bool { if o == nil { return nil } - return o.RecordingSpec + return o.Suspended } -func (o *Stream) GetMultistream() *StreamMultistream { +func (o *Stream) GetTranscodedBytes() *float64 { if o == nil { return nil } - return o.Multistream + return o.TranscodedBytes } -func (o *Stream) GetSuspended() *bool { +func (o *Stream) GetTranscodedSegments() *float64 { if o == nil { return nil } - return o.Suspended + return o.TranscodedSegments } -func (o *Stream) GetLastTerminatedAt() *float64 { +func (o *Stream) GetTranscodedSegmentsDuration() *float64 { if o == nil { return nil } - return o.LastTerminatedAt + return o.TranscodedSegmentsDuration } func (o *Stream) GetUserID() *string { @@ -641,9 +645,9 @@ func (o *Stream) GetUserID() *string { return o.UserID } -func (o *Stream) GetRenditions() *Renditions { +func (o *Stream) GetUserTags() map[string]StreamUserTags { if o == nil { return nil } - return o.Renditions + return o.UserTags } diff --git a/models/components/streampatchpayload.go b/models/components/streampatchpayload.go index f0482b6..227f91a 100644 --- a/models/components/streampatchpayload.go +++ b/models/components/streampatchpayload.go @@ -3,17 +3,18 @@ package components type StreamPatchPayload struct { - CreatorID *InputCreatorID `json:"creatorId,omitempty"` + CreatorID *InputCreatorID `json:"creatorId,omitempty"` + Multistream *Multistream `json:"multistream,omitempty"` + // Whether the playback policy for an asset or stream is public or signed + PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` + Profiles []FfmpegProfile `json:"profiles,omitempty"` // Should this stream be recorded? Uses default settings. For more // customization, create and configure an object store. // - Record *bool `json:"record,omitempty"` + Record *bool `json:"record,omitempty"` + RecordingSpec *RecordingSpec `json:"recordingSpec,omitempty"` // If currently suspended - Suspended *bool `json:"suspended,omitempty"` - Multistream *Multistream `json:"multistream,omitempty"` - // Whether the playback policy for an asset or stream is public or signed - PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - Profiles []FfmpegProfile `json:"profiles,omitempty"` + Suspended *bool `json:"suspended,omitempty"` // User input tags associated with the stream UserTags map[string]UserTags `json:"userTags,omitempty"` } @@ -25,39 +26,46 @@ func (o *StreamPatchPayload) GetCreatorID() *InputCreatorID { return o.CreatorID } -func (o *StreamPatchPayload) GetRecord() *bool { +func (o *StreamPatchPayload) GetMultistream() *Multistream { if o == nil { return nil } - return o.Record + return o.Multistream } -func (o *StreamPatchPayload) GetSuspended() *bool { +func (o *StreamPatchPayload) GetPlaybackPolicy() *PlaybackPolicy { if o == nil { return nil } - return o.Suspended + return o.PlaybackPolicy } -func (o *StreamPatchPayload) GetMultistream() *Multistream { +func (o *StreamPatchPayload) GetProfiles() []FfmpegProfile { if o == nil { return nil } - return o.Multistream + return o.Profiles } -func (o *StreamPatchPayload) GetPlaybackPolicy() *PlaybackPolicy { +func (o *StreamPatchPayload) GetRecord() *bool { if o == nil { return nil } - return o.PlaybackPolicy + return o.Record } -func (o *StreamPatchPayload) GetProfiles() []FfmpegProfile { +func (o *StreamPatchPayload) GetRecordingSpec() *RecordingSpec { if o == nil { return nil } - return o.Profiles + return o.RecordingSpec +} + +func (o *StreamPatchPayload) GetSuspended() *bool { + if o == nil { + return nil + } + return o.Suspended } func (o *StreamPatchPayload) GetUserTags() map[string]UserTags { diff --git a/models/components/target.go b/models/components/target.go index f0fb349..d8d0a05 100644 --- a/models/components/target.go +++ b/models/components/target.go @@ -30,21 +30,21 @@ func (o *TargetSpec) GetURL() string { } type Target struct { + // ID of multistream target object where to push this stream + ID *string `json:"id,omitempty"` // Name of transcoding profile that should be sent. Use // "source" for pushing source stream data // Profile string `json:"profile"` - // If true, the stream audio will be muted and only silent - // video will be pushed to the target. - // - VideoOnly *bool `default:"false" json:"videoOnly"` - // ID of multistream target object where to push this stream - ID *string `json:"id,omitempty"` // Inline multistream target object. Will automatically // create the target resource to be used by the created // stream. // Spec *TargetSpec `json:"spec,omitempty"` + // If true, the stream audio will be muted and only silent + // video will be pushed to the target. + // + VideoOnly *bool `default:"false" json:"videoOnly"` } func (t Target) MarshalJSON() ([]byte, error) { @@ -58,30 +58,30 @@ func (t *Target) UnmarshalJSON(data []byte) error { return nil } -func (o *Target) GetProfile() string { +func (o *Target) GetID() *string { if o == nil { - return "" + return nil } - return o.Profile + return o.ID } -func (o *Target) GetVideoOnly() *bool { +func (o *Target) GetProfile() string { if o == nil { - return nil + return "" } - return o.VideoOnly + return o.Profile } -func (o *Target) GetID() *string { +func (o *Target) GetSpec() *TargetSpec { if o == nil { return nil } - return o.ID + return o.Spec } -func (o *Target) GetSpec() *TargetSpec { +func (o *Target) GetVideoOnly() *bool { if o == nil { return nil } - return o.Spec + return o.VideoOnly } diff --git a/models/components/targetaddpayload.go b/models/components/targetaddpayload.go index 019ae7a..c0f8045 100644 --- a/models/components/targetaddpayload.go +++ b/models/components/targetaddpayload.go @@ -30,21 +30,21 @@ func (o *TargetAddPayloadSpec) GetURL() string { } type TargetAddPayload struct { + // ID of multistream target object where to push this stream + ID *string `json:"id,omitempty"` // Name of transcoding profile that should be sent. Use // "source" for pushing source stream data // Profile string `json:"profile"` - // If true, the stream audio will be muted and only silent - // video will be pushed to the target. - // - VideoOnly *bool `default:"false" json:"videoOnly"` - // ID of multistream target object where to push this stream - ID *string `json:"id,omitempty"` // Inline multistream target object. Will automatically // create the target resource to be used by the created // stream. // Spec *TargetAddPayloadSpec `json:"spec,omitempty"` + // If true, the stream audio will be muted and only silent + // video will be pushed to the target. + // + VideoOnly *bool `default:"false" json:"videoOnly"` } func (t TargetAddPayload) MarshalJSON() ([]byte, error) { @@ -58,30 +58,30 @@ func (t *TargetAddPayload) UnmarshalJSON(data []byte) error { return nil } -func (o *TargetAddPayload) GetProfile() string { +func (o *TargetAddPayload) GetID() *string { if o == nil { - return "" + return nil } - return o.Profile + return o.ID } -func (o *TargetAddPayload) GetVideoOnly() *bool { +func (o *TargetAddPayload) GetProfile() string { if o == nil { - return nil + return "" } - return o.VideoOnly + return o.Profile } -func (o *TargetAddPayload) GetID() *string { +func (o *TargetAddPayload) GetSpec() *TargetAddPayloadSpec { if o == nil { return nil } - return o.ID + return o.Spec } -func (o *TargetAddPayload) GetSpec() *TargetAddPayloadSpec { +func (o *TargetAddPayload) GetVideoOnly() *bool { if o == nil { return nil } - return o.Spec + return o.VideoOnly } diff --git a/models/components/targetoutput.go b/models/components/targetoutput.go index 02c8c33..a4c6ba0 100644 --- a/models/components/targetoutput.go +++ b/models/components/targetoutput.go @@ -7,6 +7,8 @@ import ( ) type TargetOutput struct { + // ID of multistream target object where to push this stream + ID *string `json:"id,omitempty"` // Name of transcoding profile that should be sent. Use // "source" for pushing source stream data // @@ -15,8 +17,6 @@ type TargetOutput struct { // video will be pushed to the target. // VideoOnly *bool `default:"false" json:"videoOnly"` - // ID of multistream target object where to push this stream - ID *string `json:"id,omitempty"` } func (t TargetOutput) MarshalJSON() ([]byte, error) { @@ -30,6 +30,13 @@ func (t *TargetOutput) UnmarshalJSON(data []byte) error { return nil } +func (o *TargetOutput) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + func (o *TargetOutput) GetProfile() string { if o == nil { return "" @@ -43,10 +50,3 @@ func (o *TargetOutput) GetVideoOnly() *bool { } return o.VideoOnly } - -func (o *TargetOutput) GetID() *string { - if o == nil { - return nil - } - return o.ID -} diff --git a/models/components/task.go b/models/components/task.go index 86a8797..a139f48 100644 --- a/models/components/task.go +++ b/models/components/task.go @@ -8,87 +8,279 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) -// TaskType - Type of the task -type TaskType string +type TaskIpfs struct { + // IPFS CID of the default metadata exported for the video + NftMetadataCid *string `json:"nftMetadataCid,omitempty"` + // URL to access metadata file via HTTP through an IPFS + // gateway + // + NftMetadataGatewayURL *string `json:"nftMetadataGatewayUrl,omitempty"` + // URL for the metadata file with the IPFS protocol + NftMetadataURL *string `json:"nftMetadataUrl,omitempty"` + // IPFS CID of the exported video file + VideoFileCid string `json:"videoFileCid"` + // URL to access file via HTTP through an IPFS gateway + VideoFileGatewayURL *string `json:"videoFileGatewayUrl,omitempty"` + // URL for the file with the IPFS protocol + VideoFileURL *string `json:"videoFileUrl,omitempty"` +} + +func (o *TaskIpfs) GetNftMetadataCid() *string { + if o == nil { + return nil + } + return o.NftMetadataCid +} + +func (o *TaskIpfs) GetNftMetadataGatewayURL() *string { + if o == nil { + return nil + } + return o.NftMetadataGatewayURL +} + +func (o *TaskIpfs) GetNftMetadataURL() *string { + if o == nil { + return nil + } + return o.NftMetadataURL +} + +func (o *TaskIpfs) GetVideoFileCid() string { + if o == nil { + return "" + } + return o.VideoFileCid +} + +func (o *TaskIpfs) GetVideoFileGatewayURL() *string { + if o == nil { + return nil + } + return o.VideoFileGatewayURL +} + +func (o *TaskIpfs) GetVideoFileURL() *string { + if o == nil { + return nil + } + return o.VideoFileURL +} + +// Export - Output of the export task +type Export struct { + Ipfs *TaskIpfs `json:"ipfs,omitempty"` +} + +func (o *Export) GetIpfs() *TaskIpfs { + if o == nil { + return nil + } + return o.Ipfs +} + +type TaskOutputIpfs struct { + // IPFS CID of the exported data + Cid string `json:"cid"` +} + +func (o *TaskOutputIpfs) GetCid() string { + if o == nil { + return "" + } + return o.Cid +} + +// ExportData - Output of the export data task +type ExportData struct { + Ipfs *TaskOutputIpfs `json:"ipfs,omitempty"` +} + +func (o *ExportData) GetIpfs() *TaskOutputIpfs { + if o == nil { + return nil + } + return o.Ipfs +} + +// Upload - Output of the upload task +type Upload struct { + AssetSpec *Asset `json:"assetSpec,omitempty"` + AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` +} + +func (u Upload) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(u, "", false) +} + +func (u *Upload) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &u, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Upload) GetAssetSpec() *Asset { + if o == nil { + return nil + } + return o.AssetSpec +} + +func (o *Upload) GetAdditionalProperties() map[string]any { + if o == nil { + return nil + } + return o.AdditionalProperties +} + +// Output of the task +type Output struct { + // Output of the export task + Export *Export `json:"export,omitempty"` + // Output of the export data task + ExportData *ExportData `json:"exportData,omitempty"` + // Output of the upload task + Upload *Upload `json:"upload,omitempty"` +} + +func (o *Output) GetExport() *Export { + if o == nil { + return nil + } + return o.Export +} + +func (o *Output) GetExportData() *ExportData { + if o == nil { + return nil + } + return o.ExportData +} + +func (o *Output) GetUpload() *Upload { + if o == nil { + return nil + } + return o.Upload +} + +// CatalystPipelineStrategy - Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. +type CatalystPipelineStrategy string const ( - TaskTypeUpload TaskType = "upload" - TaskTypeExport TaskType = "export" - TaskTypeExportData TaskType = "export-data" - TaskTypeTranscodeFile TaskType = "transcode-file" - TaskTypeClip TaskType = "clip" + CatalystPipelineStrategyCatalyst CatalystPipelineStrategy = "catalyst" + CatalystPipelineStrategyCatalystFfmpeg CatalystPipelineStrategy = "catalyst_ffmpeg" + CatalystPipelineStrategyBackgroundExternal CatalystPipelineStrategy = "background_external" + CatalystPipelineStrategyBackgroundMist CatalystPipelineStrategy = "background_mist" + CatalystPipelineStrategyFallbackExternal CatalystPipelineStrategy = "fallback_external" + CatalystPipelineStrategyExternal CatalystPipelineStrategy = "external" ) -func (e TaskType) ToPointer() *TaskType { +func (e CatalystPipelineStrategy) ToPointer() *CatalystPipelineStrategy { return &e } -func (e *TaskType) UnmarshalJSON(data []byte) error { +func (e *CatalystPipelineStrategy) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "upload": + case "catalyst": fallthrough - case "export": + case "catalyst_ffmpeg": fallthrough - case "export-data": + case "background_external": fallthrough - case "transcode-file": + case "background_mist": fallthrough - case "clip": - *e = TaskType(v) + case "fallback_external": + fallthrough + case "external": + *e = CatalystPipelineStrategy(v) return nil default: - return fmt.Errorf("invalid value for TaskType: %v", v) + return fmt.Errorf("invalid value for CatalystPipelineStrategy: %v", v) } } -// Upload - Parameters for the upload task -type Upload struct { - // URL of the asset to "upload" - URL *string `json:"url,omitempty"` - Encryption *EncryptionOutput `json:"encryption,omitempty"` - // Decides if the output video should include C2PA signature - C2pa *bool `json:"c2pa,omitempty"` - Profiles []TranscodeProfile `json:"profiles,omitempty"` - // How many seconds the duration of each output segment should be - TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` +// ClipStrategy - Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. +type ClipStrategy struct { + // The end timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ + EndTime *float64 `json:"endTime,omitempty"` + // The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. + PlaybackID *string `json:"playbackId,omitempty"` + // The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ + StartTime *float64 `json:"startTime,omitempty"` } -func (o *Upload) GetURL() *string { +func (o *ClipStrategy) GetEndTime() *float64 { if o == nil { return nil } - return o.URL + return o.EndTime } -func (o *Upload) GetEncryption() *EncryptionOutput { +func (o *ClipStrategy) GetPlaybackID() *string { if o == nil { return nil } - return o.Encryption + return o.PlaybackID } -func (o *Upload) GetC2pa() *bool { +func (o *ClipStrategy) GetStartTime() *float64 { if o == nil { return nil } - return o.C2pa + return o.StartTime +} + +type Clip struct { + // Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. + CatalystPipelineStrategy *CatalystPipelineStrategy `json:"catalystPipelineStrategy,omitempty"` + // Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. + ClipStrategy *ClipStrategy `json:"clipStrategy,omitempty"` + // ID of the input asset or stream + InputID *string `json:"inputId,omitempty"` + // ID of the session + SessionID *string `json:"sessionId,omitempty"` + // URL of the asset to "clip" + URL *string `json:"url,omitempty"` } -func (o *Upload) GetProfiles() []TranscodeProfile { +func (o *Clip) GetCatalystPipelineStrategy() *CatalystPipelineStrategy { if o == nil { return nil } - return o.Profiles + return o.CatalystPipelineStrategy } -func (o *Upload) GetTargetSegmentSizeSecs() *float64 { +func (o *Clip) GetClipStrategy() *ClipStrategy { if o == nil { return nil } - return o.TargetSegmentSizeSecs + return o.ClipStrategy +} + +func (o *Clip) GetInputID() *string { + if o == nil { + return nil + } + return o.InputID +} + +func (o *Clip) GetSessionID() *string { + if o == nil { + return nil + } + return o.SessionID +} + +func (o *Clip) GetURL() *string { + if o == nil { + return nil + } + return o.URL } // Content - File content to store into IPFS @@ -98,12 +290,12 @@ type Content struct { // TaskExportData - Parameters for the export-data task type TaskExportData struct { // File content to store into IPFS - Content Content `json:"content"` - Ipfs *IpfsExportParams `json:"ipfs,omitempty"` + Content Content `json:"content"` + // Optional ID of the content + ID *string `json:"id,omitempty"` + Ipfs *IpfsExportParams `json:"ipfs,omitempty"` // Optional type of content Type *string `json:"type,omitempty"` - // Optional ID of the content - ID *string `json:"id,omitempty"` } func (o *TaskExportData) GetContent() Content { @@ -113,25 +305,25 @@ func (o *TaskExportData) GetContent() Content { return o.Content } -func (o *TaskExportData) GetIpfs() *IpfsExportParams { +func (o *TaskExportData) GetID() *string { if o == nil { return nil } - return o.Ipfs + return o.ID } -func (o *TaskExportData) GetType() *string { +func (o *TaskExportData) GetIpfs() *IpfsExportParams { if o == nil { return nil } - return o.Type + return o.Ipfs } -func (o *TaskExportData) GetID() *string { +func (o *TaskExportData) GetType() *string { if o == nil { return nil } - return o.ID + return o.Type } // TaskInput - Input video file to transcode @@ -149,21 +341,6 @@ func (o *TaskInput) GetURL() *string { return o.URL } -// TaskStorage - Storage for the output files -type TaskStorage struct { - // URL of the output storage, accepts object-store format - // "s3+https" - // - URL *string `json:"url,omitempty"` -} - -func (o *TaskStorage) GetURL() *string { - if o == nil { - return nil - } - return o.URL -} - // TaskHls - HLS output format type TaskHls struct { // Path for the HLS output @@ -212,57 +389,44 @@ func (o *TaskOutputs) GetMp4() *TaskMp4 { return o.Mp4 } +// TaskStorage - Storage for the output files +type TaskStorage struct { + // URL of the output storage, accepts object-store format + // "s3+https" + // + URL *string `json:"url,omitempty"` +} + +func (o *TaskStorage) GetURL() *string { + if o == nil { + return nil + } + return o.URL +} + // TranscodeFile - Parameters for the transcode-file task type TranscodeFile struct { + // Decides if the output video should include C2PA signature + C2pa *bool `json:"c2pa,omitempty"` + CreatorID *InputCreatorID `json:"creatorId,omitempty"` // Input video file to transcode Input *TaskInput `json:"input,omitempty"` - // Storage for the output files - Storage *TaskStorage `json:"storage,omitempty"` // Output formats Outputs *TaskOutputs `json:"outputs,omitempty"` Profiles []TranscodeProfile `json:"profiles,omitempty"` + // Storage for the output files + Storage *TaskStorage `json:"storage,omitempty"` // How many seconds the duration of each output segment should // be // - TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` - CreatorID *InputCreatorID `json:"creatorId,omitempty"` - // Decides if the output video should include C2PA signature - C2pa *bool `json:"c2pa,omitempty"` -} - -func (o *TranscodeFile) GetInput() *TaskInput { - if o == nil { - return nil - } - return o.Input -} - -func (o *TranscodeFile) GetStorage() *TaskStorage { - if o == nil { - return nil - } - return o.Storage -} - -func (o *TranscodeFile) GetOutputs() *TaskOutputs { - if o == nil { - return nil - } - return o.Outputs -} - -func (o *TranscodeFile) GetProfiles() []TranscodeProfile { - if o == nil { - return nil - } - return o.Profiles + TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` } -func (o *TranscodeFile) GetTargetSegmentSizeSecs() *float64 { +func (o *TranscodeFile) GetC2pa() *bool { if o == nil { return nil } - return o.TargetSegmentSizeSecs + return o.C2pa } func (o *TranscodeFile) GetCreatorID() *InputCreatorID { @@ -272,149 +436,106 @@ func (o *TranscodeFile) GetCreatorID() *InputCreatorID { return o.CreatorID } -func (o *TranscodeFile) GetC2pa() *bool { +func (o *TranscodeFile) GetInput() *TaskInput { if o == nil { return nil } - return o.C2pa -} - -// ClipStrategy - Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. -type ClipStrategy struct { - // The start timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ - StartTime *float64 `json:"startTime,omitempty"` - // The end timestamp of the clip in Unix milliseconds. _See the ClipTrigger in the UI Kit for an example of how this is calculated (for HLS, it uses `Program Date-Time` tags, and for WebRTC, it uses the latency from server to client at stream startup)._ - EndTime *float64 `json:"endTime,omitempty"` - // The playback ID of the stream or stream recording to clip. Asset playback IDs are not supported yet. - PlaybackID *string `json:"playbackId,omitempty"` + return o.Input } -func (o *ClipStrategy) GetStartTime() *float64 { +func (o *TranscodeFile) GetOutputs() *TaskOutputs { if o == nil { return nil } - return o.StartTime + return o.Outputs } -func (o *ClipStrategy) GetEndTime() *float64 { +func (o *TranscodeFile) GetProfiles() []TranscodeProfile { if o == nil { return nil } - return o.EndTime + return o.Profiles } -func (o *ClipStrategy) GetPlaybackID() *string { +func (o *TranscodeFile) GetStorage() *TaskStorage { if o == nil { return nil } - return o.PlaybackID + return o.Storage } -// CatalystPipelineStrategy - Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. -type CatalystPipelineStrategy string - -const ( - CatalystPipelineStrategyCatalyst CatalystPipelineStrategy = "catalyst" - CatalystPipelineStrategyCatalystFfmpeg CatalystPipelineStrategy = "catalyst_ffmpeg" - CatalystPipelineStrategyBackgroundExternal CatalystPipelineStrategy = "background_external" - CatalystPipelineStrategyBackgroundMist CatalystPipelineStrategy = "background_mist" - CatalystPipelineStrategyFallbackExternal CatalystPipelineStrategy = "fallback_external" - CatalystPipelineStrategyExternal CatalystPipelineStrategy = "external" -) - -func (e CatalystPipelineStrategy) ToPointer() *CatalystPipelineStrategy { - return &e -} -func (e *CatalystPipelineStrategy) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "catalyst": - fallthrough - case "catalyst_ffmpeg": - fallthrough - case "background_external": - fallthrough - case "background_mist": - fallthrough - case "fallback_external": - fallthrough - case "external": - *e = CatalystPipelineStrategy(v) +func (o *TranscodeFile) GetTargetSegmentSizeSecs() *float64 { + if o == nil { return nil - default: - return fmt.Errorf("invalid value for CatalystPipelineStrategy: %v", v) } + return o.TargetSegmentSizeSecs } -type Clip struct { - // URL of the asset to "clip" +// TaskUpload - Parameters for the upload task +type TaskUpload struct { + // Decides if the output video should include C2PA signature + C2pa *bool `json:"c2pa,omitempty"` + Encryption *EncryptionOutput `json:"encryption,omitempty"` + Profiles []TranscodeProfile `json:"profiles,omitempty"` + // How many seconds the duration of each output segment should be + TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` + // URL of the asset to "upload" URL *string `json:"url,omitempty"` - // Strategy to use for clipping the asset. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. - ClipStrategy *ClipStrategy `json:"clipStrategy,omitempty"` - // Force to use a specific strategy in the Catalyst pipeline. If not specified, the default strategy that Catalyst is configured for will be used. This field only available for admin users, and is only used for E2E testing. - CatalystPipelineStrategy *CatalystPipelineStrategy `json:"catalystPipelineStrategy,omitempty"` - // ID of the session - SessionID *string `json:"sessionId,omitempty"` - // ID of the input asset or stream - InputID *string `json:"inputId,omitempty"` } -func (o *Clip) GetURL() *string { +func (o *TaskUpload) GetC2pa() *bool { if o == nil { return nil } - return o.URL + return o.C2pa } -func (o *Clip) GetClipStrategy() *ClipStrategy { +func (o *TaskUpload) GetEncryption() *EncryptionOutput { if o == nil { return nil } - return o.ClipStrategy + return o.Encryption } -func (o *Clip) GetCatalystPipelineStrategy() *CatalystPipelineStrategy { +func (o *TaskUpload) GetProfiles() []TranscodeProfile { if o == nil { return nil } - return o.CatalystPipelineStrategy + return o.Profiles } -func (o *Clip) GetSessionID() *string { +func (o *TaskUpload) GetTargetSegmentSizeSecs() *float64 { if o == nil { return nil } - return o.SessionID + return o.TargetSegmentSizeSecs } -func (o *Clip) GetInputID() *string { +func (o *TaskUpload) GetURL() *string { if o == nil { return nil } - return o.InputID + return o.URL } // Params - Parameters of the task type Params struct { - // Parameters for the upload task - Upload *Upload `json:"upload,omitempty"` + Clip *Clip `json:"clip,omitempty"` // Parameters for the export task Export *ExportTaskParams `json:"export,omitempty"` // Parameters for the export-data task ExportData *TaskExportData `json:"exportData,omitempty"` // Parameters for the transcode-file task TranscodeFile *TranscodeFile `json:"transcode-file,omitempty"` - Clip *Clip `json:"clip,omitempty"` + // Parameters for the upload task + Upload *TaskUpload `json:"upload,omitempty"` } -func (o *Params) GetUpload() *Upload { +func (o *Params) GetClip() *Clip { if o == nil { return nil } - return o.Upload + return o.Clip } func (o *Params) GetExport() *ExportTaskParams { @@ -438,11 +559,11 @@ func (o *Params) GetTranscodeFile() *TranscodeFile { return o.TranscodeFile } -func (o *Params) GetClip() *Clip { +func (o *Params) GetUpload() *TaskUpload { if o == nil { return nil } - return o.Clip + return o.Upload } // TaskPhase - Phase of the task @@ -486,30 +607,30 @@ func (e *TaskPhase) UnmarshalJSON(data []byte) error { // TaskStatus - Status of the task type TaskStatus struct { + // Error message if the task failed + ErrorMessage *string `json:"errorMessage,omitempty"` // Phase of the task Phase TaskPhase `json:"phase"` - // Timestamp (in milliseconds) at which task was updated - UpdatedAt float64 `json:"updatedAt"` // Current progress of the task in a 0-1 ratio Progress *float64 `json:"progress,omitempty"` - // Error message if the task failed - ErrorMessage *string `json:"errorMessage,omitempty"` // Number of retries done on the task Retries *float64 `json:"retries,omitempty"` + // Timestamp (in milliseconds) at which task was updated + UpdatedAt float64 `json:"updatedAt"` } -func (o *TaskStatus) GetPhase() TaskPhase { +func (o *TaskStatus) GetErrorMessage() *string { if o == nil { - return TaskPhase("") + return nil } - return o.Phase + return o.ErrorMessage } -func (o *TaskStatus) GetUpdatedAt() float64 { +func (o *TaskStatus) GetPhase() TaskPhase { if o == nil { - return 0.0 + return TaskPhase("") } - return o.UpdatedAt + return o.Phase } func (o *TaskStatus) GetProgress() *float64 { @@ -519,13 +640,6 @@ func (o *TaskStatus) GetProgress() *float64 { return o.Progress } -func (o *TaskStatus) GetErrorMessage() *string { - if o == nil { - return nil - } - return o.ErrorMessage -} - func (o *TaskStatus) GetRetries() *float64 { if o == nil { return nil @@ -533,228 +647,114 @@ func (o *TaskStatus) GetRetries() *float64 { return o.Retries } -// TaskUpload - Output of the upload task -type TaskUpload struct { - AssetSpec *Asset `json:"assetSpec,omitempty"` - AdditionalProperties map[string]any `additionalProperties:"true" json:"-"` -} - -func (t TaskUpload) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(t, "", false) -} - -func (t *TaskUpload) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &t, "", false, false); err != nil { - return err - } - return nil -} - -func (o *TaskUpload) GetAssetSpec() *Asset { - if o == nil { - return nil - } - return o.AssetSpec -} - -func (o *TaskUpload) GetAdditionalProperties() map[string]any { - if o == nil { - return nil - } - return o.AdditionalProperties -} - -type TaskIpfs struct { - // IPFS CID of the exported video file - VideoFileCid string `json:"videoFileCid"` - // URL for the file with the IPFS protocol - VideoFileURL *string `json:"videoFileUrl,omitempty"` - // URL to access file via HTTP through an IPFS gateway - VideoFileGatewayURL *string `json:"videoFileGatewayUrl,omitempty"` - // IPFS CID of the default metadata exported for the video - NftMetadataCid *string `json:"nftMetadataCid,omitempty"` - // URL for the metadata file with the IPFS protocol - NftMetadataURL *string `json:"nftMetadataUrl,omitempty"` - // URL to access metadata file via HTTP through an IPFS - // gateway - // - NftMetadataGatewayURL *string `json:"nftMetadataGatewayUrl,omitempty"` -} - -func (o *TaskIpfs) GetVideoFileCid() string { - if o == nil { - return "" - } - return o.VideoFileCid -} - -func (o *TaskIpfs) GetVideoFileURL() *string { - if o == nil { - return nil - } - return o.VideoFileURL -} - -func (o *TaskIpfs) GetVideoFileGatewayURL() *string { - if o == nil { - return nil - } - return o.VideoFileGatewayURL -} - -func (o *TaskIpfs) GetNftMetadataCid() *string { - if o == nil { - return nil - } - return o.NftMetadataCid -} - -func (o *TaskIpfs) GetNftMetadataURL() *string { - if o == nil { - return nil - } - return o.NftMetadataURL -} - -func (o *TaskIpfs) GetNftMetadataGatewayURL() *string { - if o == nil { - return nil - } - return o.NftMetadataGatewayURL -} - -// Export - Output of the export task -type Export struct { - Ipfs *TaskIpfs `json:"ipfs,omitempty"` -} - -func (o *Export) GetIpfs() *TaskIpfs { - if o == nil { - return nil - } - return o.Ipfs -} - -type TaskOutputIpfs struct { - // IPFS CID of the exported data - Cid string `json:"cid"` -} - -func (o *TaskOutputIpfs) GetCid() string { +func (o *TaskStatus) GetUpdatedAt() float64 { if o == nil { - return "" + return 0.0 } - return o.Cid -} - -// ExportData - Output of the export data task -type ExportData struct { - Ipfs *TaskOutputIpfs `json:"ipfs,omitempty"` + return o.UpdatedAt } -func (o *ExportData) GetIpfs() *TaskOutputIpfs { - if o == nil { - return nil - } - return o.Ipfs -} +// TaskType - Type of the task +type TaskType string -// Output of the task -type Output struct { - // Output of the upload task - Upload *TaskUpload `json:"upload,omitempty"` - // Output of the export task - Export *Export `json:"export,omitempty"` - // Output of the export data task - ExportData *ExportData `json:"exportData,omitempty"` -} +const ( + TaskTypeUpload TaskType = "upload" + TaskTypeExport TaskType = "export" + TaskTypeExportData TaskType = "export-data" + TaskTypeTranscodeFile TaskType = "transcode-file" + TaskTypeClip TaskType = "clip" +) -func (o *Output) GetUpload() *TaskUpload { - if o == nil { - return nil - } - return o.Upload +func (e TaskType) ToPointer() *TaskType { + return &e } - -func (o *Output) GetExport() *Export { - if o == nil { - return nil +func (e *TaskType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err } - return o.Export -} - -func (o *Output) GetExportData() *ExportData { - if o == nil { + switch v { + case "upload": + fallthrough + case "export": + fallthrough + case "export-data": + fallthrough + case "transcode-file": + fallthrough + case "clip": + *e = TaskType(v) return nil + default: + return fmt.Errorf("invalid value for TaskType: %v", v) } - return o.ExportData } type Task struct { - // Task ID - ID *string `json:"id,omitempty"` - // Type of the task - Type *TaskType `json:"type,omitempty"` // Timestamp (in milliseconds) at which task was created CreatedAt *float64 `json:"createdAt,omitempty"` - // Timestamp (in milliseconds) at which the task was scheduled for - // execution (e.g. after file upload finished). - // - ScheduledAt *float64 `json:"scheduledAt,omitempty"` + // Task ID + ID *string `json:"id,omitempty"` // ID of the input asset InputAssetID *string `json:"inputAssetId,omitempty"` + // Output of the task + Output *Output `json:"output,omitempty"` // ID of the output asset OutputAssetID *string `json:"outputAssetId,omitempty"` - // ID of the requester hash(IP + SALT + PlaybackId) - RequesterID *string `json:"requesterId,omitempty"` // Parameters of the task Params *Params `json:"params,omitempty"` + // ID of the requester hash(IP + SALT + PlaybackId) + RequesterID *string `json:"requesterId,omitempty"` + // Timestamp (in milliseconds) at which the task was scheduled for + // execution (e.g. after file upload finished). + // + ScheduledAt *float64 `json:"scheduledAt,omitempty"` // Status of the task Status *TaskStatus `json:"status,omitempty"` - // Output of the task - Output *Output `json:"output,omitempty"` + // Type of the task + Type *TaskType `json:"type,omitempty"` } -func (o *Task) GetID() *string { +func (o *Task) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *Task) GetType() *TaskType { +func (o *Task) GetID() *string { if o == nil { return nil } - return o.Type + return o.ID } -func (o *Task) GetCreatedAt() *float64 { +func (o *Task) GetInputAssetID() *string { if o == nil { return nil } - return o.CreatedAt + return o.InputAssetID } -func (o *Task) GetScheduledAt() *float64 { +func (o *Task) GetOutput() *Output { if o == nil { return nil } - return o.ScheduledAt + return o.Output } -func (o *Task) GetInputAssetID() *string { +func (o *Task) GetOutputAssetID() *string { if o == nil { return nil } - return o.InputAssetID + return o.OutputAssetID } -func (o *Task) GetOutputAssetID() *string { +func (o *Task) GetParams() *Params { if o == nil { return nil } - return o.OutputAssetID + return o.Params } func (o *Task) GetRequesterID() *string { @@ -764,11 +764,11 @@ func (o *Task) GetRequesterID() *string { return o.RequesterID } -func (o *Task) GetParams() *Params { +func (o *Task) GetScheduledAt() *float64 { if o == nil { return nil } - return o.Params + return o.ScheduledAt } func (o *Task) GetStatus() *TaskStatus { @@ -778,9 +778,9 @@ func (o *Task) GetStatus() *TaskStatus { return o.Status } -func (o *Task) GetOutput() *Output { +func (o *Task) GetType() *TaskType { if o == nil { return nil } - return o.Output + return o.Type } diff --git a/models/components/transcodepayload.go b/models/components/transcodepayload.go index d249a45..d1b87d9 100644 --- a/models/components/transcodepayload.go +++ b/models/components/transcodepayload.go @@ -9,6 +9,28 @@ import ( "github.com/livepeer/livepeer-go/internal/utils" ) +// Credentials for the private input video storage +type Credentials struct { + // Access Key ID + AccessKeyID string `json:"accessKeyId"` + // Secret Access Key + SecretAccessKey string `json:"secretAccessKey"` +} + +func (o *Credentials) GetAccessKeyID() string { + if o == nil { + return "" + } + return o.AccessKeyID +} + +func (o *Credentials) GetSecretAccessKey() string { + if o == nil { + return "" + } + return o.SecretAccessKey +} + // InputType - Type of service. This is optional and defaults to `url` if // ÅšURL field is provided. type InputType string @@ -34,63 +56,41 @@ func (e *InputType) UnmarshalJSON(data []byte) error { } } -// Credentials for the private input video storage -type Credentials struct { - // Access Key ID - AccessKeyID string `json:"accessKeyId"` - // Secret Access Key - SecretAccessKey string `json:"secretAccessKey"` -} - -func (o *Credentials) GetAccessKeyID() string { - if o == nil { - return "" - } - return o.AccessKeyID -} - -func (o *Credentials) GetSecretAccessKey() string { - if o == nil { - return "" - } - return o.SecretAccessKey -} - // Input2 - S3-like storage input video type Input2 struct { - // Type of service. This is optional and defaults to `url` if - // ÅšURL field is provided. - // - Type InputType `json:"type"` - // Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) - Endpoint string `json:"endpoint"` // Bucket with input file Bucket string `json:"bucket"` - // Path to the input file inside the bucket - Path string `json:"path"` // Credentials for the private input video storage Credentials Credentials `json:"credentials"` + // Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) + Endpoint string `json:"endpoint"` + // Path to the input file inside the bucket + Path string `json:"path"` + // Type of service. This is optional and defaults to `url` if + // ÅšURL field is provided. + // + Type InputType `json:"type"` } -func (o *Input2) GetType() InputType { +func (o *Input2) GetBucket() string { if o == nil { - return InputType("") + return "" } - return o.Type + return o.Bucket } -func (o *Input2) GetEndpoint() string { +func (o *Input2) GetCredentials() Credentials { if o == nil { - return "" + return Credentials{} } - return o.Endpoint + return o.Credentials } -func (o *Input2) GetBucket() string { +func (o *Input2) GetEndpoint() string { if o == nil { return "" } - return o.Bucket + return o.Endpoint } func (o *Input2) GetPath() string { @@ -100,11 +100,11 @@ func (o *Input2) GetPath() string { return o.Path } -func (o *Input2) GetCredentials() Credentials { +func (o *Input2) GetType() InputType { if o == nil { - return Credentials{} + return InputType("") } - return o.Credentials + return o.Type } // Input1 - URL input video @@ -183,6 +183,90 @@ func (u Input) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type Input: all fields are null") } +// Fmp4 - FMP4 output format +type Fmp4 struct { + // Path for the FMP4 output + Path string `json:"path"` +} + +func (o *Fmp4) GetPath() string { + if o == nil { + return "" + } + return o.Path +} + +// Hls - HLS output format +type Hls struct { + // Path for the HLS output + Path string `json:"path"` +} + +func (o *Hls) GetPath() string { + if o == nil { + return "" + } + return o.Path +} + +// Mp4 - MP4 output format +type Mp4 struct { + // Path for the MP4 output + Path string `json:"path"` +} + +func (o *Mp4) GetPath() string { + if o == nil { + return "" + } + return o.Path +} + +// Outputs - Output formats +type Outputs struct { + // FMP4 output format + Fmp4 *Fmp4 `json:"fmp4,omitempty"` + // HLS output format + Hls *Hls `json:"hls,omitempty"` + // MP4 output format + Mp4 *Mp4 `json:"mp4,omitempty"` +} + +func (o *Outputs) GetFmp4() *Fmp4 { + if o == nil { + return nil + } + return o.Fmp4 +} + +func (o *Outputs) GetHls() *Hls { + if o == nil { + return nil + } + return o.Hls +} + +func (o *Outputs) GetMp4() *Mp4 { + if o == nil { + return nil + } + return o.Mp4 +} + +// TranscodePayloadStorageCredentials - Delegation proof for Livepeer to be able to upload to +// web3.storage +type TranscodePayloadStorageCredentials struct { + // Base64 encoded UCAN delegation proof + Proof string `json:"proof"` +} + +func (o *TranscodePayloadStorageCredentials) GetProof() string { + if o == nil { + return "" + } + return o.Proof +} + // TranscodePayloadStorageType - Type of service used for output files type TranscodePayloadStorageType string @@ -207,28 +291,21 @@ func (e *TranscodePayloadStorageType) UnmarshalJSON(data []byte) error { } } -// TranscodePayloadStorageCredentials - Delegation proof for Livepeer to be able to upload to -// web3.storage -type TranscodePayloadStorageCredentials struct { - // Base64 encoded UCAN delegation proof - Proof string `json:"proof"` -} - -func (o *TranscodePayloadStorageCredentials) GetProof() string { - if o == nil { - return "" - } - return o.Proof -} - // Storage2 - Storage for the output files type Storage2 struct { - // Type of service used for output files - Type TranscodePayloadStorageType `json:"type"` // Delegation proof for Livepeer to be able to upload to // web3.storage // Credentials TranscodePayloadStorageCredentials `json:"credentials"` + // Type of service used for output files + Type TranscodePayloadStorageType `json:"type"` +} + +func (o *Storage2) GetCredentials() TranscodePayloadStorageCredentials { + if o == nil { + return TranscodePayloadStorageCredentials{} + } + return o.Credentials } func (o *Storage2) GetType() TranscodePayloadStorageType { @@ -238,11 +315,26 @@ func (o *Storage2) GetType() TranscodePayloadStorageType { return o.Type } -func (o *Storage2) GetCredentials() TranscodePayloadStorageCredentials { +// StorageCredentials - Credentials for the output video storage +type StorageCredentials struct { + // Access Key ID + AccessKeyID string `json:"accessKeyId"` + // Secret Access Key + SecretAccessKey string `json:"secretAccessKey"` +} + +func (o *StorageCredentials) GetAccessKeyID() string { if o == nil { - return TranscodePayloadStorageCredentials{} + return "" } - return o.Credentials + return o.AccessKeyID +} + +func (o *StorageCredentials) GetSecretAccessKey() string { + if o == nil { + return "" + } + return o.SecretAccessKey } // StorageType - Type of service used for output files @@ -269,66 +361,44 @@ func (e *StorageType) UnmarshalJSON(data []byte) error { } } -// StorageCredentials - Credentials for the output video storage -type StorageCredentials struct { - // Access Key ID - AccessKeyID string `json:"accessKeyId"` - // Secret Access Key - SecretAccessKey string `json:"secretAccessKey"` -} - -func (o *StorageCredentials) GetAccessKeyID() string { - if o == nil { - return "" - } - return o.AccessKeyID -} - -func (o *StorageCredentials) GetSecretAccessKey() string { - if o == nil { - return "" - } - return o.SecretAccessKey -} - // Storage1 - Storage for the output files type Storage1 struct { - // Type of service used for output files - Type StorageType `json:"type"` - // Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) - Endpoint string `json:"endpoint"` // Bucket with output files Bucket string `json:"bucket"` // Credentials for the output video storage Credentials StorageCredentials `json:"credentials"` + // Service endpoint URL (AWS S3 endpoint list: https://docs.aws.amazon.com/general/latest/gr/s3.html, GCP S3 endpoint: https://storage.googleapis.com, Storj: https://gateway.storjshare.io) + Endpoint string `json:"endpoint"` + // Type of service used for output files + Type StorageType `json:"type"` } -func (o *Storage1) GetType() StorageType { +func (o *Storage1) GetBucket() string { if o == nil { - return StorageType("") + return "" } - return o.Type + return o.Bucket } -func (o *Storage1) GetEndpoint() string { +func (o *Storage1) GetCredentials() StorageCredentials { if o == nil { - return "" + return StorageCredentials{} } - return o.Endpoint + return o.Credentials } -func (o *Storage1) GetBucket() string { +func (o *Storage1) GetEndpoint() string { if o == nil { return "" } - return o.Bucket + return o.Endpoint } -func (o *Storage1) GetCredentials() StorageCredentials { +func (o *Storage1) GetType() StorageType { if o == nil { - return StorageCredentials{} + return StorageType("") } - return o.Credentials + return o.Type } type TranscodePayloadStorageUnionType string @@ -394,87 +464,31 @@ func (u TranscodePayloadStorage) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type TranscodePayloadStorage: all fields are null") } -// Hls - HLS output format -type Hls struct { - // Path for the HLS output - Path string `json:"path"` -} - -func (o *Hls) GetPath() string { - if o == nil { - return "" - } - return o.Path -} - -// Mp4 - MP4 output format -type Mp4 struct { - // Path for the MP4 output - Path string `json:"path"` -} - -func (o *Mp4) GetPath() string { - if o == nil { - return "" - } - return o.Path -} - -// Fmp4 - FMP4 output format -type Fmp4 struct { - // Path for the FMP4 output - Path string `json:"path"` -} - -func (o *Fmp4) GetPath() string { - if o == nil { - return "" - } - return o.Path -} - -// Outputs - Output formats -type Outputs struct { - // HLS output format - Hls *Hls `json:"hls,omitempty"` - // MP4 output format - Mp4 *Mp4 `json:"mp4,omitempty"` - // FMP4 output format - Fmp4 *Fmp4 `json:"fmp4,omitempty"` -} - -func (o *Outputs) GetHls() *Hls { - if o == nil { - return nil - } - return o.Hls +type TranscodePayload struct { + // Decides if the output video should include C2PA signature + C2pa *bool `json:"c2pa,omitempty"` + CreatorID *InputCreatorID `json:"creatorId,omitempty"` + Input Input `json:"input"` + // Output formats + Outputs Outputs `json:"outputs"` + Profiles []TranscodeProfile `json:"profiles,omitempty"` + Storage TranscodePayloadStorage `json:"storage"` + // How many seconds the duration of each output segment should be + TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` } -func (o *Outputs) GetMp4() *Mp4 { +func (o *TranscodePayload) GetC2pa() *bool { if o == nil { return nil } - return o.Mp4 + return o.C2pa } -func (o *Outputs) GetFmp4() *Fmp4 { +func (o *TranscodePayload) GetCreatorID() *InputCreatorID { if o == nil { return nil } - return o.Fmp4 -} - -type TranscodePayload struct { - Input Input `json:"input"` - Storage TranscodePayloadStorage `json:"storage"` - // Output formats - Outputs Outputs `json:"outputs"` - Profiles []TranscodeProfile `json:"profiles,omitempty"` - // How many seconds the duration of each output segment should be - TargetSegmentSizeSecs *float64 `json:"targetSegmentSizeSecs,omitempty"` - CreatorID *InputCreatorID `json:"creatorId,omitempty"` - // Decides if the output video should include C2PA signature - C2pa *bool `json:"c2pa,omitempty"` + return o.CreatorID } func (o *TranscodePayload) GetInput() Input { @@ -484,13 +498,6 @@ func (o *TranscodePayload) GetInput() Input { return o.Input } -func (o *TranscodePayload) GetStorage() TranscodePayloadStorage { - if o == nil { - return TranscodePayloadStorage{} - } - return o.Storage -} - func (o *TranscodePayload) GetOutputs() Outputs { if o == nil { return Outputs{} @@ -505,23 +512,16 @@ func (o *TranscodePayload) GetProfiles() []TranscodeProfile { return o.Profiles } -func (o *TranscodePayload) GetTargetSegmentSizeSecs() *float64 { - if o == nil { - return nil - } - return o.TargetSegmentSizeSecs -} - -func (o *TranscodePayload) GetCreatorID() *InputCreatorID { +func (o *TranscodePayload) GetStorage() TranscodePayloadStorage { if o == nil { - return nil + return TranscodePayloadStorage{} } - return o.CreatorID + return o.Storage } -func (o *TranscodePayload) GetC2pa() *bool { +func (o *TranscodePayload) GetTargetSegmentSizeSecs() *float64 { if o == nil { return nil } - return o.C2pa + return o.TargetSegmentSizeSecs } diff --git a/models/components/transcodeprofile.go b/models/components/transcodeprofile.go index 12d605a..1436df7 100644 --- a/models/components/transcodeprofile.go +++ b/models/components/transcodeprofile.go @@ -7,152 +7,152 @@ import ( "fmt" ) -type TranscodeProfileProfile string +type Encoder string const ( - TranscodeProfileProfileH264Baseline TranscodeProfileProfile = "H264Baseline" - TranscodeProfileProfileH264Main TranscodeProfileProfile = "H264Main" - TranscodeProfileProfileH264High TranscodeProfileProfile = "H264High" - TranscodeProfileProfileH264ConstrainedHigh TranscodeProfileProfile = "H264ConstrainedHigh" + EncoderH264 Encoder = "H.264" + EncoderHevc Encoder = "HEVC" + EncoderVp8 Encoder = "VP8" + EncoderVp9 Encoder = "VP9" ) -func (e TranscodeProfileProfile) ToPointer() *TranscodeProfileProfile { +func (e Encoder) ToPointer() *Encoder { return &e } -func (e *TranscodeProfileProfile) UnmarshalJSON(data []byte) error { +func (e *Encoder) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "H264Baseline": + case "H.264": fallthrough - case "H264Main": + case "HEVC": fallthrough - case "H264High": + case "VP8": fallthrough - case "H264ConstrainedHigh": - *e = TranscodeProfileProfile(v) + case "VP9": + *e = Encoder(v) return nil default: - return fmt.Errorf("invalid value for TranscodeProfileProfile: %v", v) + return fmt.Errorf("invalid value for Encoder: %v", v) } } -type TranscodeProfileEncoder string +type Profile string const ( - TranscodeProfileEncoderH264 TranscodeProfileEncoder = "H.264" - TranscodeProfileEncoderHevc TranscodeProfileEncoder = "HEVC" - TranscodeProfileEncoderVp8 TranscodeProfileEncoder = "VP8" - TranscodeProfileEncoderVp9 TranscodeProfileEncoder = "VP9" + ProfileH264Baseline Profile = "H264Baseline" + ProfileH264Main Profile = "H264Main" + ProfileH264High Profile = "H264High" + ProfileH264ConstrainedHigh Profile = "H264ConstrainedHigh" ) -func (e TranscodeProfileEncoder) ToPointer() *TranscodeProfileEncoder { +func (e Profile) ToPointer() *Profile { return &e } -func (e *TranscodeProfileEncoder) UnmarshalJSON(data []byte) error { +func (e *Profile) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { - case "H.264": + case "H264Baseline": fallthrough - case "HEVC": + case "H264Main": fallthrough - case "VP8": + case "H264High": fallthrough - case "VP9": - *e = TranscodeProfileEncoder(v) + case "H264ConstrainedHigh": + *e = Profile(v) return nil default: - return fmt.Errorf("invalid value for TranscodeProfileEncoder: %v", v) + return fmt.Errorf("invalid value for Profile: %v", v) } } // TranscodeProfile - Transcode API profile type TranscodeProfile struct { - Width *int64 `json:"width,omitempty"` - Name *string `json:"name,omitempty"` - Height *int64 `json:"height,omitempty"` - Bitrate int64 `json:"bitrate"` + Bitrate int64 `json:"bitrate"` + Encoder *Encoder `json:"encoder,omitempty"` + Fps *int64 `json:"fps,omitempty"` + FpsDen *int64 `json:"fpsDen,omitempty"` + Gop *string `json:"gop,omitempty"` + Height *int64 `json:"height,omitempty"` + Name *string `json:"name,omitempty"` + Profile *Profile `json:"profile,omitempty"` // Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it. // - Quality *int64 `json:"quality,omitempty"` - Fps *int64 `json:"fps,omitempty"` - FpsDen *int64 `json:"fpsDen,omitempty"` - Gop *string `json:"gop,omitempty"` - Profile *TranscodeProfileProfile `json:"profile,omitempty"` - Encoder *TranscodeProfileEncoder `json:"encoder,omitempty"` + Quality *int64 `json:"quality,omitempty"` + Width *int64 `json:"width,omitempty"` } -func (o *TranscodeProfile) GetWidth() *int64 { +func (o *TranscodeProfile) GetBitrate() int64 { if o == nil { - return nil + return 0 } - return o.Width + return o.Bitrate } -func (o *TranscodeProfile) GetName() *string { +func (o *TranscodeProfile) GetEncoder() *Encoder { if o == nil { return nil } - return o.Name + return o.Encoder } -func (o *TranscodeProfile) GetHeight() *int64 { +func (o *TranscodeProfile) GetFps() *int64 { if o == nil { return nil } - return o.Height + return o.Fps } -func (o *TranscodeProfile) GetBitrate() int64 { +func (o *TranscodeProfile) GetFpsDen() *int64 { if o == nil { - return 0 + return nil } - return o.Bitrate + return o.FpsDen } -func (o *TranscodeProfile) GetQuality() *int64 { +func (o *TranscodeProfile) GetGop() *string { if o == nil { return nil } - return o.Quality + return o.Gop } -func (o *TranscodeProfile) GetFps() *int64 { +func (o *TranscodeProfile) GetHeight() *int64 { if o == nil { return nil } - return o.Fps + return o.Height } -func (o *TranscodeProfile) GetFpsDen() *int64 { +func (o *TranscodeProfile) GetName() *string { if o == nil { return nil } - return o.FpsDen + return o.Name } -func (o *TranscodeProfile) GetGop() *string { +func (o *TranscodeProfile) GetProfile() *Profile { if o == nil { return nil } - return o.Gop + return o.Profile } -func (o *TranscodeProfile) GetProfile() *TranscodeProfileProfile { +func (o *TranscodeProfile) GetQuality() *int64 { if o == nil { return nil } - return o.Profile + return o.Quality } -func (o *TranscodeProfile) GetEncoder() *TranscodeProfileEncoder { +func (o *TranscodeProfile) GetWidth() *int64 { if o == nil { return nil } - return o.Encoder + return o.Width } diff --git a/models/components/usagemetric.go b/models/components/usagemetric.go index 42d62e6..4ab4075 100644 --- a/models/components/usagemetric.go +++ b/models/components/usagemetric.go @@ -4,37 +4,37 @@ package components // UsageMetric - An individual metric about usage of a user. type UsageMetric struct { - // The user ID associated with the metric - UserID *string `json:"UserID,omitempty"` // The creator ID associated with the metric CreatorID *string `json:"CreatorID,omitempty"` // Total minutes of delivery usage. DeliveryUsageMins *float64 `json:"DeliveryUsageMins,omitempty"` - // Total transcoded minutes. - TotalUsageMins *float64 `json:"TotalUsageMins,omitempty"` // Total minutes of storage usage. StorageUsageMins *float64 `json:"StorageUsageMins,omitempty"` + // Total transcoded minutes. + TotalUsageMins *float64 `json:"TotalUsageMins,omitempty"` + // The user ID associated with the metric + UserID *string `json:"UserID,omitempty"` } -func (o *UsageMetric) GetUserID() *string { +func (o *UsageMetric) GetCreatorID() *string { if o == nil { return nil } - return o.UserID + return o.CreatorID } -func (o *UsageMetric) GetCreatorID() *string { +func (o *UsageMetric) GetDeliveryUsageMins() *float64 { if o == nil { return nil } - return o.CreatorID + return o.DeliveryUsageMins } -func (o *UsageMetric) GetDeliveryUsageMins() *float64 { +func (o *UsageMetric) GetStorageUsageMins() *float64 { if o == nil { return nil } - return o.DeliveryUsageMins + return o.StorageUsageMins } func (o *UsageMetric) GetTotalUsageMins() *float64 { @@ -44,9 +44,9 @@ func (o *UsageMetric) GetTotalUsageMins() *float64 { return o.TotalUsageMins } -func (o *UsageMetric) GetStorageUsageMins() *float64 { +func (o *UsageMetric) GetUserID() *string { if o == nil { return nil } - return o.StorageUsageMins + return o.UserID } diff --git a/models/components/viewershipmetric.go b/models/components/viewershipmetric.go index 67390ba..927c723 100644 --- a/models/components/viewershipmetric.go +++ b/models/components/viewershipmetric.go @@ -5,209 +5,209 @@ package components // ViewershipMetric - An individual metric about viewership of an asset. Necessarily, at least // 1 of playbackId and dStorageUrl will be present, depending on the query. type ViewershipMetric struct { - // The playback ID associated with the metric. - PlaybackID *string `json:"playbackId,omitempty"` + // The browser used by the viewer. + Browser *string `json:"browser,omitempty"` + // The browser engine used by the viewer's browser. + BrowserEngine *string `json:"browserEngine,omitempty"` + // The continent where the viewer is located. + Continent *string `json:"continent,omitempty"` + // The country where the viewer is located. + Country *string `json:"country,omitempty"` + // The CPU used by the viewer's device. + CPU *string `json:"cpu,omitempty"` // The ID of the creator associated with the metric. CreatorID *string `json:"creatorId,omitempty"` - // The ID of the viewer associated with the metric. - ViewerID *string `json:"viewerId,omitempty"` // The URL of the distributed storage used for the asset DStorageURL *string `json:"dStorageUrl,omitempty"` - // Timestamp (in milliseconds) when the metric was recorded. If the - // query contains a time step, this timestamp will point to the - // beginning of the time step period. - // - Timestamp *float64 `json:"timestamp,omitempty"` // The device used by the viewer. Device *string `json:"device,omitempty"` // The type of the device used by the viewer. DeviceType *string `json:"deviceType,omitempty"` - // The CPU used by the viewer's device. - CPU *string `json:"cpu,omitempty"` + // The error rate for the asset. + ErrorRate *float64 `json:"errorRate,omitempty"` + // The percentage of sessions that existed before the asset started + // playing. + // + ExitsBeforeStart *float64 `json:"exitsBeforeStart,omitempty"` + // Geographic encoding of the viewers location. Accurate to 3 digits. + Geohash *string `json:"geohash,omitempty"` // The operating system used by the viewer. Os *string `json:"os,omitempty"` - // The browser used by the viewer. - Browser *string `json:"browser,omitempty"` - // The browser engine used by the viewer's browser. - BrowserEngine *string `json:"browserEngine,omitempty"` - // The continent where the viewer is located. - Continent *string `json:"continent,omitempty"` - // The country where the viewer is located. - Country *string `json:"country,omitempty"` + // The playback ID associated with the metric. + PlaybackID *string `json:"playbackId,omitempty"` + // The total playtime in minutes for the asset. + PlaytimeMins float64 `json:"playtimeMins"` + // The rebuffering ratio for the asset. + RebufferRatio *float64 `json:"rebufferRatio,omitempty"` // The subdivision (e.g., state or province) where the viewer is // located. // Subdivision *string `json:"subdivision,omitempty"` + // Timestamp (in milliseconds) when the metric was recorded. If the + // query contains a time step, this timestamp will point to the + // beginning of the time step period. + // + Timestamp *float64 `json:"timestamp,omitempty"` // The timezone where the viewer is located. Timezone *string `json:"timezone,omitempty"` - // Geographic encoding of the viewers location. Accurate to 3 digits. - Geohash *string `json:"geohash,omitempty"` - // The number of views for the asset. - ViewCount int64 `json:"viewCount"` - // The total playtime in minutes for the asset. - PlaytimeMins float64 `json:"playtimeMins"` // The time-to-first-frame (TTFF) in milliseconds. TtffMs *float64 `json:"ttffMs,omitempty"` - // The rebuffering ratio for the asset. - RebufferRatio *float64 `json:"rebufferRatio,omitempty"` - // The error rate for the asset. - ErrorRate *float64 `json:"errorRate,omitempty"` - // The percentage of sessions that existed before the asset started - // playing. - // - ExitsBeforeStart *float64 `json:"exitsBeforeStart,omitempty"` + // The number of views for the asset. + ViewCount int64 `json:"viewCount"` + // The ID of the viewer associated with the metric. + ViewerID *string `json:"viewerId,omitempty"` } -func (o *ViewershipMetric) GetPlaybackID() *string { +func (o *ViewershipMetric) GetBrowser() *string { if o == nil { return nil } - return o.PlaybackID + return o.Browser } -func (o *ViewershipMetric) GetCreatorID() *string { +func (o *ViewershipMetric) GetBrowserEngine() *string { if o == nil { return nil } - return o.CreatorID + return o.BrowserEngine } -func (o *ViewershipMetric) GetViewerID() *string { +func (o *ViewershipMetric) GetContinent() *string { if o == nil { return nil } - return o.ViewerID + return o.Continent } -func (o *ViewershipMetric) GetDStorageURL() *string { +func (o *ViewershipMetric) GetCountry() *string { if o == nil { return nil } - return o.DStorageURL + return o.Country } -func (o *ViewershipMetric) GetTimestamp() *float64 { +func (o *ViewershipMetric) GetCPU() *string { if o == nil { return nil } - return o.Timestamp + return o.CPU } -func (o *ViewershipMetric) GetDevice() *string { +func (o *ViewershipMetric) GetCreatorID() *string { if o == nil { return nil } - return o.Device + return o.CreatorID } -func (o *ViewershipMetric) GetDeviceType() *string { +func (o *ViewershipMetric) GetDStorageURL() *string { if o == nil { return nil } - return o.DeviceType + return o.DStorageURL } -func (o *ViewershipMetric) GetCPU() *string { +func (o *ViewershipMetric) GetDevice() *string { if o == nil { return nil } - return o.CPU + return o.Device } -func (o *ViewershipMetric) GetOs() *string { +func (o *ViewershipMetric) GetDeviceType() *string { if o == nil { return nil } - return o.Os + return o.DeviceType } -func (o *ViewershipMetric) GetBrowser() *string { +func (o *ViewershipMetric) GetErrorRate() *float64 { if o == nil { return nil } - return o.Browser + return o.ErrorRate } -func (o *ViewershipMetric) GetBrowserEngine() *string { +func (o *ViewershipMetric) GetExitsBeforeStart() *float64 { if o == nil { return nil } - return o.BrowserEngine + return o.ExitsBeforeStart } -func (o *ViewershipMetric) GetContinent() *string { +func (o *ViewershipMetric) GetGeohash() *string { if o == nil { return nil } - return o.Continent + return o.Geohash } -func (o *ViewershipMetric) GetCountry() *string { +func (o *ViewershipMetric) GetOs() *string { if o == nil { return nil } - return o.Country + return o.Os } -func (o *ViewershipMetric) GetSubdivision() *string { +func (o *ViewershipMetric) GetPlaybackID() *string { if o == nil { return nil } - return o.Subdivision + return o.PlaybackID } -func (o *ViewershipMetric) GetTimezone() *string { +func (o *ViewershipMetric) GetPlaytimeMins() float64 { if o == nil { - return nil + return 0.0 } - return o.Timezone + return o.PlaytimeMins } -func (o *ViewershipMetric) GetGeohash() *string { +func (o *ViewershipMetric) GetRebufferRatio() *float64 { if o == nil { return nil } - return o.Geohash + return o.RebufferRatio } -func (o *ViewershipMetric) GetViewCount() int64 { +func (o *ViewershipMetric) GetSubdivision() *string { if o == nil { - return 0 + return nil } - return o.ViewCount + return o.Subdivision } -func (o *ViewershipMetric) GetPlaytimeMins() float64 { +func (o *ViewershipMetric) GetTimestamp() *float64 { if o == nil { - return 0.0 + return nil } - return o.PlaytimeMins + return o.Timestamp } -func (o *ViewershipMetric) GetTtffMs() *float64 { +func (o *ViewershipMetric) GetTimezone() *string { if o == nil { return nil } - return o.TtffMs + return o.Timezone } -func (o *ViewershipMetric) GetRebufferRatio() *float64 { +func (o *ViewershipMetric) GetTtffMs() *float64 { if o == nil { return nil } - return o.RebufferRatio + return o.TtffMs } -func (o *ViewershipMetric) GetErrorRate() *float64 { +func (o *ViewershipMetric) GetViewCount() int64 { if o == nil { - return nil + return 0 } - return o.ErrorRate + return o.ViewCount } -func (o *ViewershipMetric) GetExitsBeforeStart() *float64 { +func (o *ViewershipMetric) GetViewerID() *string { if o == nil { return nil } - return o.ExitsBeforeStart + return o.ViewerID } diff --git a/models/components/webhook.go b/models/components/webhook.go index d37ed55..5e7c072 100644 --- a/models/components/webhook.go +++ b/models/components/webhook.go @@ -89,21 +89,14 @@ func (e *Events) UnmarshalJSON(data []byte) error { // LastFailure - failure timestamp and error message with status code type LastFailure struct { - // Timestamp (in milliseconds) at which the webhook last failed - Timestamp *float64 `json:"timestamp,omitempty"` // Webhook failure error message Error *string `json:"error,omitempty"` // Webhook failure response Response *string `json:"response,omitempty"` // Webhook failure status code StatusCode *float64 `json:"statusCode,omitempty"` -} - -func (o *LastFailure) GetTimestamp() *float64 { - if o == nil { - return nil - } - return o.Timestamp + // Timestamp (in milliseconds) at which the webhook last failed + Timestamp *float64 `json:"timestamp,omitempty"` } func (o *LastFailure) GetError() *string { @@ -127,8 +120,15 @@ func (o *LastFailure) GetStatusCode() *float64 { return o.StatusCode } -// Status - status of webhook -type Status struct { +func (o *LastFailure) GetTimestamp() *float64 { + if o == nil { + return nil + } + return o.Timestamp +} + +// WebhookStatus - status of webhook +type WebhookStatus struct { // failure timestamp and error message with status code LastFailure *LastFailure `json:"lastFailure,omitempty"` // Timestamp (in milliseconds) at which the webhook last was @@ -137,14 +137,14 @@ type Status struct { LastTriggeredAt *float64 `json:"lastTriggeredAt,omitempty"` } -func (o *Status) GetLastFailure() *LastFailure { +func (o *WebhookStatus) GetLastFailure() *LastFailure { if o == nil { return nil } return o.LastFailure } -func (o *Status) GetLastTriggeredAt() *float64 { +func (o *WebhookStatus) GetLastTriggeredAt() *float64 { if o == nil { return nil } @@ -152,36 +152,43 @@ func (o *Status) GetLastTriggeredAt() *float64 { } type Webhook struct { - ID *string `json:"id,omitempty"` - Name string `json:"name"` + // Timestamp (in milliseconds) at which stream object was created + CreatedAt *float64 `json:"createdAt,omitempty"` + Events []Events `json:"events,omitempty"` + ID *string `json:"id,omitempty"` // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. Kind *string `json:"kind,omitempty"` - // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - UserID *string `json:"userId,omitempty"` + Name string `json:"name"` // The ID of the project ProjectID *string `json:"projectId,omitempty"` - // Timestamp (in milliseconds) at which stream object was created - CreatedAt *float64 `json:"createdAt,omitempty"` - Events []Events `json:"events,omitempty"` - URL string `json:"url"` + // status of webhook + Status *WebhookStatus `json:"status,omitempty"` // streamId of the stream on which the webhook is applied StreamID *string `json:"streamId,omitempty"` - // status of webhook - Status *Status `json:"status,omitempty"` + URL string `json:"url"` + // Deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + UserID *string `json:"userId,omitempty"` } -func (o *Webhook) GetID() *string { +func (o *Webhook) GetCreatedAt() *float64 { if o == nil { return nil } - return o.ID + return o.CreatedAt } -func (o *Webhook) GetName() string { +func (o *Webhook) GetEvents() []Events { if o == nil { - return "" + return nil } - return o.Name + return o.Events +} + +func (o *Webhook) GetID() *string { + if o == nil { + return nil + } + return o.ID } func (o *Webhook) GetKind() *string { @@ -191,11 +198,11 @@ func (o *Webhook) GetKind() *string { return o.Kind } -func (o *Webhook) GetUserID() *string { +func (o *Webhook) GetName() string { if o == nil { - return nil + return "" } - return o.UserID + return o.Name } func (o *Webhook) GetProjectID() *string { @@ -205,18 +212,18 @@ func (o *Webhook) GetProjectID() *string { return o.ProjectID } -func (o *Webhook) GetCreatedAt() *float64 { +func (o *Webhook) GetStatus() *WebhookStatus { if o == nil { return nil } - return o.CreatedAt + return o.Status } -func (o *Webhook) GetEvents() []Events { +func (o *Webhook) GetStreamID() *string { if o == nil { return nil } - return o.Events + return o.StreamID } func (o *Webhook) GetURL() string { @@ -226,30 +233,30 @@ func (o *Webhook) GetURL() string { return o.URL } -func (o *Webhook) GetStreamID() *string { - if o == nil { - return nil - } - return o.StreamID -} - -func (o *Webhook) GetStatus() *Status { +func (o *Webhook) GetUserID() *string { if o == nil { return nil } - return o.Status + return o.UserID } type WebhookInput struct { - Name string `json:"name"` + Events []Events `json:"events,omitempty"` + Name string `json:"name"` // The ID of the project - ProjectID *string `json:"projectId,omitempty"` - Events []Events `json:"events,omitempty"` - URL string `json:"url"` + ProjectID *string `json:"projectId,omitempty"` // shared secret used to sign the webhook payload SharedSecret *string `json:"sharedSecret,omitempty"` // streamId of the stream on which the webhook is applied StreamID *string `json:"streamId,omitempty"` + URL string `json:"url"` +} + +func (o *WebhookInput) GetEvents() []Events { + if o == nil { + return nil + } + return o.Events } func (o *WebhookInput) GetName() string { @@ -266,20 +273,6 @@ func (o *WebhookInput) GetProjectID() *string { return o.ProjectID } -func (o *WebhookInput) GetEvents() []Events { - if o == nil { - return nil - } - return o.Events -} - -func (o *WebhookInput) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - func (o *WebhookInput) GetSharedSecret() *string { if o == nil { return nil @@ -293,3 +286,10 @@ func (o *WebhookInput) GetStreamID() *string { } return o.StreamID } + +func (o *WebhookInput) GetURL() string { + if o == nil { + return "" + } + return o.URL +} diff --git a/models/components/webhooklog.go b/models/components/webhooklog.go index 70e2a30..e951d03 100644 --- a/models/components/webhooklog.go +++ b/models/components/webhooklog.go @@ -3,42 +3,42 @@ package components type Request struct { - // URL used for the request - URL *string `json:"url,omitempty"` - // HTTP request method - Method *string `json:"method,omitempty"` - // HTTP request headers - Headers map[string]string `json:"headers,omitempty"` // request body Body *string `json:"body,omitempty"` + // HTTP request headers + Headers map[string]string `json:"headers,omitempty"` + // HTTP request method + Method *string `json:"method,omitempty"` + // URL used for the request + URL *string `json:"url,omitempty"` } -func (o *Request) GetURL() *string { +func (o *Request) GetBody() *string { if o == nil { return nil } - return o.URL + return o.Body } -func (o *Request) GetMethod() *string { +func (o *Request) GetHeaders() map[string]string { if o == nil { return nil } - return o.Method + return o.Headers } -func (o *Request) GetHeaders() map[string]string { +func (o *Request) GetMethod() *string { if o == nil { return nil } - return o.Headers + return o.Method } -func (o *Request) GetBody() *string { +func (o *Request) GetURL() *string { if o == nil { return nil } - return o.Body + return o.URL } type Response struct { @@ -72,35 +72,35 @@ func (o *Response) GetStatusText() *string { } type WebhookLog struct { - ID string `json:"id"` - // ID of the webhook this request was made for - WebhookID string `json:"webhookId"` - // The event type that triggered the webhook request - Event *string `json:"event,omitempty"` // Timestamp (in milliseconds) at which webhook request object was // created // CreatedAt *float64 `json:"createdAt,omitempty"` // The time taken (in seconds) to make the webhook request Duration *float64 `json:"duration,omitempty"` - // Whether the webhook request was successful - Success *bool `json:"success,omitempty"` + // The event type that triggered the webhook request + Event *string `json:"event,omitempty"` + ID string `json:"id"` Request *Request `json:"request,omitempty"` Response *Response `json:"response,omitempty"` + // Whether the webhook request was successful + Success *bool `json:"success,omitempty"` + // ID of the webhook this request was made for + WebhookID string `json:"webhookId"` } -func (o *WebhookLog) GetID() string { +func (o *WebhookLog) GetCreatedAt() *float64 { if o == nil { - return "" + return nil } - return o.ID + return o.CreatedAt } -func (o *WebhookLog) GetWebhookID() string { +func (o *WebhookLog) GetDuration() *float64 { if o == nil { - return "" + return nil } - return o.WebhookID + return o.Duration } func (o *WebhookLog) GetEvent() *string { @@ -110,37 +110,37 @@ func (o *WebhookLog) GetEvent() *string { return o.Event } -func (o *WebhookLog) GetCreatedAt() *float64 { +func (o *WebhookLog) GetID() string { if o == nil { - return nil + return "" } - return o.CreatedAt + return o.ID } -func (o *WebhookLog) GetDuration() *float64 { +func (o *WebhookLog) GetRequest() *Request { if o == nil { return nil } - return o.Duration + return o.Request } -func (o *WebhookLog) GetSuccess() *bool { +func (o *WebhookLog) GetResponse() *Response { if o == nil { return nil } - return o.Success + return o.Response } -func (o *WebhookLog) GetRequest() *Request { +func (o *WebhookLog) GetSuccess() *bool { if o == nil { return nil } - return o.Request + return o.Success } -func (o *WebhookLog) GetResponse() *Response { +func (o *WebhookLog) GetWebhookID() string { if o == nil { - return nil + return "" } - return o.Response + return o.WebhookID } diff --git a/models/operations/getcreatorviewershipmetrics.go b/models/operations/getcreatorviewershipmetrics.go index 0bfd643..adca807 100644 --- a/models/operations/getcreatorviewershipmetrics.go +++ b/models/operations/getcreatorviewershipmetrics.go @@ -140,21 +140,21 @@ func (u QueryParamTo) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type QueryParamTo: all fields are null") } -// QueryParamTimeStep - The time step to aggregate viewership metrics by -type QueryParamTimeStep string +// GetCreatorViewershipMetricsQueryParamTimeStep - The time step to aggregate viewership metrics by +type GetCreatorViewershipMetricsQueryParamTimeStep string const ( - QueryParamTimeStepHour QueryParamTimeStep = "hour" - QueryParamTimeStepDay QueryParamTimeStep = "day" - QueryParamTimeStepWeek QueryParamTimeStep = "week" - QueryParamTimeStepMonth QueryParamTimeStep = "month" - QueryParamTimeStepYear QueryParamTimeStep = "year" + GetCreatorViewershipMetricsQueryParamTimeStepHour GetCreatorViewershipMetricsQueryParamTimeStep = "hour" + GetCreatorViewershipMetricsQueryParamTimeStepDay GetCreatorViewershipMetricsQueryParamTimeStep = "day" + GetCreatorViewershipMetricsQueryParamTimeStepWeek GetCreatorViewershipMetricsQueryParamTimeStep = "week" + GetCreatorViewershipMetricsQueryParamTimeStepMonth GetCreatorViewershipMetricsQueryParamTimeStep = "month" + GetCreatorViewershipMetricsQueryParamTimeStepYear GetCreatorViewershipMetricsQueryParamTimeStep = "year" ) -func (e QueryParamTimeStep) ToPointer() *QueryParamTimeStep { +func (e GetCreatorViewershipMetricsQueryParamTimeStep) ToPointer() *GetCreatorViewershipMetricsQueryParamTimeStep { return &e } -func (e *QueryParamTimeStep) UnmarshalJSON(data []byte) error { +func (e *GetCreatorViewershipMetricsQueryParamTimeStep) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -169,33 +169,33 @@ func (e *QueryParamTimeStep) UnmarshalJSON(data []byte) error { case "month": fallthrough case "year": - *e = QueryParamTimeStep(v) + *e = GetCreatorViewershipMetricsQueryParamTimeStep(v) return nil default: - return fmt.Errorf("invalid value for QueryParamTimeStep: %v", v) + return fmt.Errorf("invalid value for GetCreatorViewershipMetricsQueryParamTimeStep: %v", v) } } -type QueryParamBreakdownBy string +type GetCreatorViewershipMetricsQueryParamBreakdownBy string const ( - QueryParamBreakdownByDeviceType QueryParamBreakdownBy = "deviceType" - QueryParamBreakdownByDevice QueryParamBreakdownBy = "device" - QueryParamBreakdownByCPU QueryParamBreakdownBy = "cpu" - QueryParamBreakdownByOs QueryParamBreakdownBy = "os" - QueryParamBreakdownByBrowser QueryParamBreakdownBy = "browser" - QueryParamBreakdownByBrowserEngine QueryParamBreakdownBy = "browserEngine" - QueryParamBreakdownByContinent QueryParamBreakdownBy = "continent" - QueryParamBreakdownByCountry QueryParamBreakdownBy = "country" - QueryParamBreakdownBySubdivision QueryParamBreakdownBy = "subdivision" - QueryParamBreakdownByTimezone QueryParamBreakdownBy = "timezone" - QueryParamBreakdownByViewerID QueryParamBreakdownBy = "viewerId" + GetCreatorViewershipMetricsQueryParamBreakdownByDeviceType GetCreatorViewershipMetricsQueryParamBreakdownBy = "deviceType" + GetCreatorViewershipMetricsQueryParamBreakdownByDevice GetCreatorViewershipMetricsQueryParamBreakdownBy = "device" + GetCreatorViewershipMetricsQueryParamBreakdownByCPU GetCreatorViewershipMetricsQueryParamBreakdownBy = "cpu" + GetCreatorViewershipMetricsQueryParamBreakdownByOs GetCreatorViewershipMetricsQueryParamBreakdownBy = "os" + GetCreatorViewershipMetricsQueryParamBreakdownByBrowser GetCreatorViewershipMetricsQueryParamBreakdownBy = "browser" + GetCreatorViewershipMetricsQueryParamBreakdownByBrowserEngine GetCreatorViewershipMetricsQueryParamBreakdownBy = "browserEngine" + GetCreatorViewershipMetricsQueryParamBreakdownByContinent GetCreatorViewershipMetricsQueryParamBreakdownBy = "continent" + GetCreatorViewershipMetricsQueryParamBreakdownByCountry GetCreatorViewershipMetricsQueryParamBreakdownBy = "country" + GetCreatorViewershipMetricsQueryParamBreakdownBySubdivision GetCreatorViewershipMetricsQueryParamBreakdownBy = "subdivision" + GetCreatorViewershipMetricsQueryParamBreakdownByTimezone GetCreatorViewershipMetricsQueryParamBreakdownBy = "timezone" + GetCreatorViewershipMetricsQueryParamBreakdownByViewerID GetCreatorViewershipMetricsQueryParamBreakdownBy = "viewerId" ) -func (e QueryParamBreakdownBy) ToPointer() *QueryParamBreakdownBy { +func (e GetCreatorViewershipMetricsQueryParamBreakdownBy) ToPointer() *GetCreatorViewershipMetricsQueryParamBreakdownBy { return &e } -func (e *QueryParamBreakdownBy) UnmarshalJSON(data []byte) error { +func (e *GetCreatorViewershipMetricsQueryParamBreakdownBy) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -222,10 +222,10 @@ func (e *QueryParamBreakdownBy) UnmarshalJSON(data []byte) error { case "timezone": fallthrough case "viewerId": - *e = QueryParamBreakdownBy(v) + *e = GetCreatorViewershipMetricsQueryParamBreakdownBy(v) return nil default: - return fmt.Errorf("invalid value for QueryParamBreakdownBy: %v", v) + return fmt.Errorf("invalid value for GetCreatorViewershipMetricsQueryParamBreakdownBy: %v", v) } } @@ -235,7 +235,7 @@ type GetCreatorViewershipMetricsRequest struct { // End timestamp for the query range (exclusive) To *QueryParamTo `queryParam:"style=form,explode=true,name=to"` // The time step to aggregate viewership metrics by - TimeStep *QueryParamTimeStep `queryParam:"style=form,explode=true,name=timeStep"` + TimeStep *GetCreatorViewershipMetricsQueryParamTimeStep `queryParam:"style=form,explode=true,name=timeStep"` // The asset ID to filter metrics for AssetID *string `queryParam:"style=form,explode=true,name=assetId"` // The stream ID to filter metrics for @@ -245,7 +245,7 @@ type GetCreatorViewershipMetricsRequest struct { // The list of fields to break down the query results. Specify this // query-string multiple times to break down by multiple fields. // - BreakdownBy []QueryParamBreakdownBy `queryParam:"style=form,explode=true,name=breakdownBy[]"` + BreakdownBy []GetCreatorViewershipMetricsQueryParamBreakdownBy `queryParam:"style=form,explode=true,name=breakdownBy[]"` } func (o *GetCreatorViewershipMetricsRequest) GetFrom() *QueryParamFrom { @@ -262,7 +262,7 @@ func (o *GetCreatorViewershipMetricsRequest) GetTo() *QueryParamTo { return o.To } -func (o *GetCreatorViewershipMetricsRequest) GetTimeStep() *QueryParamTimeStep { +func (o *GetCreatorViewershipMetricsRequest) GetTimeStep() *GetCreatorViewershipMetricsQueryParamTimeStep { if o == nil { return nil } @@ -290,7 +290,7 @@ func (o *GetCreatorViewershipMetricsRequest) GetCreatorID() *string { return o.CreatorID } -func (o *GetCreatorViewershipMetricsRequest) GetBreakdownBy() []QueryParamBreakdownBy { +func (o *GetCreatorViewershipMetricsRequest) GetBreakdownBy() []GetCreatorViewershipMetricsQueryParamBreakdownBy { if o == nil { return nil } diff --git a/models/operations/getpublicviewershipmetrics.go b/models/operations/getpublicviewershipmetrics.go index 9581028..3380dc9 100644 --- a/models/operations/getpublicviewershipmetrics.go +++ b/models/operations/getpublicviewershipmetrics.go @@ -25,42 +25,42 @@ func (o *GetPublicViewershipMetricsRequest) GetPlaybackID() string { // GetPublicViewershipMetricsData - A simplified metric object about aggregate viewership of an // asset. Either playbackId or dStorageUrl will be set. type GetPublicViewershipMetricsData struct { - // The playback ID associated with the metric. - PlaybackID *string `json:"playbackId,omitempty"` // The URL of the distributed storage used for the asset DStorageURL *string `json:"dStorageUrl,omitempty"` - // The number of views for the asset. - ViewCount *int64 `json:"viewCount,omitempty"` + // The playback ID associated with the metric. + PlaybackID *string `json:"playbackId,omitempty"` // The total playtime in minutes for the asset. PlaytimeMins *float64 `json:"playtimeMins,omitempty"` + // The number of views for the asset. + ViewCount *int64 `json:"viewCount,omitempty"` } -func (o *GetPublicViewershipMetricsData) GetPlaybackID() *string { +func (o *GetPublicViewershipMetricsData) GetDStorageURL() *string { if o == nil { return nil } - return o.PlaybackID + return o.DStorageURL } -func (o *GetPublicViewershipMetricsData) GetDStorageURL() *string { +func (o *GetPublicViewershipMetricsData) GetPlaybackID() *string { if o == nil { return nil } - return o.DStorageURL + return o.PlaybackID } -func (o *GetPublicViewershipMetricsData) GetViewCount() *int64 { +func (o *GetPublicViewershipMetricsData) GetPlaytimeMins() *float64 { if o == nil { return nil } - return o.ViewCount + return o.PlaytimeMins } -func (o *GetPublicViewershipMetricsData) GetPlaytimeMins() *float64 { +func (o *GetPublicViewershipMetricsData) GetViewCount() *int64 { if o == nil { return nil } - return o.PlaytimeMins + return o.ViewCount } type GetPublicViewershipMetricsResponse struct { diff --git a/models/operations/getusagemetrics.go b/models/operations/getusagemetrics.go index 0caa581..5dcd040 100644 --- a/models/operations/getusagemetrics.go +++ b/models/operations/getusagemetrics.go @@ -9,18 +9,18 @@ import ( "github.com/livepeer/livepeer-go/models/sdkerrors" ) -// GetUsageMetricsQueryParamTimeStep - The time step to aggregate viewership metrics by -type GetUsageMetricsQueryParamTimeStep string +// TimeStep - The time step to aggregate viewership metrics by +type TimeStep string const ( - GetUsageMetricsQueryParamTimeStepHour GetUsageMetricsQueryParamTimeStep = "hour" - GetUsageMetricsQueryParamTimeStepDay GetUsageMetricsQueryParamTimeStep = "day" + TimeStepHour TimeStep = "hour" + TimeStepDay TimeStep = "day" ) -func (e GetUsageMetricsQueryParamTimeStep) ToPointer() *GetUsageMetricsQueryParamTimeStep { +func (e TimeStep) ToPointer() *TimeStep { return &e } -func (e *GetUsageMetricsQueryParamTimeStep) UnmarshalJSON(data []byte) error { +func (e *TimeStep) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -29,33 +29,33 @@ func (e *GetUsageMetricsQueryParamTimeStep) UnmarshalJSON(data []byte) error { case "hour": fallthrough case "day": - *e = GetUsageMetricsQueryParamTimeStep(v) + *e = TimeStep(v) return nil default: - return fmt.Errorf("invalid value for GetUsageMetricsQueryParamTimeStep: %v", v) + return fmt.Errorf("invalid value for TimeStep: %v", v) } } -type GetUsageMetricsQueryParamBreakdownBy string +type BreakdownBy string const ( - GetUsageMetricsQueryParamBreakdownByCreatorID GetUsageMetricsQueryParamBreakdownBy = "creatorId" + BreakdownByCreatorID BreakdownBy = "creatorId" ) -func (e GetUsageMetricsQueryParamBreakdownBy) ToPointer() *GetUsageMetricsQueryParamBreakdownBy { +func (e BreakdownBy) ToPointer() *BreakdownBy { return &e } -func (e *GetUsageMetricsQueryParamBreakdownBy) UnmarshalJSON(data []byte) error { +func (e *BreakdownBy) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err } switch v { case "creatorId": - *e = GetUsageMetricsQueryParamBreakdownBy(v) + *e = BreakdownBy(v) return nil default: - return fmt.Errorf("invalid value for GetUsageMetricsQueryParamBreakdownBy: %v", v) + return fmt.Errorf("invalid value for BreakdownBy: %v", v) } } @@ -68,14 +68,14 @@ type GetUsageMetricsRequest struct { To *int64 `queryParam:"style=form,explode=true,name=to"` // The time step to aggregate viewership metrics by // - TimeStep *GetUsageMetricsQueryParamTimeStep `queryParam:"style=form,explode=true,name=timeStep"` + TimeStep *TimeStep `queryParam:"style=form,explode=true,name=timeStep"` // The creator ID to filter the query results // CreatorID *string `queryParam:"style=form,explode=true,name=creatorId"` // The list of fields to break down the query results. Currently the // only supported breakdown is by `creatorId`. // - BreakdownBy []GetUsageMetricsQueryParamBreakdownBy `queryParam:"style=form,explode=true,name=breakdownBy[]"` + BreakdownBy []BreakdownBy `queryParam:"style=form,explode=true,name=breakdownBy[]"` } func (o *GetUsageMetricsRequest) GetFrom() *int64 { @@ -92,7 +92,7 @@ func (o *GetUsageMetricsRequest) GetTo() *int64 { return o.To } -func (o *GetUsageMetricsRequest) GetTimeStep() *GetUsageMetricsQueryParamTimeStep { +func (o *GetUsageMetricsRequest) GetTimeStep() *TimeStep { if o == nil { return nil } @@ -106,7 +106,7 @@ func (o *GetUsageMetricsRequest) GetCreatorID() *string { return o.CreatorID } -func (o *GetUsageMetricsRequest) GetBreakdownBy() []GetUsageMetricsQueryParamBreakdownBy { +func (o *GetUsageMetricsRequest) GetBreakdownBy() []BreakdownBy { if o == nil { return nil } diff --git a/models/operations/getviewershipmetrics.go b/models/operations/getviewershipmetrics.go index 4256b2e..ab00f7e 100644 --- a/models/operations/getviewershipmetrics.go +++ b/models/operations/getviewershipmetrics.go @@ -140,21 +140,21 @@ func (u To) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type To: all fields are null") } -// TimeStep - The time step to aggregate viewership metrics by -type TimeStep string +// QueryParamTimeStep - The time step to aggregate viewership metrics by +type QueryParamTimeStep string const ( - TimeStepHour TimeStep = "hour" - TimeStepDay TimeStep = "day" - TimeStepWeek TimeStep = "week" - TimeStepMonth TimeStep = "month" - TimeStepYear TimeStep = "year" + QueryParamTimeStepHour QueryParamTimeStep = "hour" + QueryParamTimeStepDay QueryParamTimeStep = "day" + QueryParamTimeStepWeek QueryParamTimeStep = "week" + QueryParamTimeStepMonth QueryParamTimeStep = "month" + QueryParamTimeStepYear QueryParamTimeStep = "year" ) -func (e TimeStep) ToPointer() *TimeStep { +func (e QueryParamTimeStep) ToPointer() *QueryParamTimeStep { return &e } -func (e *TimeStep) UnmarshalJSON(data []byte) error { +func (e *QueryParamTimeStep) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -169,36 +169,36 @@ func (e *TimeStep) UnmarshalJSON(data []byte) error { case "month": fallthrough case "year": - *e = TimeStep(v) + *e = QueryParamTimeStep(v) return nil default: - return fmt.Errorf("invalid value for TimeStep: %v", v) + return fmt.Errorf("invalid value for QueryParamTimeStep: %v", v) } } -type BreakdownBy string +type QueryParamBreakdownBy string const ( - BreakdownByPlaybackID BreakdownBy = "playbackId" - BreakdownByDeviceType BreakdownBy = "deviceType" - BreakdownByDevice BreakdownBy = "device" - BreakdownByCPU BreakdownBy = "cpu" - BreakdownByOs BreakdownBy = "os" - BreakdownByBrowser BreakdownBy = "browser" - BreakdownByBrowserEngine BreakdownBy = "browserEngine" - BreakdownByContinent BreakdownBy = "continent" - BreakdownByCountry BreakdownBy = "country" - BreakdownBySubdivision BreakdownBy = "subdivision" - BreakdownByTimezone BreakdownBy = "timezone" - BreakdownByGeohash BreakdownBy = "geohash" - BreakdownByViewerID BreakdownBy = "viewerId" - BreakdownByCreatorID BreakdownBy = "creatorId" + QueryParamBreakdownByPlaybackID QueryParamBreakdownBy = "playbackId" + QueryParamBreakdownByDeviceType QueryParamBreakdownBy = "deviceType" + QueryParamBreakdownByDevice QueryParamBreakdownBy = "device" + QueryParamBreakdownByCPU QueryParamBreakdownBy = "cpu" + QueryParamBreakdownByOs QueryParamBreakdownBy = "os" + QueryParamBreakdownByBrowser QueryParamBreakdownBy = "browser" + QueryParamBreakdownByBrowserEngine QueryParamBreakdownBy = "browserEngine" + QueryParamBreakdownByContinent QueryParamBreakdownBy = "continent" + QueryParamBreakdownByCountry QueryParamBreakdownBy = "country" + QueryParamBreakdownBySubdivision QueryParamBreakdownBy = "subdivision" + QueryParamBreakdownByTimezone QueryParamBreakdownBy = "timezone" + QueryParamBreakdownByGeohash QueryParamBreakdownBy = "geohash" + QueryParamBreakdownByViewerID QueryParamBreakdownBy = "viewerId" + QueryParamBreakdownByCreatorID QueryParamBreakdownBy = "creatorId" ) -func (e BreakdownBy) ToPointer() *BreakdownBy { +func (e QueryParamBreakdownBy) ToPointer() *QueryParamBreakdownBy { return &e } -func (e *BreakdownBy) UnmarshalJSON(data []byte) error { +func (e *QueryParamBreakdownBy) UnmarshalJSON(data []byte) error { var v string if err := json.Unmarshal(data, &v); err != nil { return err @@ -231,10 +231,10 @@ func (e *BreakdownBy) UnmarshalJSON(data []byte) error { case "viewerId": fallthrough case "creatorId": - *e = BreakdownBy(v) + *e = QueryParamBreakdownBy(v) return nil default: - return fmt.Errorf("invalid value for BreakdownBy: %v", v) + return fmt.Errorf("invalid value for QueryParamBreakdownBy: %v", v) } } @@ -249,7 +249,7 @@ type GetViewershipMetricsRequest struct { // End timestamp for the query range (exclusive) To *To `queryParam:"style=form,explode=true,name=to"` // The time step to aggregate viewership metrics by - TimeStep *TimeStep `queryParam:"style=form,explode=true,name=timeStep"` + TimeStep *QueryParamTimeStep `queryParam:"style=form,explode=true,name=timeStep"` // The asset ID to filter metrics for AssetID *string `queryParam:"style=form,explode=true,name=assetId"` // The stream ID to filter metrics for @@ -259,7 +259,7 @@ type GetViewershipMetricsRequest struct { // The list of fields to break down the query results. Specify this // query-string multiple times to break down by multiple fields. // - BreakdownBy []BreakdownBy `queryParam:"style=form,explode=true,name=breakdownBy[]"` + BreakdownBy []QueryParamBreakdownBy `queryParam:"style=form,explode=true,name=breakdownBy[]"` } func (o *GetViewershipMetricsRequest) GetPlaybackID() *string { @@ -283,7 +283,7 @@ func (o *GetViewershipMetricsRequest) GetTo() *To { return o.To } -func (o *GetViewershipMetricsRequest) GetTimeStep() *TimeStep { +func (o *GetViewershipMetricsRequest) GetTimeStep() *QueryParamTimeStep { if o == nil { return nil } @@ -311,7 +311,7 @@ func (o *GetViewershipMetricsRequest) GetCreatorID() *string { return o.CreatorID } -func (o *GetViewershipMetricsRequest) GetBreakdownBy() []BreakdownBy { +func (o *GetViewershipMetricsRequest) GetBreakdownBy() []QueryParamBreakdownBy { if o == nil { return nil } diff --git a/models/operations/requestupload.go b/models/operations/requestupload.go index db6afc5..1b7347f 100644 --- a/models/operations/requestupload.go +++ b/models/operations/requestupload.go @@ -20,40 +20,40 @@ func (o *Task) GetID() string { // RequestUploadData - Success type RequestUploadData struct { + Asset components.Asset `json:"asset"` + Task Task `json:"task"` + // The [Tus-compatible](https://tus.io/) endpoint for resumable uploads. **This is the recommended way to upload assets.** See the [Tus-js](https://github.com/tus/tus-js-client) client for more information. + TusEndpoint string `json:"tusEndpoint"` // The direct upload endpoint for which supports PUT requests. **It is recommended to use the Tus endpoint for a better upload experience.** URL string `json:"url"` - // The [Tus-compatible](https://tus.io/) endpoint for resumable uploads. **This is the recommended way to upload assets.** See the [Tus-js](https://github.com/tus/tus-js-client) client for more information. - TusEndpoint string `json:"tusEndpoint"` - Asset components.Asset `json:"asset"` - Task Task `json:"task"` } -func (o *RequestUploadData) GetURL() string { +func (o *RequestUploadData) GetAsset() components.Asset { if o == nil { - return "" + return components.Asset{} } - return o.URL + return o.Asset } -func (o *RequestUploadData) GetTusEndpoint() string { +func (o *RequestUploadData) GetTask() Task { if o == nil { - return "" + return Task{} } - return o.TusEndpoint + return o.Task } -func (o *RequestUploadData) GetAsset() components.Asset { +func (o *RequestUploadData) GetTusEndpoint() string { if o == nil { - return components.Asset{} + return "" } - return o.Asset + return o.TusEndpoint } -func (o *RequestUploadData) GetTask() Task { +func (o *RequestUploadData) GetURL() string { if o == nil { - return Task{} + return "" } - return o.Task + return o.URL } type RequestUploadResponse struct { diff --git a/models/sdkerrors/error.go b/models/sdkerrors/error.go index 6abb904..eb87123 100644 --- a/models/sdkerrors/error.go +++ b/models/sdkerrors/error.go @@ -6,6 +6,7 @@ import ( "encoding/json" ) +// Error type Error struct { Errors []string `json:"errors,omitempty"` } diff --git a/multistream.go b/multistream.go index 0fd5047..1956d33 100644 --- a/multistream.go +++ b/multistream.go @@ -241,16 +241,18 @@ func (s *Multistream) Create(ctx context.Context, request components.Multistream } -// Get - Retrieve a multistream target -func (s *Multistream) Get(ctx context.Context, id string) (*operations.GetMultistreamTargetResponse, error) { +// Delete a multistream target +// Make sure to remove any references to the target on existing +// streams before actually deleting it from the API. +func (s *Multistream) Delete(ctx context.Context, id string) (*operations.DeleteMultistreamTargetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getMultistreamTarget", + OperationID: "deleteMultistreamTarget", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetMultistreamTargetRequest{ + request := operations.DeleteMultistreamTargetRequest{ ID: id, } @@ -260,7 +262,7 @@ func (s *Multistream) Get(ctx context.Context, id string) (*operations.GetMultis return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -300,7 +302,7 @@ func (s *Multistream) Get(ctx context.Context, id string) (*operations.GetMultis } } - res := &operations.GetMultistreamTargetResponse{ + res := &operations.DeleteMultistreamTargetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -315,18 +317,7 @@ func (s *Multistream) Get(ctx context.Context, id string) (*operations.GetMultis httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.MultistreamTarget - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.MultistreamTarget = &out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 204: case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -349,18 +340,17 @@ func (s *Multistream) Get(ctx context.Context, id string) (*operations.GetMultis } -// Update Multistream Target -func (s *Multistream) Update(ctx context.Context, id string, multistreamTargetPatchPayload components.MultistreamTargetPatchPayload) (*operations.UpdateMultistreamTargetResponse, error) { +// Get - Retrieve a multistream target +func (s *Multistream) Get(ctx context.Context, id string) (*operations.GetMultistreamTargetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "updateMultistreamTarget", + OperationID: "getMultistreamTarget", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.UpdateMultistreamTargetRequest{ - ID: id, - MultistreamTargetPatchPayload: multistreamTargetPatchPayload, + request := operations.GetMultistreamTargetRequest{ + ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -369,18 +359,12 @@ func (s *Multistream) Update(ctx context.Context, id string, multistreamTargetPa return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MultistreamTargetPatchPayload", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -415,7 +399,7 @@ func (s *Multistream) Update(ctx context.Context, id string, multistreamTargetPa } } - res := &operations.UpdateMultistreamTargetResponse{ + res := &operations.GetMultistreamTargetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -430,7 +414,18 @@ func (s *Multistream) Update(ctx context.Context, id string, multistreamTargetPa httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 204: + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out components.MultistreamTarget + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.MultistreamTarget = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -453,19 +448,18 @@ func (s *Multistream) Update(ctx context.Context, id string, multistreamTargetPa } -// Delete a multistream target -// Make sure to remove any references to the target on existing -// streams before actually deleting it from the API. -func (s *Multistream) Delete(ctx context.Context, id string) (*operations.DeleteMultistreamTargetResponse, error) { +// Update Multistream Target +func (s *Multistream) Update(ctx context.Context, id string, multistreamTargetPatchPayload components.MultistreamTargetPatchPayload) (*operations.UpdateMultistreamTargetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "deleteMultistreamTarget", + OperationID: "updateMultistreamTarget", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.DeleteMultistreamTargetRequest{ - ID: id, + request := operations.UpdateMultistreamTargetRequest{ + ID: id, + MultistreamTargetPatchPayload: multistreamTargetPatchPayload, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -474,12 +468,18 @@ func (s *Multistream) Delete(ctx context.Context, id string) (*operations.Delete return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "MultistreamTargetPatchPayload", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -514,7 +514,7 @@ func (s *Multistream) Delete(ctx context.Context, id string) (*operations.Delete } } - res := &operations.DeleteMultistreamTargetResponse{ + res := &operations.UpdateMultistreamTargetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, diff --git a/room.go b/room.go index e746c2f..f773ccf 100644 --- a/room.go +++ b/room.go @@ -134,18 +134,18 @@ func (s *Room) Create(ctx context.Context) (*operations.CreateRoomResponse, erro } -// Get - Retrieve a room +// Delete a room // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) Get(ctx context.Context, id string) (*operations.GetRoomResponse, error) { +func (s *Room) Delete(ctx context.Context, id string) (*operations.DeleteRoomResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getRoom", + OperationID: "deleteRoom", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetRoomRequest{ + request := operations.DeleteRoomRequest{ ID: id, } @@ -155,7 +155,7 @@ func (s *Room) Get(ctx context.Context, id string) (*operations.GetRoomResponse, return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -195,7 +195,7 @@ func (s *Room) Get(ctx context.Context, id string) (*operations.GetRoomResponse, } } - res := &operations.GetRoomResponse{ + res := &operations.DeleteRoomResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -210,18 +210,7 @@ func (s *Room) Get(ctx context.Context, id string) (*operations.GetRoomResponse, httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.Room - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Room = &out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 204: case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -244,18 +233,18 @@ func (s *Room) Get(ctx context.Context, id string) (*operations.GetRoomResponse, } -// Delete a room +// Get - Retrieve a room // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) Delete(ctx context.Context, id string) (*operations.DeleteRoomResponse, error) { +func (s *Room) Get(ctx context.Context, id string) (*operations.GetRoomResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "deleteRoom", + OperationID: "getRoom", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.DeleteRoomRequest{ + request := operations.GetRoomRequest{ ID: id, } @@ -265,7 +254,7 @@ func (s *Room) Delete(ctx context.Context, id string) (*operations.DeleteRoomRes return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -305,7 +294,7 @@ func (s *Room) Delete(ctx context.Context, id string) (*operations.DeleteRoomRes } } - res := &operations.DeleteRoomResponse{ + res := &operations.GetRoomResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -320,7 +309,18 @@ func (s *Room) Delete(ctx context.Context, id string) (*operations.DeleteRoomRes httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 204: + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out components.Room + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Room = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -343,22 +343,19 @@ func (s *Room) Delete(ctx context.Context, id string) (*operations.DeleteRoomRes } -// StartEgress - Start room RTMP egress -// Create a livestream for your room. -// This allows you to leverage livestreaming features like recording and HLS output. +// StopEgress - Stop room RTMP egress // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) StartEgress(ctx context.Context, id string, roomEgressPayload components.RoomEgressPayload) (*operations.StartRoomEgressResponse, error) { +func (s *Room) StopEgress(ctx context.Context, id string) (*operations.StopRoomEgressResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "startRoomEgress", + OperationID: "stopRoomEgress", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.StartRoomEgressRequest{ - ID: id, - RoomEgressPayload: roomEgressPayload, + request := operations.StopRoomEgressRequest{ + ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -367,18 +364,12 @@ func (s *Room) StartEgress(ctx context.Context, id string, roomEgressPayload com return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RoomEgressPayload", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -413,7 +404,7 @@ func (s *Room) StartEgress(ctx context.Context, id string, roomEgressPayload com } } - res := &operations.StartRoomEgressResponse{ + res := &operations.StopRoomEgressResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -451,19 +442,22 @@ func (s *Room) StartEgress(ctx context.Context, id string, roomEgressPayload com } -// StopEgress - Stop room RTMP egress +// StartEgress - Start room RTMP egress +// Create a livestream for your room. +// This allows you to leverage livestreaming features like recording and HLS output. // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) StopEgress(ctx context.Context, id string) (*operations.StopRoomEgressResponse, error) { +func (s *Room) StartEgress(ctx context.Context, id string, roomEgressPayload components.RoomEgressPayload) (*operations.StartRoomEgressResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "stopRoomEgress", + OperationID: "startRoomEgress", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.StopRoomEgressRequest{ - ID: id, + request := operations.StartRoomEgressRequest{ + ID: id, + RoomEgressPayload: roomEgressPayload, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -472,12 +466,18 @@ func (s *Room) StopEgress(ctx context.Context, id string) (*operations.StopRoomE return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RoomEgressPayload", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -512,7 +512,7 @@ func (s *Room) StopEgress(ctx context.Context, id string) (*operations.StopRoomE } } - res := &operations.StopRoomEgressResponse{ + res := &operations.StartRoomEgressResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -670,18 +670,18 @@ func (s *Room) CreateUser(ctx context.Context, id string, roomUserPayload compon } -// GetUser - Get user details +// DeleteUser - Remove a user from the room // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) GetUser(ctx context.Context, id string, userID string) (*operations.GetRoomUserResponse, error) { +func (s *Room) DeleteUser(ctx context.Context, id string, userID string) (*operations.DeleteRoomUserResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getRoomUser", + OperationID: "deleteRoomUser", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetRoomUserRequest{ + request := operations.DeleteRoomUserRequest{ ID: id, UserID: userID, } @@ -692,7 +692,7 @@ func (s *Room) GetUser(ctx context.Context, id string, userID string) (*operatio return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -732,7 +732,7 @@ func (s *Room) GetUser(ctx context.Context, id string, userID string) (*operatio } } - res := &operations.GetRoomUserResponse{ + res := &operations.DeleteRoomUserResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -747,18 +747,7 @@ func (s *Room) GetUser(ctx context.Context, id string, userID string) (*operatio httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.GetRoomUserResponse - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.GetRoomUserResponse = &out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 204: case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -781,22 +770,20 @@ func (s *Room) GetUser(ctx context.Context, id string, userID string) (*operatio } -// UpdateUser - Update a room user -// Update properties for a user. +// GetUser - Get user details // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) UpdateUser(ctx context.Context, id string, userID string, roomUserUpdatePayload components.RoomUserUpdatePayload) (*operations.UpdateRoomUserResponse, error) { +func (s *Room) GetUser(ctx context.Context, id string, userID string) (*operations.GetRoomUserResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "updateRoomUser", + OperationID: "getRoomUser", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.UpdateRoomUserRequest{ - ID: id, - UserID: userID, - RoomUserUpdatePayload: roomUserUpdatePayload, + request := operations.GetRoomUserRequest{ + ID: id, + UserID: userID, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -805,18 +792,12 @@ func (s *Room) UpdateUser(ctx context.Context, id string, userID string, roomUse return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RoomUserUpdatePayload", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -851,7 +832,7 @@ func (s *Room) UpdateUser(ctx context.Context, id string, userID string, roomUse } } - res := &operations.UpdateRoomUserResponse{ + res := &operations.GetRoomUserResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -866,7 +847,18 @@ func (s *Room) UpdateUser(ctx context.Context, id string, userID string, roomUse httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 204: + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out components.GetRoomUserResponse + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.GetRoomUserResponse = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -889,20 +881,22 @@ func (s *Room) UpdateUser(ctx context.Context, id string, userID string, roomUse } -// DeleteUser - Remove a user from the room +// UpdateUser - Update a room user +// Update properties for a user. // // Deprecated method: This will be removed in a future release, please migrate away from it as soon as possible. -func (s *Room) DeleteUser(ctx context.Context, id string, userID string) (*operations.DeleteRoomUserResponse, error) { +func (s *Room) UpdateUser(ctx context.Context, id string, userID string, roomUserUpdatePayload components.RoomUserUpdatePayload) (*operations.UpdateRoomUserResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "deleteRoomUser", + OperationID: "updateRoomUser", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.DeleteRoomUserRequest{ - ID: id, - UserID: userID, + request := operations.UpdateRoomUserRequest{ + ID: id, + UserID: userID, + RoomUserUpdatePayload: roomUserUpdatePayload, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -911,12 +905,18 @@ func (s *Room) DeleteUser(ctx context.Context, id string, userID string) (*opera return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RoomUserUpdatePayload", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -951,7 +951,7 @@ func (s *Room) DeleteUser(ctx context.Context, id string, userID string) (*opera } } - res := &operations.DeleteRoomUserResponse{ + res := &operations.UpdateRoomUserResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, diff --git a/session.go b/session.go index d6a1b9d..4e24073 100644 --- a/session.go +++ b/session.go @@ -27,21 +27,17 @@ func newSession(sdkConfig sdkConfiguration) *Session { } } -// GetClips - Retrieve clips of a session -func (s *Session) GetClips(ctx context.Context, id string) (*operations.GetSessionClipsResponse, error) { +// GetAll - Retrieve sessions +func (s *Session) GetAll(ctx context.Context) (*operations.GetSessionsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getSessionClips", + OperationID: "getSessions", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetSessionClipsRequest{ - ID: id, - } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/session/{id}/clips", request, nil) + opURL, err := url.JoinPath(baseURL, "/session") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -86,7 +82,7 @@ func (s *Session) GetClips(ctx context.Context, id string) (*operations.GetSessi } } - res := &operations.GetSessionClipsResponse{ + res := &operations.GetSessionsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -104,7 +100,7 @@ func (s *Session) GetClips(ctx context.Context, id string) (*operations.GetSessi case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out []components.Asset + var out []components.Session if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } @@ -135,17 +131,21 @@ func (s *Session) GetClips(ctx context.Context, id string) (*operations.GetSessi } -// GetAll - Retrieve sessions -func (s *Session) GetAll(ctx context.Context) (*operations.GetSessionsResponse, error) { +// Get - Retrieve a session +func (s *Session) Get(ctx context.Context, id string) (*operations.GetSessionResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getSessions", + OperationID: "getSession", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } + request := operations.GetSessionRequest{ + ID: id, + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/session") + opURL, err := utils.GenerateURL(ctx, baseURL, "/session/{id}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -190,7 +190,7 @@ func (s *Session) GetAll(ctx context.Context) (*operations.GetSessionsResponse, } } - res := &operations.GetSessionsResponse{ + res := &operations.GetSessionResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -208,12 +208,12 @@ func (s *Session) GetAll(ctx context.Context) (*operations.GetSessionsResponse, case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out []components.Session + var out components.Session if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Data = out + res.Session = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -239,21 +239,21 @@ func (s *Session) GetAll(ctx context.Context) (*operations.GetSessionsResponse, } -// Get - Retrieve a session -func (s *Session) Get(ctx context.Context, id string) (*operations.GetSessionResponse, error) { +// GetClips - Retrieve clips of a session +func (s *Session) GetClips(ctx context.Context, id string) (*operations.GetSessionClipsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getSession", + OperationID: "getSessionClips", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetSessionRequest{ + request := operations.GetSessionClipsRequest{ ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/session/{id}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/session/{id}/clips", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -298,7 +298,7 @@ func (s *Session) Get(ctx context.Context, id string) (*operations.GetSessionRes } } - res := &operations.GetSessionResponse{ + res := &operations.GetSessionClipsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -316,12 +316,12 @@ func (s *Session) Get(ctx context.Context, id string) (*operations.GetSessionRes case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.Session + var out []components.Asset if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Session = &out + res.Data = out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } diff --git a/stream.go b/stream.go index 8cda5cb..5952e98 100644 --- a/stream.go +++ b/stream.go @@ -27,30 +27,17 @@ func newStream(sdkConfig sdkConfiguration) *Stream { } } -// Create a stream -// The only parameter you are required to set is the name of your stream, -// but we also highly recommend that you define transcoding profiles -// parameter that suits your specific broadcasting configuration. -// \ -// \ -// If you do not define transcoding rendition profiles when creating the -// stream, a default set of profiles will be used. These profiles include -// 240p, 360p, 480p and 720p. -// \ -// \ -// The playback policy is set to public by default for new streams. It can -// also be added upon the creation of a new stream by adding -// `"playbackPolicy": {"type": "jwt"}` -func (s *Stream) Create(ctx context.Context, request components.NewStreamPayload) (*operations.CreateStreamResponse, error) { +// CreateClip - Create a clip +func (s *Stream) CreateClip(ctx context.Context, request components.ClipPayload) (*operations.CreateClipResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "createStream", + OperationID: "createClip", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/stream") + opURL, err := url.JoinPath(baseURL, "/clip") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -101,7 +88,7 @@ func (s *Stream) Create(ctx context.Context, request components.NewStreamPayload } } - res := &operations.CreateStreamResponse{ + res := &operations.CreateClipResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -116,15 +103,15 @@ func (s *Stream) Create(ctx context.Context, request components.NewStreamPayload httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 201: + case httpRes.StatusCode == 200: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out components.Stream + var out operations.CreateClipData if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { return nil, err } - res.Stream = &out + res.Data = &out default: return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) } @@ -262,31 +249,46 @@ func (s *Stream) GetAll(ctx context.Context, streamsonly *string) (*operations.G } -// Get - Retrieve a stream -func (s *Stream) Get(ctx context.Context, id string) (*operations.GetStreamResponse, error) { +// Create a stream +// The only parameter you are required to set is the name of your stream, +// but we also highly recommend that you define transcoding profiles +// parameter that suits your specific broadcasting configuration. +// \ +// \ +// If you do not define transcoding rendition profiles when creating the +// stream, a default set of profiles will be used. These profiles include +// 240p, 360p, 480p and 720p. +// \ +// \ +// The playback policy is set to public by default for new streams. It can +// also be added upon the creation of a new stream by adding +// `"playbackPolicy": {"type": "jwt"}` +func (s *Stream) Create(ctx context.Context, request components.NewStreamPayload) (*operations.CreateStreamResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getStream", + OperationID: "createStream", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetStreamRequest{ - ID: id, - } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}", request, nil) + opURL, err := url.JoinPath(baseURL, "/stream") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -321,7 +323,7 @@ func (s *Stream) Get(ctx context.Context, id string) (*operations.GetStreamRespo } } - res := &operations.GetStreamResponse{ + res := &operations.CreateStreamResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -336,7 +338,7 @@ func (s *Stream) Get(ctx context.Context, id string) (*operations.GetStreamRespo httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: + case httpRes.StatusCode == 201: switch { case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): var out components.Stream @@ -370,18 +372,21 @@ func (s *Stream) Get(ctx context.Context, id string) (*operations.GetStreamRespo } -// Update a stream -func (s *Stream) Update(ctx context.Context, id string, streamPatchPayload components.StreamPatchPayload) (*operations.UpdateStreamResponse, error) { +// Delete a stream +// This will also suspend any active stream sessions, so make sure to wait +// until the stream has finished. To explicitly interrupt an active +// session, consider instead updating the suspended field in the stream +// using the PATCH stream API. +func (s *Stream) Delete(ctx context.Context, id string) (*operations.DeleteStreamResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "updateStream", + OperationID: "deleteStream", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.UpdateStreamRequest{ - ID: id, - StreamPatchPayload: streamPatchPayload, + request := operations.DeleteStreamRequest{ + ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -390,18 +395,12 @@ func (s *Stream) Update(ctx context.Context, id string, streamPatchPayload compo return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "StreamPatchPayload", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -436,7 +435,7 @@ func (s *Stream) Update(ctx context.Context, id string, streamPatchPayload compo } } - res := &operations.UpdateStreamResponse{ + res := &operations.DeleteStreamResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -474,20 +473,16 @@ func (s *Stream) Update(ctx context.Context, id string, streamPatchPayload compo } -// Delete a stream -// This will also suspend any active stream sessions, so make sure to wait -// until the stream has finished. To explicitly interrupt an active -// session, consider instead updating the suspended field in the stream -// using the PATCH stream API. -func (s *Stream) Delete(ctx context.Context, id string) (*operations.DeleteStreamResponse, error) { +// Get - Retrieve a stream +func (s *Stream) Get(ctx context.Context, id string) (*operations.GetStreamResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "deleteStream", + OperationID: "getStream", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.DeleteStreamRequest{ + request := operations.GetStreamRequest{ ID: id, } @@ -497,7 +492,7 @@ func (s *Stream) Delete(ctx context.Context, id string) (*operations.DeleteStrea return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -537,7 +532,7 @@ func (s *Stream) Delete(ctx context.Context, id string) (*operations.DeleteStrea } } - res := &operations.DeleteStreamResponse{ + res := &operations.GetStreamResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -552,7 +547,18 @@ func (s *Stream) Delete(ctx context.Context, id string) (*operations.DeleteStrea httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 204: + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out components.Stream + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Stream = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -575,39 +581,38 @@ func (s *Stream) Delete(ctx context.Context, id string) (*operations.DeleteStrea } -// Terminate - Terminates a live stream -// `DELETE /stream/{id}/terminate` can be used to terminate an ongoing -// session on a live stream. Unlike suspending the stream, it allows the -// streamer to restart streaming even immediately, but it will force -// terminate the current session and stop the recording. -// \ -// \ -// A 204 No Content status response indicates the stream was successfully -// terminated. -func (s *Stream) Terminate(ctx context.Context, id string) (*operations.TerminateStreamResponse, error) { +// Update a stream +func (s *Stream) Update(ctx context.Context, id string, streamPatchPayload components.StreamPatchPayload) (*operations.UpdateStreamResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "terminateStream", + OperationID: "updateStream", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.TerminateStreamRequest{ - ID: id, + request := operations.UpdateStreamRequest{ + ID: id, + StreamPatchPayload: streamPatchPayload, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/terminate", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "StreamPatchPayload", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "PATCH", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -642,7 +647,7 @@ func (s *Stream) Terminate(ctx context.Context, id string) (*operations.Terminat } } - res := &operations.TerminateStreamResponse{ + res := &operations.UpdateStreamResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -680,33 +685,26 @@ func (s *Stream) Terminate(ctx context.Context, id string) (*operations.Terminat } -// StartPull - Start ingest for a pull stream -// `POST /stream/{id}/start-pull` can be used to start ingest for a stream -// configured with a pull source. If the stream has recording configured, -// it will also start recording. -// \ -// \ -// A 204 No Content status response indicates the stream was successfully -// started. -func (s *Stream) StartPull(ctx context.Context, id string) (*operations.StartPullStreamResponse, error) { +// GetClips - Retrieve clips of a livestream +func (s *Stream) GetClips(ctx context.Context, id string) (*operations.GetClipsResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "startPullStream", + OperationID: "getClips", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.StartPullStreamRequest{ + request := operations.GetClipsRequest{ ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/start-pull", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/clips", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -746,7 +744,7 @@ func (s *Stream) StartPull(ctx context.Context, id string) (*operations.StartPul } } - res := &operations.StartPullStreamResponse{ + res := &operations.GetClipsResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -761,7 +759,18 @@ func (s *Stream) StartPull(ctx context.Context, id string) (*operations.StartPul httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 204: + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): + var out []components.Asset + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Data = out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) + } case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -784,22 +793,27 @@ func (s *Stream) StartPull(ctx context.Context, id string) (*operations.StartPul } -// CreateClip - Create a clip -func (s *Stream) CreateClip(ctx context.Context, request components.ClipPayload) (*operations.CreateClipResponse, error) { +// AddMultistreamTarget - Add a multistream target +func (s *Stream) AddMultistreamTarget(ctx context.Context, id string, targetAddPayload components.TargetAddPayload) (*operations.AddMultistreamTargetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "createClip", + OperationID: "addMultistreamTarget", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } + request := operations.AddMultistreamTargetRequest{ + ID: id, + TargetAddPayload: targetAddPayload, + } + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := url.JoinPath(baseURL, "/clip") + opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/create-multistream-target", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "TargetAddPayload", "json", `request:"mediaType=application/json"`) if err != nil { return nil, err } @@ -845,7 +859,7 @@ func (s *Stream) CreateClip(ctx context.Context, request components.ClipPayload) } } - res := &operations.CreateClipResponse{ + res := &operations.AddMultistreamTargetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -860,18 +874,7 @@ func (s *Stream) CreateClip(ctx context.Context, request components.ClipPayload) httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out operations.CreateClipData - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Data = &out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 204: case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -894,26 +897,27 @@ func (s *Stream) CreateClip(ctx context.Context, request components.ClipPayload) } -// GetClips - Retrieve clips of a livestream -func (s *Stream) GetClips(ctx context.Context, id string) (*operations.GetClipsResponse, error) { +// RemoveMultistreamTarget - Remove a multistream target +func (s *Stream) RemoveMultistreamTarget(ctx context.Context, id string, targetID string) (*operations.RemoveMultistreamTargetResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getClips", + OperationID: "removeMultistreamTarget", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetClipsRequest{ - ID: id, + request := operations.RemoveMultistreamTargetRequest{ + ID: id, + TargetID: targetID, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/clips", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/multistream/{targetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -953,7 +957,7 @@ func (s *Stream) GetClips(ctx context.Context, id string) (*operations.GetClipsR } } - res := &operations.GetClipsResponse{ + res := &operations.RemoveMultistreamTargetResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -968,18 +972,7 @@ func (s *Stream) GetClips(ctx context.Context, id string) (*operations.GetClipsR httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) switch { - case httpRes.StatusCode == 200: - switch { - case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`): - var out []components.Asset - if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { - return nil, err - } - - res.Data = out - default: - return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes) - } + case httpRes.StatusCode == 204: case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: fallthrough case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: @@ -1002,38 +995,38 @@ func (s *Stream) GetClips(ctx context.Context, id string) (*operations.GetClipsR } -// AddMultistreamTarget - Add a multistream target -func (s *Stream) AddMultistreamTarget(ctx context.Context, id string, targetAddPayload components.TargetAddPayload) (*operations.AddMultistreamTargetResponse, error) { +// StartPull - Start ingest for a pull stream +// `POST /stream/{id}/start-pull` can be used to start ingest for a stream +// configured with a pull source. If the stream has recording configured, +// it will also start recording. +// \ +// \ +// A 204 No Content status response indicates the stream was successfully +// started. +func (s *Stream) StartPull(ctx context.Context, id string) (*operations.StartPullStreamResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "addMultistreamTarget", + OperationID: "startPullStream", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.AddMultistreamTargetRequest{ - ID: id, - TargetAddPayload: targetAddPayload, + request := operations.StartPullStreamRequest{ + ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/create-multistream-target", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/start-pull", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "TargetAddPayload", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, "POST", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "POST", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -1068,7 +1061,7 @@ func (s *Stream) AddMultistreamTarget(ctx context.Context, id string, targetAddP } } - res := &operations.AddMultistreamTargetResponse{ + res := &operations.StartPullStreamResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -1106,22 +1099,29 @@ func (s *Stream) AddMultistreamTarget(ctx context.Context, id string, targetAddP } -// RemoveMultistreamTarget - Remove a multistream target -func (s *Stream) RemoveMultistreamTarget(ctx context.Context, id string, targetID string) (*operations.RemoveMultistreamTargetResponse, error) { +// Terminate - Terminates a live stream +// `DELETE /stream/{id}/terminate` can be used to terminate an ongoing +// session on a live stream. Unlike suspending the stream, it allows the +// streamer to restart streaming even immediately, but it will force +// terminate the current session and stop the recording. +// \ +// \ +// A 204 No Content status response indicates the stream was successfully +// terminated. +func (s *Stream) Terminate(ctx context.Context, id string) (*operations.TerminateStreamResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "removeMultistreamTarget", + OperationID: "terminateStream", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.RemoveMultistreamTargetRequest{ - ID: id, - TargetID: targetID, + request := operations.TerminateStreamRequest{ + ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) - opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/multistream/{targetId}", request, nil) + opURL, err := utils.GenerateURL(ctx, baseURL, "/stream/{id}/terminate", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) } @@ -1166,7 +1166,7 @@ func (s *Stream) RemoveMultistreamTarget(ctx context.Context, id string, targetI } } - res := &operations.RemoveMultistreamTargetResponse{ + res := &operations.TerminateStreamResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, diff --git a/webhook.go b/webhook.go index 06d09bd..20d17b4 100644 --- a/webhook.go +++ b/webhook.go @@ -242,16 +242,16 @@ func (s *Webhook) Create(ctx context.Context, request components.WebhookInput) ( } -// Get - Retrieve a webhook -func (s *Webhook) Get(ctx context.Context, id string) (*operations.GetWebhookResponse, error) { +// Delete a webhook +func (s *Webhook) Delete(ctx context.Context, id string) (*operations.DeleteWebhookResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "getWebhook", + OperationID: "deleteWebhook", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.GetWebhookRequest{ + request := operations.DeleteWebhookRequest{ ID: id, } @@ -261,7 +261,7 @@ func (s *Webhook) Get(ctx context.Context, id string) (*operations.GetWebhookRes return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) + req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } @@ -301,7 +301,7 @@ func (s *Webhook) Get(ctx context.Context, id string) (*operations.GetWebhookRes } } - res := &operations.GetWebhookResponse{ + res := &operations.DeleteWebhookResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -350,18 +350,17 @@ func (s *Webhook) Get(ctx context.Context, id string) (*operations.GetWebhookRes } -// Update a webhook -func (s *Webhook) Update(ctx context.Context, id string, webhook components.WebhookInput) (*operations.UpdateWebhookResponse, error) { +// Get - Retrieve a webhook +func (s *Webhook) Get(ctx context.Context, id string) (*operations.GetWebhookResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "updateWebhook", + OperationID: "getWebhook", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.UpdateWebhookRequest{ - ID: id, - Webhook: webhook, + request := operations.GetWebhookRequest{ + ID: id, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -370,18 +369,12 @@ func (s *Webhook) Update(ctx context.Context, id string, webhook components.Webh return nil, fmt.Errorf("error generating URL: %w", err) } - bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Webhook", "json", `request:"mediaType=application/json"`) - if err != nil { - return nil, err - } - - req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) + req, err := http.NewRequestWithContext(ctx, "GET", opURL, nil) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) - req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -416,7 +409,7 @@ func (s *Webhook) Update(ctx context.Context, id string, webhook components.Webh } } - res := &operations.UpdateWebhookResponse{ + res := &operations.GetWebhookResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes, @@ -465,17 +458,18 @@ func (s *Webhook) Update(ctx context.Context, id string, webhook components.Webh } -// Delete a webhook -func (s *Webhook) Delete(ctx context.Context, id string) (*operations.DeleteWebhookResponse, error) { +// Update a webhook +func (s *Webhook) Update(ctx context.Context, id string, webhook components.WebhookInput) (*operations.UpdateWebhookResponse, error) { hookCtx := hooks.HookContext{ Context: ctx, - OperationID: "deleteWebhook", + OperationID: "updateWebhook", OAuth2Scopes: []string{}, SecuritySource: s.sdkConfiguration.Security, } - request := operations.DeleteWebhookRequest{ - ID: id, + request := operations.UpdateWebhookRequest{ + ID: id, + Webhook: webhook, } baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) @@ -484,12 +478,18 @@ func (s *Webhook) Delete(ctx context.Context, id string) (*operations.DeleteWebh return nil, fmt.Errorf("error generating URL: %w", err) } - req, err := http.NewRequestWithContext(ctx, "DELETE", opURL, nil) + bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Webhook", "json", `request:"mediaType=application/json"`) + if err != nil { + return nil, err + } + + req, err := http.NewRequestWithContext(ctx, "PUT", opURL, bodyReader) if err != nil { return nil, fmt.Errorf("error creating request: %w", err) } req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent) + req.Header.Set("Content-Type", reqContentType) if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil { return nil, err @@ -524,7 +524,7 @@ func (s *Webhook) Delete(ctx context.Context, id string) (*operations.DeleteWebh } } - res := &operations.DeleteWebhookResponse{ + res := &operations.UpdateWebhookResponse{ HTTPMeta: components.HTTPMetadata{ Request: req, Response: httpRes,