From fc382f97d166379095bff11b56e30063fb42fd7c Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 22 Aug 2024 00:27:14 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.377.1 --- .speakeasy/gen.lock | 16 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- RELEASES.md | 12 +- codeSamples.yaml | 1128 ++++++++--------- docs/models/components/encryption.md | 8 - .../components/multistreamtargetinput.md | 10 - docs/models/components/target.md | 11 - docs/models/components/webhookinput.md | 13 - docs/sdks/accesscontrol/README.md | 34 +- docs/sdks/asset/README.md | 41 +- docs/sdks/livepeer/README.md | 5 - docs/sdks/metrics/README.md | 34 +- docs/sdks/multistream/README.md | 34 +- docs/sdks/playback/README.md | 6 +- docs/sdks/room/README.md | 62 +- docs/sdks/session/README.md | 27 +- docs/sdks/stream/README.md | 76 +- docs/sdks/task/README.md | 13 +- docs/sdks/transcode/README.md | 6 +- docs/sdks/webhook/README.md | 55 +- internal/utils/requestbody.go | 22 +- livepeer.go | 6 +- 23 files changed, 821 insertions(+), 810 deletions(-) delete mode 100644 docs/models/components/encryption.md delete mode 100644 docs/models/components/multistreamtargetinput.md delete mode 100644 docs/models/components/target.md delete mode 100644 docs/models/components/webhookinput.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2f40c25..3e149fc 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: b07d9fb0472710366cb13f9d82d6f7e6 + docChecksum: 621777b59b6c0b8c4338eafc280edfd1 docVersion: 1.0.0 - speakeasyVersion: 1.363.1 - generationVersion: 2.396.0 - releaseVersion: 0.3.0 - configChecksum: 4b28c370330d8627b2962f37996e4d43 + speakeasyVersion: 1.377.1 + generationVersion: 2.404.1 + releaseVersion: 0.3.1 + configChecksum: 4a764cb3a67acc448a15d85784ff0fa9 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.6 - core: 3.5.3 + core: 3.5.5 defaultEnabledRetries: 0.2.0 deprecations: 2.81.1 envVarSecurityUsage: 0.3.0 @@ -322,7 +322,6 @@ generatedFiles: - docs/models/components/usertags.md - docs/models/components/multistream.md - docs/models/components/targetspec.md - - docs/models/components/target.md - docs/models/components/inputcreatoridtype.md - docs/models/components/inputcreatorid1.md - docs/models/components/inputcreatorid.md @@ -361,13 +360,11 @@ generatedFiles: - docs/models/components/targetaddpayloadspec.md - docs/models/components/targetaddpayload.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 @@ -380,7 +377,6 @@ generatedFiles: - 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 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 6cc0535..bb213b5 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.3.0 + version: 0.3.1 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index d54144b..41109fe 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.363.1 +speakeasyVersion: 1.377.1 sources: livepeer-studio-api: sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:7934d00ef817e4e73f425924ede45bfc07fa8cec279eac1ee02f6f5e93730fd6 - sourceBlobDigest: sha256:a8253bb61f7b575ee7c22213c414c3f1caed2c39fd613b3e3e5f759f8761ec8e + sourceRevisionDigest: sha256:f629cb6376730d6f7cfa28b2b8edd94d80d7d4563889f67f2b6a13ac343b54ef + sourceBlobDigest: sha256:a46e819194956636cf71bac910d6fd524046664687a96c3d9e0d62f8e08303cf tags: - latest - main @@ -11,8 +11,8 @@ targets: livepeer-go: source: livepeer-studio-api sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:7934d00ef817e4e73f425924ede45bfc07fa8cec279eac1ee02f6f5e93730fd6 - sourceBlobDigest: sha256:a8253bb61f7b575ee7c22213c414c3f1caed2c39fd613b3e3e5f759f8761ec8e + sourceRevisionDigest: sha256:f629cb6376730d6f7cfa28b2b8edd94d80d7d4563889f67f2b6a13ac343b54ef + sourceBlobDigest: sha256:a46e819194956636cf71bac910d6fd524046664687a96c3d9e0d62f8e08303cf outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index e7ed842..b290f86 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -88,4 +88,14 @@ Based on: ### Generated - [go v0.3.0] . ### Releases -- [Go v0.3.0] https://github.com/livepeer/livepeer-go/releases/tag/v0.3.0 - . \ No newline at end of file +- [Go v0.3.0] https://github.com/livepeer/livepeer-go/releases/tag/v0.3.0 - . + +## 2024-08-22 00:26:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.377.1 (2.404.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.3.1] . +### Releases +- [Go v0.3.1] https://github.com/livepeer/livepeer-go/releases/tag/v0.3.1 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 6dab735..93f43a1 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: - - target: $["paths"]["/asset/{assetId}"]["delete"] + - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] update: x-codeSamples: - lang: go - label: deleteAsset + label: removeMultistreamTarget source: |- package main @@ -21,9 +21,11 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var assetID string = "" + var id string = "" + + var targetID string = "" ctx := context.Background() - res, err := s.Asset.Delete(ctx, assetID) + res, err := s.Stream.RemoveMultistreamTarget(ctx, id, targetID) if err != nil { log.Fatal(err) } @@ -31,17 +33,16 @@ actions: // handle response } } - - target: $["paths"]["/room/{id}/user/{userId}"]["put"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] update: x-codeSamples: - lang: go - label: updateRoomUser + label: getSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -50,20 +51,13 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - var userID string = "" - - roomUserUpdatePayload := components.RoomUserUpdatePayload{ - CanPublish: livepeergo.Bool(true), - CanPublishData: livepeergo.Bool(true), - } + var keyID string = "" ctx := context.Background() - res, err := s.Room.UpdateUser(ctx, id, userID, roomUserUpdatePayload) + res, err := s.AccessControl.Get(ctx, keyID) if err != nil { log.Fatal(err) } - if res != nil { + if res.SigningKey != nil { // handle response } } @@ -95,17 +89,16 @@ actions: // handle response } } - - target: $["paths"]["/multistream/target"]["post"] + - target: $["paths"]["/room/{id}"]["delete"] update: x-codeSamples: - lang: go - label: createMultistreamTarget + label: deleteRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -114,23 +107,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.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.MultistreamTarget != nil { + if res != nil { // handle response } } - - target: $["paths"]["/asset"]["get"] + - target: $["paths"]["/access-control/signing-key"]["post"] update: x-codeSamples: - lang: go - label: getAssets + label: createSigningKey source: |- package main @@ -146,24 +137,25 @@ actions: ) ctx := context.Background() - res, err := s.Asset.GetAll(ctx) + res, err := s.AccessControl.Create(ctx) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.SigningKey != nil { // handle response } } - - target: $["paths"]["/stream/{id}"]["get"] + - target: $["paths"]["/asset/upload/url"]["post"] update: x-codeSamples: - lang: go - label: getStream + label: uploadAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -172,21 +164,47 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + request := components.NewAssetFromURLPayload{ + 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), + }, + URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Width: livepeergo.Int64(1280), + Name: livepeergo.String("720p"), + Height: livepeergo.Int64(720), + 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(), + }, + }, + } ctx := context.Background() - res, err := s.Stream.Get(ctx, id) + res, err := s.Asset.CreateViaURL(ctx, request) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.TwoHundredApplicationJSONData != nil { // handle response } } - - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] + - target: $["paths"]["/task/{taskId}"]["get"] update: x-codeSamples: - lang: go - label: getWebhookLog + label: getTask source: |- package main @@ -200,23 +218,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - var logID string = "" + var taskID string = "" ctx := context.Background() - res, err := s.Webhook.GetLog(ctx, id, logID) + res, err := s.Task.Get(ctx, taskID) if err != nil { log.Fatal(err) } - if res.WebhookLog != nil { + if res.Task != nil { // handle response } } - - target: $["paths"]["/session/{id}"]["get"] + - target: $["paths"]["/stream/{id}"]["delete"] update: x-codeSamples: - lang: go - label: getSession + label: deleteStream source: |- package main @@ -232,24 +248,25 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Session.Get(ctx, id) + res, err := s.Stream.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.Session != nil { + if res != nil { // handle response } } - - target: $["paths"]["/access-control/signing-key"]["post"] + - target: $["paths"]["/multistream/target"]["post"] update: x-codeSamples: - lang: go - label: createSigningKey + label: createMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -258,49 +275,23 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - - ctx := context.Background() - res, err := s.AccessControl.Create(ctx) - if err != nil { - log.Fatal(err) - } - if res.SigningKey != nil { - // handle response + request := components.MultistreamTargetInput{ + URL: "rtmps://live.my-service.tv/channel/secretKey", } - } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] - update: - x-codeSamples: - - lang: go - label: deleteSigningKey - source: |- - package main - - import( - livepeergo "github.com/livepeer/livepeer-go" - "context" - "log" - ) - - func main() { - s := livepeergo.New( - livepeergo.WithSecurity(""), - ) - var keyID string = "" ctx := context.Background() - res, err := s.AccessControl.Delete(ctx, keyID) + res, err := s.Multistream.Create(ctx, request) if err != nil { log.Fatal(err) } - if res != nil { + if res.MultistreamTarget != nil { // handle response } } - - target: $["paths"]["/transcode"]["post"] + - target: $["paths"]["/asset/request-upload"]["post"] update: x-codeSamples: - lang: go - label: transcodeVideo + label: requestUpload source: |- package main @@ -315,33 +306,16 @@ 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", + 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{ @@ -359,25 +333,24 @@ actions: }, } ctx := context.Background() - res, err := s.Transcode.Create(ctx, request) + res, err := s.Asset.Create(ctx, request) if err != nil { log.Fatal(err) } - if res.Task != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/clip"]["post"] + - target: $["paths"]["/stream/{id}/terminate"]["delete"] update: x-codeSamples: - lang: go - label: createClip + label: terminateStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -386,27 +359,21 @@ 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.Stream.Terminate(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] + - target: $["paths"]["/session"]["get"] update: x-codeSamples: - lang: go - label: removeMultistreamTarget + label: getSessions source: |- package main @@ -420,23 +387,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - var targetID string = "" ctx := context.Background() - res, err := s.Stream.RemoveMultistreamTarget(ctx, id, targetID) + res, err := s.Session.GetAll(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/asset/request-upload"]["post"] + - target: $["paths"]["/room/{id}/user"]["post"] update: x-codeSamples: - lang: go - label: requestUpload + label: createRoomUser source: |- package main @@ -451,51 +416,33 @@ 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"), - Height: livepeergo.Int64(720), - 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 = "" + + roomUserPayload := components.RoomUserPayload{ + Name: "name", + CanPublish: livepeergo.Bool(true), + CanPublishData: livepeergo.Bool(true), } ctx := context.Background() - res, err := s.Asset.Create(ctx, request) + res, err := s.Room.CreateUser(ctx, id, roomUserPayload) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.RoomUserResponse != nil { // handle response } } - - target: $["paths"]["/room/{id}"]["delete"] + - target: $["paths"]["/data/views/query"]["get"] update: x-codeSamples: - lang: go - label: deleteRoom + label: getViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -504,21 +451,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + request := operations.GetViewershipMetricsRequest{} ctx := context.Background() - res, err := s.Room.Delete(ctx, id) + res, err := s.Metrics.GetViewership(ctx, request) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/task/{taskId}"]["get"] + - target: $["paths"]["/playback/{id}"]["get"] update: x-codeSamples: - lang: go - label: getTask + label: getPlaybackInfo source: |- package main @@ -532,26 +479,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var taskID string = "" + var id string = "" ctx := context.Background() - res, err := s.Task.Get(ctx, taskID) + res, err := s.Playback.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Task != nil { + if res.PlaybackInfo != nil { // handle response } } - - target: $["paths"]["/stream/{id}/terminate"]["delete"] + - target: $["paths"]["/stream"]["post"] update: x-codeSamples: - lang: go - label: terminateStream + label: createStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -560,27 +508,89 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + 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: 720, + 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.NewStreamPayloadRecordingSpec{ + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Width: livepeergo.Int64(1280), + Name: livepeergo.String("720p"), + Height: livepeergo.Int64(720), + 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(), + }, + }, + }, + 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.Terminate(ctx, id) + res, err := s.Stream.Create(ctx, request) if err != nil { log.Fatal(err) } - if res != nil { + if res.Stream != nil { // handle response } } - - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] + - target: $["paths"]["/multistream/target"]["get"] update: x-codeSamples: - lang: go - label: addMultistreamTarget + label: getMultistreamTargets source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -589,36 +599,27 @@ actions: s := livepeergo.New( 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.Multistream.GetAll(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/multistream/target/{id}"]["delete"] + - target: $["paths"]["/data/views/now"]["get"] update: x-codeSamples: - lang: go - label: deleteMultistreamTarget + label: getRealtimeViewershipNow source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -627,21 +628,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + ctx := context.Background() - res, err := s.Multistream.Delete(ctx, id) + res, err := s.Metrics.GetRealtimeViewership(ctx, nil, nil, nil) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] + - target: $["paths"]["/access-control/signing-key"]["get"] update: x-codeSamples: - lang: go - label: getPublicViewershipMetrics + label: getSigningKeys source: |- package main @@ -655,9 +656,9 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var playbackID string = "" + ctx := context.Background() - res, err := s.Metrics.GetPublicViewership(ctx, playbackID) + res, err := s.AccessControl.GetAll(ctx) if err != nil { log.Fatal(err) } @@ -665,11 +666,11 @@ actions: // handle response } } - - target: $["paths"]["/webhook"]["get"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] update: x-codeSamples: - lang: go - label: getWebhooks + label: deleteSigningKey source: |- package main @@ -683,27 +684,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - + var keyID string = "" ctx := context.Background() - res, err := s.Webhook.GetAll(ctx) + res, err := s.AccessControl.Delete(ctx, keyID) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/webhook/{id}"]["put"] + - target: $["paths"]["/multistream/target/{id}"]["get"] update: x-codeSamples: - lang: go - label: updateWebhook + label: getMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -713,32 +713,20 @@ actions: 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.Multistream.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res.MultistreamTarget != nil { // handle response } } - - target: $["paths"]["/webhook/{id}"]["delete"] + - target: $["paths"]["/multistream/target/{id}"]["delete"] update: x-codeSamples: - lang: go - label: deleteWebhook + label: deleteMultistreamTarget source: |- package main @@ -754,25 +742,24 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Webhook.Delete(ctx, id) + res, err := s.Multistream.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res != nil { // handle response } } - - target: $["paths"]["/data/usage/query"]["get"] + - target: $["paths"]["/room/{id}/egress"]["delete"] update: x-codeSamples: - lang: go - label: getUsageMetrics + label: stopRoomEgress source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -781,21 +768,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetUsageMetricsRequest{} + var id string = "" ctx := context.Background() - res, err := s.Metrics.GetUsage(ctx, request) + res, err := s.Room.StopEgress(ctx, id) if err != nil { log.Fatal(err) } - if res.UsageMetric != nil { + if res != nil { // handle response } } - - target: $["paths"]["/playback/{id}"]["get"] + - target: $["paths"]["/session/{id}"]["get"] update: x-codeSamples: - lang: go - label: getPlaybackInfo + label: getSession source: |- package main @@ -811,25 +798,24 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Playback.Get(ctx, id) + res, err := s.Session.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.PlaybackInfo != nil { + if res.Session != nil { // handle response } } - - target: $["paths"]["/webhook"]["post"] + - target: $["paths"]["/room/{id}"]["get"] update: x-codeSamples: - lang: go - label: createWebhook + label: getRoom source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -838,31 +824,21 @@ 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.Get(ctx, id) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res.Room != nil { // handle response } } - - target: $["paths"]["/session"]["get"] + - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] update: x-codeSamples: - lang: go - label: getSessions + label: deleteRoomUser source: |- package main @@ -876,26 +852,29 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) + var id string = "" + var userID string = "" ctx := context.Background() - res, err := s.Session.GetAll(ctx) + 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"]["/room/{id}"]["get"] + - target: $["paths"]["/stream/{parentId}/sessions"]["get"] update: x-codeSamples: - lang: go - label: getRoom + label: getRecordedSessions source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -904,27 +883,30 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + var parentID string = "" + + var record *operations.Record = operations.CreateRecordBoolean( + true, + ) ctx := context.Background() - res, err := s.Room.Get(ctx, id) + res, err := s.Session.GetRecorded(ctx, parentID, record) if err != nil { log.Fatal(err) } - if res.Room != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/stream/{id}"]["patch"] + - target: $["paths"]["/asset/{assetId}"]["get"] update: x-codeSamples: - lang: go - label: updateStream + label: getAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -933,75 +915,21 @@ actions: s := livepeergo.New( 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: 720, - Bitrate: 3000000, - Fps: 30, - FpsDen: livepeergo.Int64(1), - Quality: livepeergo.Int64(23), - Gop: livepeergo.String("2"), - Profile: components.ProfileH264Baseline.ToPointer(), - }, - }, - RecordingSpec: &components.RecordingSpec{ - Profiles: []components.TranscodeProfile{ - components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), - Height: livepeergo.Int64(720), - 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 assetID string = "" ctx := context.Background() - res, err := s.Stream.Update(ctx, id, streamPatchPayload) + res, err := s.Asset.Get(ctx, assetID) if err != nil { log.Fatal(err) } - if res != nil { + if res.Asset != nil { // handle response } } - - target: $["paths"]["/stream/{id}"]["delete"] + - target: $["paths"]["/stream/{id}"]["get"] update: x-codeSamples: - lang: go - label: deleteStream + label: getStream source: |- package main @@ -1017,24 +945,25 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Stream.Delete(ctx, id) + res, err := s.Stream.Get(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.Stream != nil { // handle response } } - - target: $["paths"]["/task"]["get"] + - target: $["paths"]["/webhook/{id}"]["put"] update: x-codeSamples: - lang: go - label: getTasks + label: updateWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1043,27 +972,38 @@ 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, + }, + 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.Task.GetAll(ctx) + res, err := s.Webhook.Update(ctx, id, webhook) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/stream"]["post"] + - target: $["paths"]["/webhook/{id}/log"]["get"] update: x-codeSamples: - lang: go - label: createStream + label: getWebhookLogs source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1072,84 +1012,21 @@ actions: 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: 720, - 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.NewStreamPayloadRecordingSpec{ - Profiles: []components.TranscodeProfile{ - components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), - Height: livepeergo.Int64(720), - 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(), - }, - }, - }, - 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", - }, - }, - }, - }, - } + var id string = "" ctx := context.Background() - res, err := s.Stream.Create(ctx, request) + res, err := s.Webhook.GetLogs(ctx, id) if err != nil { log.Fatal(err) } - if res.Stream != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] + - target: $["paths"]["/webhook/{id}"]["get"] update: x-codeSamples: - lang: go - label: resendWebhook + label: getWebhook source: |- package main @@ -1164,27 +1041,54 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + ctx := context.Background() + res, err := s.Webhook.Get(ctx, id) + if err != nil { + log.Fatal(err) + } + if res.Webhook != nil { + // handle response + } + } + - target: $["paths"]["/task"]["get"] + update: + x-codeSamples: + - lang: go + label: getTasks + source: |- + package main + + import( + livepeergo "github.com/livepeer/livepeer-go" + "context" + "log" + ) + + func main() { + s := livepeergo.New( + livepeergo.WithSecurity(""), + ) - var logID string = "" ctx := context.Background() - res, err := s.Webhook.ResendLog(ctx, id, logID) + res, err := s.Task.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.WebhookLog != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] + - target: $["paths"]["/transcode"]["post"] update: x-codeSamples: - lang: go - label: getSigningKey + label: transcodeVideo source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1193,21 +1097,63 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var keyID string = "" + 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"), + Height: livepeergo.Int64(720), + 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(), + }, + }, + } ctx := context.Background() - res, err := s.AccessControl.Get(ctx, keyID) + res, err := s.Transcode.Create(ctx, request) if err != nil { log.Fatal(err) } - if res.SigningKey != nil { + if res.Task != nil { // handle response } } - - target: $["paths"]["/room/{id}/egress"]["post"] + - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] update: x-codeSamples: - lang: go - label: startRoomEgress + label: addMultistreamTarget source: |- package main @@ -1224,11 +1170,17 @@ actions: ) var id string = "" - roomEgressPayload := components.RoomEgressPayload{ - StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", + 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.Room.StartEgress(ctx, id, roomEgressPayload) + res, err := s.Stream.AddMultistreamTarget(ctx, id, targetAddPayload) if err != nil { log.Fatal(err) } @@ -1236,11 +1188,11 @@ actions: // handle response } } - - target: $["paths"]["/room/{id}/egress"]["delete"] + - target: $["paths"]["/room/{id}/user/{userId}"]["get"] update: x-codeSamples: - lang: go - label: stopRoomEgress + label: getRoomUser source: |- package main @@ -1255,20 +1207,22 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + var userID string = "" ctx := context.Background() - res, err := s.Room.StopEgress(ctx, id) + res, err := s.Room.GetUser(ctx, id, userID) if err != nil { log.Fatal(err) } - if res != nil { + if res.GetRoomUserResponse != nil { // handle response } } - - target: $["paths"]["/data/views/query/creator"]["get"] + - target: $["paths"]["/data/usage/query"]["get"] update: x-codeSamples: - lang: go - label: getCreatorViewershipMetrics + label: getUsageMetrics source: |- package main @@ -1283,26 +1237,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetCreatorViewershipMetricsRequest{} + request := operations.GetUsageMetricsRequest{} ctx := context.Background() - res, err := s.Metrics.GetCreatorViewership(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 } } - - target: $["paths"]["/stream"]["get"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] update: x-codeSamples: - lang: go - label: getStreams + label: updateSigningKey source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1311,27 +1266,28 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) + var keyID string = "" + requestBody := operations.UpdateSigningKeyRequestBody{} ctx := context.Background() - res, err := s.Stream.GetAll(ctx, nil) + res, err := s.AccessControl.Update(ctx, keyID, requestBody) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/multistream/target/{id}"]["patch"] + - target: $["paths"]["/stream"]["get"] update: x-codeSamples: - lang: go - label: updateMultistreamTarget + label: getStreams source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1340,30 +1296,27 @@ 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.Multistream.Update(ctx, id, multistreamTargetPatchPayload) + res, err := s.Stream.GetAll(ctx, nil) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/asset/{assetId}"]["get"] + - target: $["paths"]["/stream/{id}"]["patch"] update: x-codeSamples: - lang: go - label: getAsset + label: updateStream source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1372,26 +1325,81 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var assetID string = "" + 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: 720, + Bitrate: 3000000, + Fps: 30, + FpsDen: livepeergo.Int64(1), + Quality: livepeergo.Int64(23), + Gop: livepeergo.String("2"), + Profile: components.ProfileH264Baseline.ToPointer(), + }, + }, + RecordingSpec: &components.RecordingSpec{ + Profiles: []components.TranscodeProfile{ + components.TranscodeProfile{ + Width: livepeergo.Int64(1280), + Name: livepeergo.String("720p"), + Height: livepeergo.Int64(720), + 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(), + }, + }, + }, + } ctx := context.Background() - res, err := s.Asset.Get(ctx, assetID) + res, err := s.Stream.Update(ctx, id, streamPatchPayload) if err != nil { log.Fatal(err) } - if res.Asset != nil { + if res != nil { // handle response } } - - target: $["paths"]["/stream/{id}/start-pull"]["post"] + - target: $["paths"]["/multistream/target/{id}"]["patch"] update: x-codeSamples: - lang: go - label: startPullStream + label: updateMultistreamTarget source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1401,8 +1409,12 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{ + URL: "rtmps://live.my-service.tv/channel/secretKey", + } ctx := context.Background() - res, err := s.Stream.StartPull(ctx, id) + res, err := s.Multistream.Update(ctx, id, multistreamTargetPatchPayload) if err != nil { log.Fatal(err) } @@ -1410,11 +1422,11 @@ actions: // handle response } } - - target: $["paths"]["/multistream/target"]["get"] + - target: $["paths"]["/stream/{id}/start-pull"]["post"] update: x-codeSamples: - lang: go - label: getMultistreamTargets + label: startPullStream source: |- package main @@ -1428,27 +1440,26 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - + var id string = "" ctx := context.Background() - res, err := s.Multistream.GetAll(ctx) + res, err := s.Stream.StartPull(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res != nil { // handle response } } - - target: $["paths"]["/stream/{parentId}/sessions"]["get"] + - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] update: x-codeSamples: - lang: go - label: getRecordedSessions + label: getWebhookLog source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1457,31 +1468,28 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var parentID string = "" + var id string = "" - var record *operations.Record = operations.CreateRecordBoolean( - true, - ) + var logID string = "" ctx := context.Background() - res, err := s.Session.GetRecorded(ctx, parentID, record) + res, err := s.Webhook.GetLog(ctx, id, logID) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.WebhookLog != nil { // handle response } } - - target: $["paths"]["/room/{id}/user"]["post"] + - target: $["paths"]["/asset/{assetId}"]["delete"] update: x-codeSamples: - lang: go - label: createRoomUser + label: deleteAsset source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1490,33 +1498,27 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - - roomUserPayload := components.RoomUserPayload{ - Name: "name", - CanPublish: livepeergo.Bool(true), - CanPublishData: livepeergo.Bool(true), - } + var assetID string = "" ctx := context.Background() - res, err := s.Room.CreateUser(ctx, id, roomUserPayload) + res, err := s.Asset.Delete(ctx, assetID) if err != nil { log.Fatal(err) } - if res.RoomUserResponse != nil { + if res != nil { // handle response } } - - target: $["paths"]["/data/views/query"]["get"] + - target: $["paths"]["/asset/{assetId}"]["patch"] update: x-codeSamples: - lang: go - label: getViewershipMetrics + label: updateAsset 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" ) @@ -1525,27 +1527,38 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := operations.GetViewershipMetricsRequest{} + 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.Metrics.GetViewership(ctx, request) + res, err := s.Asset.Update(ctx, assetID, assetPatchPayload) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.Asset != nil { // handle response } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] + - target: $["paths"]["/webhook"]["get"] update: x-codeSamples: - lang: go - label: updateSigningKey + label: getWebhooks source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1554,23 +1567,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var keyID string = "" - requestBody := operations.UpdateSigningKeyRequestBody{} ctx := context.Background() - res, err := s.AccessControl.Update(ctx, keyID, requestBody) + res, err := s.Webhook.GetAll(ctx) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/asset/upload/url"]["post"] + - target: $["paths"]["/webhook"]["post"] update: x-codeSamples: - lang: go - label: uploadAsset + label: createWebhook source: |- package main @@ -1585,53 +1596,36 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - request := components.NewAssetFromURLPayload{ - 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), - }, - URL: "https://s3.amazonaws.com/my-bucket/path/filename.mp4", - Profiles: []components.TranscodeProfile{ - components.TranscodeProfile{ - Width: livepeergo.Int64(1280), - Name: livepeergo.String("720p"), - Height: livepeergo.Int64(720), - 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(), - }, + 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"), } ctx := context.Background() - res, err := s.Asset.CreateViaURL(ctx, request) + res, err := s.Webhook.Create(ctx, request) if err != nil { log.Fatal(err) } - if res.TwoHundredApplicationJSONData != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/asset/{assetId}"]["patch"] + - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] update: x-codeSamples: - lang: go - label: updateAsset + label: resendWebhook source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1640,33 +1634,23 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var assetID string = "" + var id 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 logID string = "" ctx := context.Background() - res, err := s.Asset.Update(ctx, assetID, assetPatchPayload) + res, err := s.Webhook.ResendLog(ctx, id, logID) if err != nil { log.Fatal(err) } - if res.Asset != nil { + if res.WebhookLog != nil { // handle response } } - - target: $["paths"]["/access-control/signing-key"]["get"] + - target: $["paths"]["/room"]["post"] update: x-codeSamples: - lang: go - label: getSigningKeys + label: createRoom source: |- package main @@ -1682,24 +1666,25 @@ actions: ) ctx := context.Background() - res, err := s.AccessControl.GetAll(ctx) + res, err := s.Room.Create(ctx) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.CreateRoomResponse != nil { // handle response } } - - target: $["paths"]["/multistream/target/{id}"]["get"] + - target: $["paths"]["/room/{id}/user/{userId}"]["put"] update: x-codeSamples: - lang: go - label: getMultistreamTarget + label: updateRoomUser source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1709,20 +1694,27 @@ 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.Multistream.Get(ctx, id) + res, err := s.Room.UpdateUser(ctx, id, userID, roomUserUpdatePayload) if err != nil { log.Fatal(err) } - if res.MultistreamTarget != nil { + if res != nil { // handle response } } - - target: $["paths"]["/webhook/{id}/log"]["get"] + - target: $["paths"]["/webhook/{id}"]["delete"] update: x-codeSamples: - lang: go - label: getWebhookLogs + label: deleteWebhook source: |- package main @@ -1738,19 +1730,19 @@ actions: ) var id string = "" ctx := context.Background() - res, err := s.Webhook.GetLogs(ctx, id) + res, err := s.Webhook.Delete(ctx, id) if err != nil { log.Fatal(err) } - if res.Data != nil { + if res.Webhook != nil { // handle response } } - - target: $["paths"]["/room/{id}/user/{userId}"]["get"] + - target: $["paths"]["/asset"]["get"] update: x-codeSamples: - lang: go - label: getRoomUser + label: getAssets source: |- package main @@ -1764,23 +1756,21 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" - var userID string = "" ctx := context.Background() - res, err := s.Room.GetUser(ctx, id, userID) + res, err := s.Asset.GetAll(ctx) if err != nil { log.Fatal(err) } - if res.GetRoomUserResponse != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] + - target: $["paths"]["/session/{id}/clips"]["get"] update: x-codeSamples: - lang: go - label: deleteRoomUser + label: getSessionClips source: |- package main @@ -1795,28 +1785,25 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" - - var userID string = "" ctx := context.Background() - res, err := s.Room.DeleteUser(ctx, id, userID) + res, err := s.Session.GetClips(ctx, id) if err != nil { log.Fatal(err) } - if res != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/data/views/now"]["get"] + - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] update: x-codeSamples: - lang: go - label: getRealtimeViewershipNow + label: getPublicViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" - "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1825,9 +1812,9 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - + var playbackID string = "" ctx := context.Background() - res, err := s.Metrics.GetRealtimeViewership(ctx, nil, nil, nil) + res, err := s.Metrics.GetPublicViewership(ctx, playbackID) if err != nil { log.Fatal(err) } @@ -1835,16 +1822,17 @@ actions: // handle response } } - - target: $["paths"]["/webhook/{id}"]["get"] + - target: $["paths"]["/clip"]["post"] update: x-codeSamples: - lang: go - label: getWebhook + label: createClip source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1853,26 +1841,33 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - var id string = "" + 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.Webhook.Get(ctx, id) + res, err := s.Stream.CreateClip(ctx, request) if err != nil { log.Fatal(err) } - if res.Webhook != nil { + if res.Data != nil { // handle response } } - - target: $["paths"]["/session/{id}/clips"]["get"] + - target: $["paths"]["/room/{id}/egress"]["post"] update: x-codeSamples: - lang: go - label: getSessionClips + label: startRoomEgress source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/components" "context" "log" ) @@ -1882,25 +1877,30 @@ actions: livepeergo.WithSecurity(""), ) var id string = "" + + roomEgressPayload := components.RoomEgressPayload{ + StreamID: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", + } ctx := context.Background() - res, err := s.Session.GetClips(ctx, id) + 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"]["post"] + - target: $["paths"]["/data/views/query/creator"]["get"] update: x-codeSamples: - lang: go - label: createRoom + label: getCreatorViewershipMetrics source: |- package main import( livepeergo "github.com/livepeer/livepeer-go" + "github.com/livepeer/livepeer-go/models/operations" "context" "log" ) @@ -1909,13 +1909,13 @@ actions: s := livepeergo.New( livepeergo.WithSecurity(""), ) - + request := operations.GetCreatorViewershipMetricsRequest{} ctx := context.Background() - res, err := s.Room.Create(ctx) + res, err := s.Metrics.GetCreatorViewership(ctx, request) if err != nil { log.Fatal(err) } - if res.CreateRoomResponse != nil { + if res.Data != nil { // handle response } } diff --git a/docs/models/components/encryption.md b/docs/models/components/encryption.md deleted file mode 100644 index 6fb8768..0000000 --- a/docs/models/components/encryption.md +++ /dev/null @@ -1,8 +0,0 @@ -# Encryption - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `EncryptedKey` | *string* | :heavy_check_mark: | Encryption key used to encrypt the asset. Only writable in the upload asset endpoints and cannot be retrieved back. | \ No newline at end of file diff --git a/docs/models/components/multistreamtargetinput.md b/docs/models/components/multistreamtargetinput.md deleted file mode 100644 index cdfc163..0000000 --- a/docs/models/components/multistreamtargetinput.md +++ /dev/null @@ -1,10 +0,0 @@ -# MultistreamTargetInput - - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `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 diff --git a/docs/models/components/target.md b/docs/models/components/target.md deleted file mode 100644 index 12fc770..0000000 --- a/docs/models/components/target.md +++ /dev/null @@ -1,11 +0,0 @@ -# Target - - -## Fields - -| 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 diff --git a/docs/models/components/webhookinput.md b/docs/models/components/webhookinput.md deleted file mode 100644 index 6306e96..0000000 --- a/docs/models/components/webhookinput.md +++ /dev/null @@ -1,13 +0,0 @@ -# WebhookInput - - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -| `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 diff --git a/docs/sdks/accesscontrol/README.md b/docs/sdks/accesscontrol/README.md index 95ac1f8..0788c0e 100644 --- a/docs/sdks/accesscontrol/README.md +++ b/docs/sdks/accesscontrol/README.md @@ -46,8 +46,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -55,14 +53,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateSigningKeyResponse](../../models/operations/createsigningkeyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAll Retrieves signing keys @@ -94,8 +95,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -103,14 +102,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetSigningKeysResponse](../../models/operations/getsigningkeysresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete Delete Signing Key @@ -142,8 +144,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -152,14 +152,17 @@ func main() { | `keyID` | *string* | :heavy_check_mark: | ID of the signing key | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteSigningKeyResponse](../../models/operations/deletesigningkeyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieves a signing key @@ -191,8 +194,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -201,14 +202,17 @@ func main() { | `keyID` | *string* | :heavy_check_mark: | ID of the signing key | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetSigningKeyResponse](../../models/operations/getsigningkeyresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Update Update a signing key @@ -243,8 +247,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -254,10 +256,12 @@ func main() { | `requestBody` | [operations.UpdateSigningKeyRequestBody](../../models/operations/updatesigningkeyrequestbody.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateSigningKeyResponse](../../models/operations/updatesigningkeyresponse.md), error** + +### Errors + | 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 00e1f67..b3129fc 100644 --- a/docs/sdks/asset/README.md +++ b/docs/sdks/asset/README.md @@ -45,8 +45,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -54,14 +52,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAssetsResponse](../../models/operations/getassetsresponse.md), error** + +### Errors + | 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 @@ -190,8 +191,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -200,14 +199,17 @@ func main() { | `request` | [components.NewAssetPayload](../../models/components/newassetpayload.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.RequestUploadResponse](../../models/operations/requestuploadresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## CreateViaURL Upload asset via URL @@ -266,8 +268,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -276,14 +276,17 @@ func main() { | `request` | [components.NewAssetFromURLPayload](../../models/components/newassetfromurlpayload.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UploadAssetResponse](../../models/operations/uploadassetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieves an asset @@ -315,8 +318,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -325,14 +326,17 @@ func main() { | `assetID` | *string* | :heavy_check_mark: | ID of the asset | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetAssetResponse](../../models/operations/getassetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Update Patch an asset @@ -377,8 +381,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -388,14 +390,17 @@ func main() { | `assetPatchPayload` | [components.AssetPatchPayload](../../models/components/assetpatchpayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateAssetResponse](../../models/operations/updateassetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete Delete an asset @@ -427,8 +432,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -437,10 +440,12 @@ func main() { | `assetID` | *string* | :heavy_check_mark: | ID of the asset | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteAssetResponse](../../models/operations/deleteassetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/livepeer/README.md b/docs/sdks/livepeer/README.md index 4f3e537..808685b 100644 --- a/docs/sdks/livepeer/README.md +++ b/docs/sdks/livepeer/README.md @@ -1,12 +1,7 @@ # Livepeer SDK - ## Overview Livepeer API Reference: Welcome to the Livepeer API reference docs. Here you will find all the endpoints exposed on the standard Livepeer API, learn how to use them and what they return. - - -### Available Operations - diff --git a/docs/sdks/metrics/README.md b/docs/sdks/metrics/README.md index f8b20ee..8b51928 100644 --- a/docs/sdks/metrics/README.md +++ b/docs/sdks/metrics/README.md @@ -46,8 +46,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -58,14 +56,17 @@ func main() { | `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.
| | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetRealtimeViewershipNowResponse](../../models/operations/getrealtimeviewershipnowresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetViewership Requires a private (non-CORS) API key to be used. @@ -99,8 +100,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -109,14 +108,17 @@ func main() { | `request` | [operations.GetViewershipMetricsRequest](../../models/operations/getviewershipmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetViewershipMetricsResponse](../../models/operations/getviewershipmetricsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetCreatorViewership 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). @@ -150,8 +152,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -160,14 +160,17 @@ func main() { | `request` | [operations.GetCreatorViewershipMetricsRequest](../../models/operations/getcreatorviewershipmetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetCreatorViewershipMetricsResponse](../../models/operations/getcreatorviewershipmetricsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetPublicViewership Allows querying for the public metrics for viewership about a video. @@ -202,8 +205,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -212,14 +213,17 @@ func main() { | `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
| | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetPublicViewershipMetricsResponse](../../models/operations/getpublicviewershipmetricsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetUsage Query usage metrics @@ -252,8 +256,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -262,10 +264,12 @@ func main() { | `request` | [operations.GetUsageMetricsRequest](../../models/operations/getusagemetricsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetUsageMetricsResponse](../../models/operations/getusagemetricsresponse.md), error** + +### Errors + | 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 59ce832..cb01b5f 100644 --- a/docs/sdks/multistream/README.md +++ b/docs/sdks/multistream/README.md @@ -44,8 +44,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -53,14 +51,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetMultistreamTargetsResponse](../../models/operations/getmultistreamtargetsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Create Create a multistream target @@ -95,8 +96,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -105,14 +104,17 @@ func main() { | `request` | [components.MultistreamTargetInput](../../models/components/multistreamtargetinput.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateMultistreamTargetResponse](../../models/operations/createmultistreamtargetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieve a multistream target @@ -144,8 +146,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -154,14 +154,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the multistream target | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetMultistreamTargetResponse](../../models/operations/getmultistreamtargetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Update Update Multistream Target @@ -198,8 +201,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -209,14 +210,17 @@ func main() { | `multistreamTargetPatchPayload` | [components.MultistreamTargetPatchPayload](../../models/components/multistreamtargetpatchpayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateMultistreamTargetResponse](../../models/operations/updatemultistreamtargetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete Make sure to remove any references to the target on existing @@ -250,8 +254,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -260,10 +262,12 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the multistream target | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteMultistreamTargetResponse](../../models/operations/deletemultistreamtargetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/playback/README.md b/docs/sdks/playback/README.md index fdaa469..cff23a2 100644 --- a/docs/sdks/playback/README.md +++ b/docs/sdks/playback/README.md @@ -40,8 +40,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -50,10 +48,12 @@ func main() { | `id` | *string* | :heavy_check_mark: | The playback ID from the asset or livestream, e.g. `eaw4nk06ts2d0mzb`. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetPlaybackInfoResponse](../../models/operations/getplaybackinforesponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.Error | 404 | application/json | diff --git a/docs/sdks/room/README.md b/docs/sdks/room/README.md index 9420a07..72bf4f4 100644 --- a/docs/sdks/room/README.md +++ b/docs/sdks/room/README.md @@ -51,8 +51,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -60,14 +58,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateRoomResponse](../../models/operations/createroomresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~Get~~ Retrieve a room @@ -101,8 +102,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -111,14 +110,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetRoomResponse](../../models/operations/getroomresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~Delete~~ Delete a room @@ -152,8 +154,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -162,14 +162,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteRoomResponse](../../models/operations/deleteroomresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~StartEgress~~ Create a livestream for your room. @@ -210,8 +213,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -221,14 +222,17 @@ func main() { | `roomEgressPayload` | [components.RoomEgressPayload](../../models/components/roomegresspayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.StartRoomEgressResponse](../../models/operations/startroomegressresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~StopEgress~~ Stop room RTMP egress @@ -262,8 +266,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -272,14 +274,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.StopRoomEgressResponse](../../models/operations/stoproomegressresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~CreateUser~~ Call this endpoint to add a user to a room, specifying a display name at a minimum. @@ -323,8 +328,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -334,14 +337,17 @@ func main() { | `roomUserPayload` | [components.RoomUserPayload](../../models/components/roomuserpayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateRoomUserResponse](../../models/operations/createroomuserresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~GetUser~~ Get user details @@ -377,8 +383,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -388,14 +392,17 @@ func main() { | `userID` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetRoomUserResponse](../../models/operations/getroomuserresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~UpdateUser~~ Update properties for a user. @@ -437,8 +444,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -449,14 +454,17 @@ func main() { | `roomUserUpdatePayload` | [components.RoomUserUpdatePayload](../../models/components/roomuserupdatepayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateRoomUserResponse](../../models/operations/updateroomuserresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ~~DeleteUser~~ Remove a user from the room @@ -492,8 +500,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -503,10 +509,12 @@ func main() { | `userID` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteRoomUserResponse](../../models/operations/deleteroomuserresponse.md), error** + +### Errors + | 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 31a3b54..c287fea 100644 --- a/docs/sdks/session/README.md +++ b/docs/sdks/session/README.md @@ -43,8 +43,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -53,14 +51,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the parent session | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetSessionClipsResponse](../../models/operations/getsessionclipsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAll Retrieve sessions @@ -92,8 +93,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -101,14 +100,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetSessionsResponse](../../models/operations/getsessionsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieve a session @@ -140,8 +142,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -150,14 +150,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the session | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetSessionResponse](../../models/operations/getsessionresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetRecorded Retrieve Recorded Sessions @@ -194,8 +197,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | Example | @@ -205,10 +206,12 @@ func main() { | `record` | [*operations.Record](../../models/operations/record.md) | :heavy_minus_sign: | Flag indicating if the response should only include recorded
sessions
| true | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | | - ### Response **[*operations.GetRecordedSessionsResponse](../../models/operations/getrecordedsessionsresponse.md), error** + +### Errors + | 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 5f25009..6d0408a 100644 --- a/docs/sdks/stream/README.md +++ b/docs/sdks/stream/README.md @@ -127,8 +127,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -137,14 +135,17 @@ func main() { | `request` | [components.NewStreamPayload](../../models/components/newstreampayload.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateStreamResponse](../../models/operations/createstreamresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetAll Retrieve streams @@ -176,8 +177,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -186,14 +185,17 @@ func main() { | `streamsonly` | **string* | :heavy_minus_sign: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetStreamsResponse](../../models/operations/getstreamsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieve a stream @@ -225,8 +227,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -235,14 +235,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the stream | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetStreamResponse](../../models/operations/getstreamresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Update Update a stream @@ -329,8 +332,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -340,14 +341,17 @@ func main() { | `streamPatchPayload` | [components.StreamPatchPayload](../../models/components/streampatchpayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateStreamResponse](../../models/operations/updatestreamresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete This will also suspend any active stream sessions, so make sure to wait @@ -383,8 +387,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -393,14 +395,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the stream | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteStreamResponse](../../models/operations/deletestreamresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Terminate `DELETE /stream/{id}/terminate` can be used to terminate an ongoing @@ -440,8 +445,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -450,14 +453,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the stream | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.TerminateStreamResponse](../../models/operations/terminatestreamresponse.md), error** + +### Errors + | 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 @@ -496,8 +502,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -506,14 +510,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the stream | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.StartPullStreamResponse](../../models/operations/startpullstreamresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## CreateClip Create a clip @@ -552,8 +559,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -562,14 +567,17 @@ func main() { | `request` | [components.ClipPayload](../../models/components/clippayload.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateClipResponse](../../models/operations/createclipresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetClips Retrieve clips of a livestream @@ -601,8 +609,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -611,14 +617,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | ID of the parent stream or playbackId of parent stream | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetClipsResponse](../../models/operations/getclipsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## AddMultistreamTarget Add a multistream target @@ -661,8 +670,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -672,14 +679,17 @@ func main() { | `targetAddPayload` | [components.TargetAddPayload](../../models/components/targetaddpayload.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.AddMultistreamTargetResponse](../../models/operations/addmultistreamtargetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## RemoveMultistreamTarget Remove a multistream target @@ -713,8 +723,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -724,10 +732,12 @@ func main() { | `targetID` | *string* | :heavy_check_mark: | ID of the multistream target | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.RemoveMultistreamTargetResponse](../../models/operations/removemultistreamtargetresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/task/README.md b/docs/sdks/task/README.md index 5b675ff..758dac6 100644 --- a/docs/sdks/task/README.md +++ b/docs/sdks/task/README.md @@ -41,8 +41,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -50,14 +48,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetTasksResponse](../../models/operations/gettasksresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieve a Task @@ -89,8 +90,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -99,10 +98,12 @@ func main() { | `taskID` | *string* | :heavy_check_mark: | ID of the task | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetTaskResponse](../../models/operations/gettaskresponse.md), error** + +### Errors + | 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 f5c146d..4862685 100644 --- a/docs/sdks/transcode/README.md +++ b/docs/sdks/transcode/README.md @@ -204,8 +204,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -214,10 +212,12 @@ func main() { | `request` | [components.TranscodePayload](../../models/components/transcodepayload.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.TranscodeVideoResponse](../../models/operations/transcodevideoresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/webhook/README.md b/docs/sdks/webhook/README.md index 5cd0c31..8d6c429 100644 --- a/docs/sdks/webhook/README.md +++ b/docs/sdks/webhook/README.md @@ -47,8 +47,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -56,14 +54,17 @@ func main() { | `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetWebhooksResponse](../../models/operations/getwebhooksresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Create To create a new webhook, you need to make an API call with the events you want to listen for and the URL that will be called when those events occur. @@ -107,8 +108,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -117,14 +116,17 @@ func main() { | `request` | [components.WebhookInput](../../models/components/webhookinput.md) | :heavy_check_mark: | The request object to use for the request. | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.CreateWebhookResponse](../../models/operations/createwebhookresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Get Retrieve a webhook @@ -156,8 +158,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -166,14 +166,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetWebhookResponse](../../models/operations/getwebhookresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Update Update a webhook @@ -218,8 +221,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -229,14 +230,17 @@ func main() { | `webhook` | [components.WebhookInput](../../models/components/webhookinput.md) | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.UpdateWebhookResponse](../../models/operations/updatewebhookresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## Delete Delete a webhook @@ -268,8 +272,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -278,14 +280,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.DeleteWebhookResponse](../../models/operations/deletewebhookresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetLogs Retrieve webhook logs @@ -317,8 +322,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -327,14 +330,17 @@ func main() { | `id` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetWebhookLogsResponse](../../models/operations/getwebhooklogsresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## GetLog Retrieve a webhook log @@ -368,8 +374,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -379,14 +383,17 @@ func main() { | `logID` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.GetWebhookLogResponse](../../models/operations/getwebhooklogresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | + ## ResendLog Use this API to resend the same webhook request. This is useful when @@ -423,8 +430,6 @@ func main() { } ``` - - ### Parameters | Parameter | Type | Required | Description | @@ -434,10 +439,12 @@ func main() { | `logID` | *string* | :heavy_check_mark: | N/A | | `opts` | [][operations.Option](../../models/operations/option.md) | :heavy_minus_sign: | The options for this request. | - ### Response **[*operations.ResendWebhookResponse](../../models/operations/resendwebhookresponse.md), error** + +### Errors + | Error Object | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | | sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/internal/utils/requestbody.go b/internal/utils/requestbody.go index 0fd33cf..cee9da2 100644 --- a/internal/utils/requestbody.go +++ b/internal/utils/requestbody.go @@ -82,7 +82,7 @@ func serializeRequestBody(request interface{}, nullable, optional bool, requestF return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], reflect.ValueOf(request), tag) } -func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (*bytes.Buffer, string, error) { +func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (io.Reader, string, error) { buf := &bytes.Buffer{} if isNil(val.Type(), val) { @@ -116,6 +116,8 @@ func serializeContentType(fieldName string, mediaType string, val reflect.Value, if err := encodeFormData(fieldName, buf, val.Interface()); err != nil { return nil, "", err } + case val.Type().Implements(reflect.TypeOf((*io.Reader)(nil)).Elem()): + return val.Interface().(io.Reader), mediaType, nil default: val = reflect.Indirect(val) @@ -124,8 +126,8 @@ func serializeContentType(fieldName string, mediaType string, val reflect.Value, if _, err := buf.WriteString(valToString(val.Interface())); err != nil { return nil, "", err } - case val.Type() == reflect.TypeOf([]byte(nil)): - if _, err := buf.Write(val.Bytes()); err != nil { + case reflect.TypeOf(val.Interface()) == reflect.TypeOf([]byte(nil)): + if _, err := buf.Write(val.Interface().([]byte)); err != nil { return nil, "", err } default: @@ -215,7 +217,7 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va var fieldName string var fileName string - var content []byte + var reader io.Reader for i := 0; i < fieldType.NumField(); i++ { field := fieldType.Field(i) @@ -226,15 +228,19 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va continue } - if tag.Content { - content = val.Bytes() + if tag.Content && val.CanInterface() { + if reflect.TypeOf(val.Interface()) == reflect.TypeOf([]byte(nil)) { + reader = bytes.NewReader(val.Interface().([]byte)) + } else if reflect.TypeOf(val.Interface()).Implements(reflect.TypeOf((*io.Reader)(nil)).Elem()) { + reader = val.Interface().(io.Reader) + } } else { fieldName = tag.Name fileName = val.String() } } - if fieldName == "" || fileName == "" || content == nil { + if fieldName == "" || fileName == "" || reader == nil { return fmt.Errorf("invalid multipart/form-data file") } @@ -242,7 +248,7 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va if err != nil { return err } - if _, err := fw.Write(content); err != nil { + if _, err := io.Copy(fw, reader); err != nil { return err } diff --git a/livepeer.go b/livepeer.go index 261db02..1f8fdab 100644 --- a/livepeer.go +++ b/livepeer.go @@ -168,9 +168,9 @@ func New(opts ...SDKOption) *Livepeer { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.3.0", - GenVersion: "2.396.0", - UserAgent: "speakeasy-sdk/go 0.3.0 2.396.0 1.0.0 github.com/livepeer/livepeer-go", + SDKVersion: "0.3.1", + GenVersion: "2.404.1", + UserAgent: "speakeasy-sdk/go 0.3.1 2.404.1 1.0.0 github.com/livepeer/livepeer-go", Hooks: hooks.New(), }, }