From ce5e47905522211b48582376772e21a5985bde17 Mon Sep 17 00:00:00 2001 From: Chase Adams Date: Tue, 21 May 2024 11:32:06 -0700 Subject: [PATCH] fix: update schema --- .speakeasy/gen.lock | 28 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- codeSamples.yaml | 328 +++++++-------- docs/models/components/asset.md | 2 +- docs/models/components/assetinput.md | 17 - docs/models/components/assetipfsinput.md | 10 - docs/models/components/assetsource.md | 23 -- docs/models/components/assetsource1.md | 11 - docs/models/components/assetsource3.md | 14 - docs/models/components/assetstorageinput.md | 8 - docs/models/components/ipfsfileinfoinput.md | 8 - docs/models/components/newassetpayload.md | 1 - docs/models/components/playbackpolicy.md | 13 +- docs/models/components/source1.md | 12 +- docs/models/components/source3.md | 18 +- docs/sdks/asset/README.md | 32 -- livepeer.go | 4 +- models/components/asset.go | 425 +++----------------- models/components/ipfsfileinfoinput.go | 15 - models/components/newassetpayload.go | 10 +- models/components/playbackpolicy.go | 9 + 22 files changed, 270 insertions(+), 730 deletions(-) delete mode 100644 docs/models/components/assetinput.md delete mode 100644 docs/models/components/assetipfsinput.md delete mode 100644 docs/models/components/assetsource.md delete mode 100644 docs/models/components/assetsource1.md delete mode 100644 docs/models/components/assetsource3.md delete mode 100644 docs/models/components/assetstorageinput.md delete mode 100644 docs/models/components/ipfsfileinfoinput.md delete mode 100644 models/components/ipfsfileinfoinput.go diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 97fddeb..86c6ba3 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: ed7f9c3c7ce4cdc8b3524a59c596ef0b + docChecksum: b10c6d403306684b2080504dd2e51041 docVersion: 1.0.0 - speakeasyVersion: 1.293.1 + speakeasyVersion: 1.294.0 generationVersion: 2.333.3 - releaseVersion: 0.1.7 - configChecksum: 4d1ec1d46b5cf1b0bd02ab07e4b2888c + releaseVersion: 0.1.8 + configChecksum: c447794e0f02be0d212976dba63ed400 features: go: additionalDependencies: 0.1.0 @@ -126,6 +126,7 @@ generatedFiles: - /models/components/inputcreatorid.go - /models/components/pull.go - /models/components/streampatchpayload.go + - /models/components/asset.go - /models/components/storagestatus.go - /models/components/ipfsfileinfo.go - /models/components/encryptionoutput.go @@ -139,10 +140,8 @@ generatedFiles: - /models/components/newassetpayload.go - /models/components/transcodeprofile.go - /models/components/spec.go - - /models/components/asset.go - - /models/components/ipfsfileinfoinput.go - - /models/components/encryption.go - /models/components/newassetfromurlpayload.go + - /models/components/encryption.go - /models/components/storage.go - /models/components/assetpatchpayload.go - /models/components/session.go @@ -316,12 +315,12 @@ generatedFiles: - docs/models/components/streampatchpayload.md - docs/models/components/assettype.md - docs/models/components/assetsource3type.md - - docs/models/components/assetsource3.md + - docs/models/components/source3.md - docs/models/components/assetsourcetype.md - docs/models/components/two.md - docs/models/components/sourcetype.md - - docs/models/components/assetsource1.md - - docs/models/components/assetsource.md + - docs/models/components/source1.md + - docs/models/components/source.md - docs/models/components/assetnftmetadatatemplate.md - docs/models/components/assetnftmetadata.md - docs/models/components/assetspec.md @@ -364,15 +363,8 @@ generatedFiles: - docs/models/components/nftmetadatatemplate.md - docs/models/components/nftmetadata.md - docs/models/components/spec.md - - docs/models/components/source3.md - - docs/models/components/source1.md - - docs/models/components/source.md - - docs/models/components/assetipfsinput.md - - docs/models/components/assetstorageinput.md - - docs/models/components/assetinput.md - - docs/models/components/ipfsfileinfoinput.md - - docs/models/components/encryption.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 6a81d13..b814e68 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true go: - version: 0.1.7 + version: 0.1.8 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index bc69990..1716849 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,17 +1,17 @@ -speakeasyVersion: 1.293.1 +speakeasyVersion: 1.294.0 sources: livepeer-studio-api: sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:ed3a24e70cf74aa7ed881aa3d73cb267e0647fefc279963105662a9aa2bb5864 - sourceBlobDigest: sha256:461dbcf221bde4fa18927d27b9fea500bcae05cdbee9daccfb251e4428f29675 + sourceRevisionDigest: sha256:5d028ab2dbf42e76cdd6e3cdf7bfcd2904494da0d52f7ad1c1c4fbc349df886d + sourceBlobDigest: sha256:958ae7f3a7e7f591357a9efa6b0151703d354eecffe92ae352c6da31ec3ac238 tags: - latest targets: livepeer-go: source: livepeer-studio-api sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:ed3a24e70cf74aa7ed881aa3d73cb267e0647fefc279963105662a9aa2bb5864 - sourceBlobDigest: sha256:461dbcf221bde4fa18927d27b9fea500bcae05cdbee9daccfb251e4428f29675 + sourceRevisionDigest: sha256:5d028ab2dbf42e76cdd6e3cdf7bfcd2904494da0d52f7ad1c1c4fbc349df886d + sourceBlobDigest: sha256:958ae7f3a7e7f591357a9efa6b0151703d354eecffe92ae352c6da31ec3ac238 outLocation: /Users/chase/git/livepeer/livepeer-go workflow: workflowVersion: 1.0.0 diff --git a/codeSamples.yaml b/codeSamples.yaml index e9d70ec..f3aa4a7 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,339 +3,339 @@ info: title: CodeSamples overlay for go target version: 0.0.0 actions: - - target: $["paths"]["/access-control/signing-key"]["post"] + - target: $["paths"]["/room/{id}/egress"]["delete"] update: x-codeSamples: - lang: go - label: createSigningKey - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.Create(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.SigningKey != nil {\n // handle response\n }\n}" - - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] + label: stopRoomEgress + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.StopEgress(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] update: x-codeSamples: - lang: go - label: getSigningKey - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var keyID string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, keyID)\n if err != nil {\n log.Fatal(err)\n }\n if res.SigningKey != nil {\n // handle response\n }\n}" - - target: $["paths"]["/task/{taskId}"]["get"] + label: removeMultistreamTarget + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var targetID string = \"\"\n \n ctx := context.Background()\n res, err := s.RemoveMultistreamTarget(ctx, id, targetID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream"]["get"] update: x-codeSamples: - lang: go - label: getTask - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var taskID string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, taskID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Task != nil {\n // handle response\n }\n}" - - target: $["paths"]["/data/views/query"]["get"] + label: getStreams + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var streamsonly *string = livepeergo.String(\"\")\n \n ctx := context.Background()\n res, err := s.GetAll(ctx, streamsonly)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}/clips"]["get"] update: x-codeSamples: - lang: go - label: getViewershipMetrics - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := operations.GetViewershipMetricsRequest{}\n \n ctx := context.Background()\n res, err := s.GetViewership(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/multistream/target/{id}"]["patch"] + label: getClips + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.GetClips(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/asset"]["get"] update: x-codeSamples: - lang: go - label: updateMultistreamTarget - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, id, multistreamTargetPatchPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/asset/request-upload"]["post"] + label: getAssets + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/session/{id}/clips"]["get"] update: x-codeSamples: - lang: go - label: requestUpload - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.NewAssetPayload{\n Name: \"filename.mp4\",\n ProjectID: &components.AssetInput{\n Type: components.AssetTypeVideo.ToPointer(),\n PlaybackID: livepeergo.String(\"eaw4nk06ts2d0mzb\"),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Source: components.CreateSourceTwo(\n components.Two{\n Type: components.AssetSourceTypeRecording,\n SessionID: \"\",\n },\n ),\n CreatorID: components.CreateCreatorIDCreatorID1(\n components.CreatorID1{\n Type: components.CreatorIDTypeUnverified,\n Value: \"user123\",\n },\n ),\n Name: \"filename.mp4\",\n ProjectID: livepeergo.String(\"aac12556-4d65-4d34-9fb6-d1f0985eb0a9\"),\n Hash: []components.Hash{\n components.Hash{\n Hash: livepeergo.String(\"9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57\"),\n Algorithm: livepeergo.String(\"sha256\"),\n },\n },\n },\n StaticMp4: livepeergo.Bool(true),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}/user/{userId}"]["put"] + label: getSessionClips + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.GetClips(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/access-control/signing-key"]["post"] update: x-codeSamples: - lang: go - label: updateRoomUser - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var userID string = \"\"\n\n roomUserUpdatePayload := components.RoomUserUpdatePayload{\n CanPublish: livepeergo.Bool(true),\n CanPublishData: livepeergo.Bool(true),\n }\n \n ctx := context.Background()\n res, err := s.UpdateUser(ctx, id, userID, roomUserUpdatePayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/task"]["get"] + label: createSigningKey + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.Create(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.SigningKey != nil {\n // handle response\n }\n}" + - target: $["paths"]["/session"]["get"] update: x-codeSamples: - lang: go - label: getTasks + label: getSessions source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/multistream/target/{id}"]["get"] + - target: $["paths"]["/room/{id}/user"]["post"] update: x-codeSamples: - lang: go - label: getMultistreamTarget - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.MultistreamTarget != nil {\n // handle response\n }\n}" - - target: $["paths"]["/asset/{assetId}"]["patch"] + label: createRoomUser + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n roomUserPayload := components.RoomUserPayload{\n Name: \"name\",\n CanPublish: livepeergo.Bool(true),\n CanPublishData: livepeergo.Bool(true),\n }\n \n ctx := context.Background()\n res, err := s.CreateUser(ctx, id, roomUserPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res.RoomUserResponse != nil {\n // handle response\n }\n}" + - target: $["paths"]["/room/{id}/user/{userId}"]["get"] update: x-codeSamples: - lang: go - label: updateAsset - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var assetID string = \"\"\n\n assetPatchPayload := components.AssetPatchPayload{\n Name: livepeergo.String(\"filename.mp4\"),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, assetID, assetPatchPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res.Asset != nil {\n // handle response\n }\n}" - - target: $["paths"]["/clip"]["post"] + label: getRoomUser + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var userID string = \"\"\n \n ctx := context.Background()\n res, err := s.GetUser(ctx, id, userID)\n if err != nil {\n log.Fatal(err)\n }\n if res.GetRoomUserResponse != nil {\n // handle response\n }\n}" + - target: $["paths"]["/data/usage/query"]["get"] update: x-codeSamples: - lang: go - label: createClip - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.ClipPayload{\n PlaybackID: \"eaw4nk06ts2d0mzb\",\n StartTime: 1587667174725,\n EndTime: livepeergo.Float64(1587667174725),\n Name: livepeergo.String(\"My Clip\"),\n SessionID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n }\n \n ctx := context.Background()\n res, err := s.CreateClip(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] + label: getUsageMetrics + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := operations.GetUsageMetricsRequest{}\n \n ctx := context.Background()\n res, err := s.GetUsage(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.UsageMetric != nil {\n // handle response\n }\n}" + - target: $["paths"]["/data/views/query"]["get"] update: x-codeSamples: - lang: go - label: updateSigningKey - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var keyID string = \"\"\n\n requestBody := operations.UpdateSigningKeyRequestBody{}\n \n ctx := context.Background()\n res, err := s.Update(ctx, keyID, requestBody)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream"]["get"] + label: getViewershipMetrics + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := operations.GetViewershipMetricsRequest{}\n \n ctx := context.Background()\n res, err := s.GetViewership(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] update: x-codeSamples: - lang: go - label: getStreams - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var streamsonly *string = livepeergo.String(\"\")\n \n ctx := context.Background()\n res, err := s.GetAll(ctx, streamsonly)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}/clips"]["get"] + label: getSigningKey + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var keyID string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, keyID)\n if err != nil {\n log.Fatal(err)\n }\n if res.SigningKey != nil {\n // handle response\n }\n}" + - target: $["paths"]["/transcode"]["post"] update: x-codeSamples: - lang: go - label: getClips - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.GetClips(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook/{id}"]["get"] + label: transcodeVideo + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.TranscodePayload{\n Input: components.CreateInputInput1(\n components.Input1{\n URL: \"https://s3.amazonaws.com/bucket/file.mp4\",\n },\n ),\n Storage: components.CreateTranscodePayloadStorageStorage1(\n components.Storage1{\n Type: components.StorageTypeS3,\n Endpoint: \"https://gateway.storjshare.io\",\n Bucket: \"outputbucket\",\n Credentials: components.StorageCredentials{\n AccessKeyID: \"AKIAIOSFODNN7EXAMPLE\",\n SecretAccessKey: \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n },\n },\n ),\n Outputs: components.Outputs{\n Hls: &components.Hls{\n Path: \"/samplevideo/hls\",\n },\n Mp4: &components.Mp4{\n Path: \"/samplevideo/mp4\",\n },\n Fmp4: &components.Fmp4{\n Path: \"/samplevideo/fmp4\",\n },\n },\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Task != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream"]["post"] update: x-codeSamples: - lang: go - label: getWebhook - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{parentId}/sessions"]["get"] + label: createStream + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.NewStreamPayload{\n Name: \"test_stream\",\n Pull: &components.Pull{\n Source: \"https://myservice.com/live/stream.flv\",\n Headers: map[string]string{\n \"Authorization\": \"Bearer 123\",\n },\n Location: &components.Location{\n Lat: 39.739,\n Lon: -104.988,\n },\n },\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.FfmpegProfile{\n components.FfmpegProfile{\n Width: 1280,\n Name: \"720p\",\n Height: 486589,\n Bitrate: 3000000,\n Fps: 30,\n FpsDen: livepeergo.Int64(1),\n Quality: livepeergo.Int64(23),\n Gop: livepeergo.String(\"2\"),\n Profile: components.ProfileH264Baseline.ToPointer(),\n },\n },\n Record: livepeergo.Bool(false),\n Multistream: &components.Multistream{\n Targets: []components.Target{\n components.Target{\n Profile: \"720p\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Stream != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}"]["patch"] update: x-codeSamples: - lang: go - label: getRecordedSessions - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var parentID string = \"\"\n\n var record *int64 = livepeergo.Int64(1)\n \n ctx := context.Background()\n res, err := s.GetRecorded(ctx, parentID, record)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room"]["post"] + label: updateStream + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n streamPatchPayload := components.StreamPatchPayload{\n Record: livepeergo.Bool(false),\n Multistream: &components.Multistream{\n Targets: []components.Target{\n components.Target{\n Profile: \"720p\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n },\n },\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.FfmpegProfile{\n components.FfmpegProfile{\n Width: 1280,\n Name: \"720p\",\n Height: 857478,\n Bitrate: 3000000,\n Fps: 30,\n FpsDen: livepeergo.Int64(1),\n Quality: livepeergo.Int64(23),\n Gop: livepeergo.String(\"2\"),\n Profile: components.ProfileH264Baseline.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, id, streamPatchPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/multistream/target"]["get"] update: x-codeSamples: - lang: go - label: createRoom - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.Create(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.CreateRoomResponse != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}/egress"]["delete"] + label: getMultistreamTargets + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/room"]["post"] update: x-codeSamples: - lang: go - label: stopRoomEgress - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.StopEgress(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] + label: createRoom + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.Create(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.CreateRoomResponse != nil {\n // handle response\n }\n}" + - target: $["paths"]["/task"]["get"] update: x-codeSamples: - lang: go - label: deleteSigningKey - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var keyID string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, keyID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}/start-pull"]["post"] + label: getTasks + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] update: x-codeSamples: - lang: go - label: startPullStream - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.StartPull(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] + label: addMultistreamTarget + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n targetAddPayload := components.TargetAddPayload{\n Profile: \"720p0\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetAddPayloadSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n }\n \n ctx := context.Background()\n res, err := s.AddMultistreamTarget(ctx, id, targetAddPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/multistream/target/{id}"]["delete"] update: x-codeSamples: - lang: go - label: deleteRoomUser - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var userID string = \"\"\n \n ctx := context.Background()\n res, err := s.DeleteUser(ctx, id, userID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] + label: deleteMultistreamTarget + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] update: x-codeSamples: - lang: go - label: removeMultistreamTarget - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var targetID string = \"\"\n \n ctx := context.Background()\n res, err := s.RemoveMultistreamTarget(ctx, id, targetID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/multistream/target"]["post"] + label: getWebhookLog + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var logID string = \"\"\n \n ctx := context.Background()\n res, err := s.GetLog(ctx, id, logID)\n if err != nil {\n log.Fatal(err)\n }\n if res.WebhookLog != nil {\n // handle response\n }\n}" + - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] update: x-codeSamples: - lang: go - label: createMultistreamTarget - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.MultistreamTargetInput{\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.MultistreamTarget != nil {\n // handle response\n }\n}" - - target: $["paths"]["/data/views/query/creator"]["get"] + label: deleteSigningKey + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var keyID string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, keyID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/asset/request-upload"]["post"] update: x-codeSamples: - lang: go - label: getCreatorViewershipMetrics - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := operations.GetCreatorViewershipMetricsRequest{}\n \n ctx := context.Background()\n res, err := s.GetCreatorViewership(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] + label: requestUpload + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.NewAssetPayload{\n Name: \"filename.mp4\",\n StaticMp4: livepeergo.Bool(true),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{parentId}/sessions"]["get"] update: x-codeSamples: - lang: go - label: getPublicViewershipMetrics - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var playbackID string = \"\"\n \n ctx := context.Background()\n res, err := s.GetPublicViewership(ctx, playbackID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] + label: getRecordedSessions + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var parentID string = \"\"\n\n var record *int64 = livepeergo.Int64(1)\n \n ctx := context.Background()\n res, err := s.GetRecorded(ctx, parentID, record)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/room/{id}"]["delete"] update: x-codeSamples: - lang: go - label: addMultistreamTarget - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n targetAddPayload := components.TargetAddPayload{\n Profile: \"720p0\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetAddPayloadSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n }\n \n ctx := context.Background()\n res, err := s.AddMultistreamTarget(ctx, id, targetAddPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook"]["post"] + label: deleteRoom + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook/{id}"]["get"] update: x-codeSamples: - lang: go - label: createWebhook - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.WebhookInput{\n Name: \"test_webhook\",\n Events: []components.Events{\n components.EventsStreamStarted,\n components.EventsStreamIdle,\n },\n URL: \"https://my-service.com/webhook\",\n SharedSecret: livepeergo.String(\"my-secret\"),\n StreamID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] + label: getWebhook + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" + - target: $["paths"]["/room/{id}/egress"]["post"] update: x-codeSamples: - lang: go - label: getWebhookLog - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var logID string = \"\"\n \n ctx := context.Background()\n res, err := s.GetLog(ctx, id, logID)\n if err != nil {\n log.Fatal(err)\n }\n if res.WebhookLog != nil {\n // handle response\n }\n}" - - target: $["paths"]["/session/{id}"]["get"] + label: startRoomEgress + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n roomEgressPayload := components.RoomEgressPayload{\n StreamID: \"aac12556-4d65-4d34-9fb6-d1f0985eb0a9\",\n }\n \n ctx := context.Background()\n res, err := s.StartEgress(ctx, id, roomEgressPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/multistream/target"]["post"] update: x-codeSamples: - lang: go - label: getSession - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Session != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}"]["patch"] + label: createMultistreamTarget + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.MultistreamTargetInput{\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.MultistreamTarget != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook/{id}"]["put"] update: x-codeSamples: - lang: go - label: updateStream - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n streamPatchPayload := components.StreamPatchPayload{\n Record: livepeergo.Bool(false),\n Multistream: &components.Multistream{\n Targets: []components.Target{\n components.Target{\n Profile: \"720p\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n },\n },\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.FfmpegProfile{\n components.FfmpegProfile{\n Width: 1280,\n Name: \"720p\",\n Height: 857478,\n Bitrate: 3000000,\n Fps: 30,\n FpsDen: livepeergo.Int64(1),\n Quality: livepeergo.Int64(23),\n Gop: livepeergo.String(\"2\"),\n Profile: components.ProfileH264Baseline.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, id, streamPatchPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/asset/{assetId}"]["delete"] + label: updateWebhook + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n webhook := components.WebhookInput{\n Name: \"test_webhook\",\n Events: []components.Events{\n components.EventsStreamStarted,\n components.EventsStreamIdle,\n },\n URL: \"https://my-service.com/webhook\",\n SharedSecret: livepeergo.String(\"my-secret\"),\n StreamID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, id, webhook)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" + - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] update: x-codeSamples: - lang: go - label: deleteAsset - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var assetID string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, assetID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}"]["delete"] + label: getPublicViewershipMetrics + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var playbackID string = \"\"\n \n ctx := context.Background()\n res, err := s.GetPublicViewership(ctx, playbackID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/access-control/signing-key"]["get"] update: x-codeSamples: - lang: go - label: deleteRoom - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}/egress"]["post"] + label: getSigningKeys + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/asset/{assetId}"]["delete"] update: x-codeSamples: - lang: go - label: startRoomEgress - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n roomEgressPayload := components.RoomEgressPayload{\n StreamID: \"aac12556-4d65-4d34-9fb6-d1f0985eb0a9\",\n }\n \n ctx := context.Background()\n res, err := s.StartEgress(ctx, id, roomEgressPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/asset/upload/url"]["post"] + label: deleteAsset + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var assetID string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, assetID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/multistream/target/{id}"]["patch"] update: x-codeSamples: - lang: go - label: uploadAsset - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.NewAssetFromURLPayload{\n Name: \"filename.mp4\",\n StaticMp4: livepeergo.Bool(true),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n URL: \"https://s3.amazonaws.com/my-bucket/path/filename.mp4\",\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.CreateViaURL(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONData != nil {\n // handle response\n }\n}" - - target: $["paths"]["/session/{id}/clips"]["get"] + label: updateMultistreamTarget + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n multistreamTargetPatchPayload := components.MultistreamTargetPatchPayload{\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, id, multistreamTargetPatchPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook"]["post"] update: x-codeSamples: - lang: go - label: getSessionClips - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.GetClips(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/session"]["get"] + label: createWebhook + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.WebhookInput{\n Name: \"test_webhook\",\n Events: []components.Events{\n components.EventsStreamStarted,\n components.EventsStreamIdle,\n },\n URL: \"https://my-service.com/webhook\",\n SharedSecret: livepeergo.String(\"my-secret\"),\n StreamID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook/{id}/log"]["get"] update: x-codeSamples: - lang: go - label: getSessions - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/data/usage/query"]["get"] + label: getWebhookLogs + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.GetLogs(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] update: x-codeSamples: - lang: go - label: getUsageMetrics - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := operations.GetUsageMetricsRequest{}\n \n ctx := context.Background()\n res, err := s.GetUsage(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.UsageMetric != nil {\n // handle response\n }\n}" + label: resendWebhook + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var logID string = \"\"\n \n ctx := context.Background()\n res, err := s.ResendLog(ctx, id, logID)\n if err != nil {\n log.Fatal(err)\n }\n if res.WebhookLog != nil {\n // handle response\n }\n}" - target: $["paths"]["/playback/{id}"]["get"] update: x-codeSamples: - lang: go label: getPlaybackInfo source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.PlaybackInfo != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] - update: - x-codeSamples: - - lang: go - label: resendWebhook - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var logID string = \"\"\n \n ctx := context.Background()\n res, err := s.ResendLog(ctx, id, logID)\n if err != nil {\n log.Fatal(err)\n }\n if res.WebhookLog != nil {\n // handle response\n }\n}" - target: $["paths"]["/stream/{id}"]["delete"] update: x-codeSamples: - lang: go label: deleteStream source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/multistream/target"]["get"] + - target: $["paths"]["/room/{id}/user/{userId}"]["put"] update: x-codeSamples: - lang: go - label: getMultistreamTargets - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/multistream/target/{id}"]["delete"] + label: updateRoomUser + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var userID string = \"\"\n\n roomUserUpdatePayload := components.RoomUserUpdatePayload{\n CanPublish: livepeergo.Bool(true),\n CanPublishData: livepeergo.Bool(true),\n }\n \n ctx := context.Background()\n res, err := s.UpdateUser(ctx, id, userID, roomUserUpdatePayload)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/data/views/query/creator"]["get"] update: x-codeSamples: - lang: go - label: deleteMultistreamTarget - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/asset"]["get"] + label: getCreatorViewershipMetrics + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := operations.GetCreatorViewershipMetricsRequest{}\n \n ctx := context.Background()\n res, err := s.GetCreatorViewership(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] update: x-codeSamples: - lang: go - label: getAssets - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}/user"]["post"] + label: updateSigningKey + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/operations\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var keyID string = \"\"\n\n requestBody := operations.UpdateSigningKeyRequestBody{}\n \n ctx := context.Background()\n res, err := s.Update(ctx, keyID, requestBody)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}"]["get"] update: x-codeSamples: - lang: go - label: createRoomUser - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n roomUserPayload := components.RoomUserPayload{\n Name: \"name\",\n CanPublish: livepeergo.Bool(true),\n CanPublishData: livepeergo.Bool(true),\n }\n \n ctx := context.Background()\n res, err := s.CreateUser(ctx, id, roomUserPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res.RoomUserResponse != nil {\n // handle response\n }\n}" - - target: $["paths"]["/transcode"]["post"] + label: getStream + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Stream != nil {\n // handle response\n }\n}" + - target: $["paths"]["/asset/upload/url"]["post"] update: x-codeSamples: - lang: go - label: transcodeVideo - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.TranscodePayload{\n Input: components.CreateInputInput1(\n components.Input1{\n URL: \"https://s3.amazonaws.com/bucket/file.mp4\",\n },\n ),\n Storage: components.CreateTranscodePayloadStorageStorage1(\n components.Storage1{\n Type: components.StorageTypeS3,\n Endpoint: \"https://gateway.storjshare.io\",\n Bucket: \"outputbucket\",\n Credentials: components.StorageCredentials{\n AccessKeyID: \"AKIAIOSFODNN7EXAMPLE\",\n SecretAccessKey: \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n },\n },\n ),\n Outputs: components.Outputs{\n Hls: &components.Hls{\n Path: \"/samplevideo/hls\",\n },\n Mp4: &components.Mp4{\n Path: \"/samplevideo/mp4\",\n },\n Fmp4: &components.Fmp4{\n Path: \"/samplevideo/fmp4\",\n },\n },\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Task != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}"]["get"] + label: uploadAsset + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.NewAssetFromURLPayload{\n Name: \"filename.mp4\",\n StaticMp4: livepeergo.Bool(true),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n URL: \"https://s3.amazonaws.com/my-bucket/path/filename.mp4\",\n Profiles: []components.TranscodeProfile{\n components.TranscodeProfile{\n Width: livepeergo.Int64(1280),\n Name: livepeergo.String(\"720p\"),\n Bitrate: 3000000,\n Quality: livepeergo.Int64(23),\n Fps: livepeergo.Int64(30),\n FpsDen: livepeergo.Int64(1),\n Gop: livepeergo.String(\"2\"),\n Profile: components.TranscodeProfileProfileH264Baseline.ToPointer(),\n Encoder: components.TranscodeProfileEncoderH264.ToPointer(),\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.CreateViaURL(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.TwoHundredApplicationJSONData != nil {\n // handle response\n }\n}" + - target: $["paths"]["/clip"]["post"] update: x-codeSamples: - lang: go - label: getStream - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Stream != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream/{id}/terminate"]["delete"] + label: createClip + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.ClipPayload{\n PlaybackID: \"eaw4nk06ts2d0mzb\",\n StartTime: 1587667174725,\n EndTime: livepeergo.Float64(1587667174725),\n Name: livepeergo.String(\"My Clip\"),\n SessionID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n }\n \n ctx := context.Background()\n res, err := s.CreateClip(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" + - target: $["paths"]["/asset/{assetId}"]["patch"] update: x-codeSamples: - lang: go - label: terminateStream - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Terminate(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook"]["get"] + label: updateAsset + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var assetID string = \"\"\n\n assetPatchPayload := components.AssetPatchPayload{\n Name: livepeergo.String(\"filename.mp4\"),\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, assetID, assetPatchPayload)\n if err != nil {\n log.Fatal(err)\n }\n if res.Asset != nil {\n // handle response\n }\n}" + - target: $["paths"]["/room/{id}"]["get"] update: x-codeSamples: - lang: go - label: getWebhooks - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/asset/{assetId}"]["get"] + label: getRoom + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Room != nil {\n // handle response\n }\n}" + - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] update: x-codeSamples: - lang: go - label: getAsset - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var assetID string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, assetID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Asset != nil {\n // handle response\n }\n}" - - target: $["paths"]["/stream"]["post"] + label: deleteRoomUser + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var userID string = \"\"\n \n ctx := context.Background()\n res, err := s.DeleteUser(ctx, id, userID)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook/{id}"]["delete"] update: x-codeSamples: - lang: go - label: createStream - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n request := components.NewStreamPayload{\n Name: \"test_stream\",\n Pull: &components.Pull{\n Source: \"https://myservice.com/live/stream.flv\",\n Headers: map[string]string{\n \"Authorization\": \"Bearer 123\",\n },\n Location: &components.Location{\n Lat: 39.739,\n Lon: -104.988,\n },\n },\n PlaybackPolicy: &components.PlaybackPolicy{\n Type: components.TypeWebhook,\n WebhookID: livepeergo.String(\"1bde4o2i6xycudoy\"),\n WebhookContext: map[string]any{\n \"streamerId\": \"my-custom-id\",\n },\n RefreshInterval: livepeergo.Float64(600),\n },\n Profiles: []components.FfmpegProfile{\n components.FfmpegProfile{\n Width: 1280,\n Name: \"720p\",\n Height: 486589,\n Bitrate: 3000000,\n Fps: 30,\n FpsDen: livepeergo.Int64(1),\n Quality: livepeergo.Int64(23),\n Gop: livepeergo.String(\"2\"),\n Profile: components.ProfileH264Baseline.ToPointer(),\n },\n },\n Record: livepeergo.Bool(false),\n Multistream: &components.Multistream{\n Targets: []components.Target{\n components.Target{\n Profile: \"720p\",\n VideoOnly: livepeergo.Bool(false),\n ID: livepeergo.String(\"PUSH123\"),\n Spec: &components.TargetSpec{\n Name: livepeergo.String(\"My target\"),\n URL: \"rtmps://live.my-service.tv/channel/secretKey\",\n },\n },\n },\n },\n }\n \n ctx := context.Background()\n res, err := s.Create(ctx, request)\n if err != nil {\n log.Fatal(err)\n }\n if res.Stream != nil {\n // handle response\n }\n}" - - target: $["paths"]["/access-control/signing-key"]["get"] + label: deleteWebhook + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" + - target: $["paths"]["/asset/{assetId}"]["get"] update: x-codeSamples: - lang: go - label: getSigningKeys - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook/{id}/log"]["get"] + label: getAsset + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var assetID string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, assetID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Asset != nil {\n // handle response\n }\n}" + - target: $["paths"]["/session/{id}"]["get"] update: x-codeSamples: - lang: go - label: getWebhookLogs - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.GetLogs(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}/user/{userId}"]["get"] + label: getSession + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Session != nil {\n // handle response\n }\n}" + - target: $["paths"]["/task/{taskId}"]["get"] update: x-codeSamples: - lang: go - label: getRoomUser - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n var userID string = \"\"\n \n ctx := context.Background()\n res, err := s.GetUser(ctx, id, userID)\n if err != nil {\n log.Fatal(err)\n }\n if res.GetRoomUserResponse != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook/{id}"]["delete"] + label: getTask + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var taskID string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, taskID)\n if err != nil {\n log.Fatal(err)\n }\n if res.Task != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}/terminate"]["delete"] update: x-codeSamples: - lang: go - label: deleteWebhook - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Delete(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" - - target: $["paths"]["/room/{id}"]["get"] + label: terminateStream + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Terminate(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/stream/{id}/start-pull"]["post"] update: x-codeSamples: - lang: go - label: getRoom - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.Room != nil {\n // handle response\n }\n}" - - target: $["paths"]["/webhook/{id}"]["put"] + label: startPullStream + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.StartPull(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res != nil {\n // handle response\n }\n}" + - target: $["paths"]["/multistream/target/{id}"]["get"] update: x-codeSamples: - lang: go - label: updateWebhook - source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"github.com/livepeer/livepeer-go/models/components\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n\n webhook := components.WebhookInput{\n Name: \"test_webhook\",\n Events: []components.Events{\n components.EventsStreamStarted,\n components.EventsStreamIdle,\n },\n URL: \"https://my-service.com/webhook\",\n SharedSecret: livepeergo.String(\"my-secret\"),\n StreamID: livepeergo.String(\"de7818e7-610a-4057-8f6f-b785dc1e6f88\"),\n }\n \n ctx := context.Background()\n res, err := s.Update(ctx, id, webhook)\n if err != nil {\n log.Fatal(err)\n }\n if res.Webhook != nil {\n // handle response\n }\n}" + label: getMultistreamTarget + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n var id string = \"\"\n \n ctx := context.Background()\n res, err := s.Get(ctx, id)\n if err != nil {\n log.Fatal(err)\n }\n if res.MultistreamTarget != nil {\n // handle response\n }\n}" + - target: $["paths"]["/webhook"]["get"] + update: + x-codeSamples: + - lang: go + label: getWebhooks + source: "package main\n\nimport(\n\tlivepeergo \"github.com/livepeer/livepeer-go\"\n\t\"context\"\n\t\"log\"\n)\n\nfunc main() {\n s := livepeergo.New(\n livepeergo.WithSecurity(\"\"),\n )\n\n\n \n ctx := context.Background()\n res, err := s.GetAll(ctx)\n if err != nil {\n log.Fatal(err)\n }\n if res.Data != nil {\n // handle response\n }\n}" diff --git a/docs/models/components/asset.md b/docs/models/components/asset.md index e8e6437..b841884 100644 --- a/docs/models/components/asset.md +++ b/docs/models/components/asset.md @@ -12,7 +12,7 @@ | `PlaybackURL` | **string* | :heavy_minus_sign: | URL for HLS playback. **It is recommended to not use this URL**, and instead use playback IDs with the Playback Info endpoint to retrieve the playback URLs - this URL format is subject to change (e.g. https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8). | https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8 | | `DownloadURL` | **string* | :heavy_minus_sign: | The URL to directly download the asset, e.g. `https://livepeercdn.com/asset/eawrrk06ts2d0mzb/video`. It is not recommended to use this for playback. | https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video | | `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for a asset or stream is public or signed | | -| `Source` | [components.AssetSource](../../models/components/assetsource.md) | :heavy_check_mark: | N/A | | +| `Source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | | `CreatorID` | [*components.CreatorID](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | | `Storage` | [*components.AssetStorage](../../models/components/assetstorage.md) | :heavy_minus_sign: | N/A | | | `Status` | [*components.AssetStatus](../../models/components/assetstatus.md) | :heavy_minus_sign: | Status of the asset | | diff --git a/docs/models/components/assetinput.md b/docs/models/components/assetinput.md deleted file mode 100644 index 2c062f2..0000000 --- a/docs/models/components/assetinput.md +++ /dev/null @@ -1,17 +0,0 @@ -# AssetInput - - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `Type` | [*components.AssetType](../../models/components/assettype.md) | :heavy_minus_sign: | Type of the asset. | video | -| `PlaybackID` | **string* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | -| `StaticMp4` | **bool* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | | -| `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for a asset or stream is public or signed | | -| `Source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | -| `CreatorID` | [*components.CreatorID](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | -| `Storage` | [*components.AssetStorageInput](../../models/components/assetstorageinput.md) | :heavy_minus_sign: | N/A | | -| `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | -| `ProjectID` | **string* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | -| `Hash` | [][components.Hash](../../models/components/hash.md) | :heavy_minus_sign: | Hash of the asset | | \ No newline at end of file diff --git a/docs/models/components/assetipfsinput.md b/docs/models/components/assetipfsinput.md deleted file mode 100644 index 6f331ee..0000000 --- a/docs/models/components/assetipfsinput.md +++ /dev/null @@ -1,10 +0,0 @@ -# AssetIpfsInput - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `Spec` | [*components.AssetSpec](../../models/components/assetspec.md) | :heavy_minus_sign: | N/A | -| `DollarRef` | *any* | :heavy_minus_sign: | N/A | -| `NftMetadata` | [*components.IpfsFileInfoInput](../../models/components/ipfsfileinfoinput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/assetsource.md b/docs/models/components/assetsource.md deleted file mode 100644 index fb51e00..0000000 --- a/docs/models/components/assetsource.md +++ /dev/null @@ -1,23 +0,0 @@ -# AssetSource - - -## Supported Types - -### AssetSource1 - -```go -assetSource := components.CreateAssetSourceAssetSource1(components.AssetSource1{/* values here */}) -``` - -### Two - -```go -assetSource := components.CreateAssetSourceTwo(components.Two{/* values here */}) -``` - -### AssetSource3 - -```go -assetSource := components.CreateAssetSourceAssetSource3(components.AssetSource3{/* values here */}) -``` - diff --git a/docs/models/components/assetsource1.md b/docs/models/components/assetsource1.md deleted file mode 100644 index 58a922d..0000000 --- a/docs/models/components/assetsource1.md +++ /dev/null @@ -1,11 +0,0 @@ -# AssetSource1 - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Type` | [components.SourceType](../../models/components/sourcetype.md) | :heavy_check_mark: | N/A | -| `URL` | *string* | :heavy_check_mark: | URL from which the asset was uploaded. | -| `GatewayURL` | **string* | :heavy_minus_sign: | Gateway URL from asset if parsed from provided URL on upload. | -| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/assetsource3.md b/docs/models/components/assetsource3.md deleted file mode 100644 index 1698f66..0000000 --- a/docs/models/components/assetsource3.md +++ /dev/null @@ -1,14 +0,0 @@ -# AssetSource3 - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `Type` | [components.AssetSource3Type](../../models/components/assetsource3type.md) | :heavy_check_mark: | N/A | -| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | -| `SourceID` | **string* | :heavy_minus_sign: | ID of the asset or stream from which this asset was created. | -| `SessionID` | **string* | :heavy_minus_sign: | ID of the session from which this asset was created. | -| `PlaybackID` | **string* | :heavy_minus_sign: | Playback ID of the asset or stream from which this asset was created. | -| `RequesterID` | **string* | :heavy_minus_sign: | ID of the requester from which this asset was created. | -| `AssetID` | **string* | :heavy_minus_sign: | ID of the asset from which this asset was created. | \ No newline at end of file diff --git a/docs/models/components/assetstorageinput.md b/docs/models/components/assetstorageinput.md deleted file mode 100644 index 23dfd26..0000000 --- a/docs/models/components/assetstorageinput.md +++ /dev/null @@ -1,8 +0,0 @@ -# AssetStorageInput - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `Ipfs` | [*components.AssetIpfsInput](../../models/components/assetipfsinput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/ipfsfileinfoinput.md b/docs/models/components/ipfsfileinfoinput.md deleted file mode 100644 index 088117d..0000000 --- a/docs/models/components/ipfsfileinfoinput.md +++ /dev/null @@ -1,8 +0,0 @@ -# IpfsFileInfoInput - - -## Fields - -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `Cid` | *string* | :heavy_check_mark: | CID of the file on IPFS | \ No newline at end of file diff --git a/docs/models/components/newassetpayload.md b/docs/models/components/newassetpayload.md index 4cebf4f..afa1c85 100644 --- a/docs/models/components/newassetpayload.md +++ b/docs/models/components/newassetpayload.md @@ -6,7 +6,6 @@ | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `Name` | *string* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | -| `ProjectID` | [*components.AssetInput](../../models/components/assetinput.md) | :heavy_minus_sign: | N/A | | | `StaticMp4` | **bool* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | true | | `PlaybackPolicy` | [*components.PlaybackPolicy](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for a asset or stream is public or signed | | | `CreatorID` | [*components.InputCreatorID](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | diff --git a/docs/models/components/playbackpolicy.md b/docs/models/components/playbackpolicy.md index 2084c32..277ce91 100644 --- a/docs/models/components/playbackpolicy.md +++ b/docs/models/components/playbackpolicy.md @@ -5,9 +5,10 @@ Whether the playback policy for a asset or stream is public or signed ## Fields -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `Type` | [components.Type](../../models/components/type.md) | :heavy_check_mark: | N/A | webhook | -| `WebhookID` | **string* | :heavy_minus_sign: | ID of the webhook to use for playback policy | 1bde4o2i6xycudoy | -| `WebhookContext` | map[string]*any* | :heavy_minus_sign: | User-defined webhook context | {
"streamerId": "my-custom-id"
} | -| `RefreshInterval` | **float64* | :heavy_minus_sign: | Interval (in seconds) at which the playback policy should be
refreshed (default 600 seconds)
| 600 | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `Type` | [components.Type](../../models/components/type.md) | :heavy_check_mark: | N/A | webhook | +| `WebhookID` | **string* | :heavy_minus_sign: | ID of the webhook to use for playback policy | 1bde4o2i6xycudoy | +| `WebhookContext` | map[string]*any* | :heavy_minus_sign: | User-defined webhook context | {
"streamerId": "my-custom-id"
} | +| `RefreshInterval` | **float64* | :heavy_minus_sign: | Interval (in seconds) at which the playback policy should be
refreshed (default 600 seconds)
| 600 | +| `AllowedOrigins` | []*string* | :heavy_minus_sign: | List of allowed origins for CORS playback (://:, ://) | | \ No newline at end of file diff --git a/docs/models/components/source1.md b/docs/models/components/source1.md index a215bc4..638d1d3 100644 --- a/docs/models/components/source1.md +++ b/docs/models/components/source1.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `Type` | [components.SourceType](../../models/components/sourcetype.md) | :heavy_check_mark: | N/A | -| `URL` | *string* | :heavy_check_mark: | URL from which the asset was uploaded. | -| `GatewayURL` | **string* | :heavy_minus_sign: | Gateway URL from asset if parsed from provided URL on upload. | -| `Encryption` | [*components.Encryption](../../models/components/encryption.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Type` | [components.SourceType](../../models/components/sourcetype.md) | :heavy_check_mark: | N/A | +| `URL` | *string* | :heavy_check_mark: | URL from which the asset was uploaded. | +| `GatewayURL` | **string* | :heavy_minus_sign: | Gateway URL from asset if parsed from provided URL on upload. | +| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/source3.md b/docs/models/components/source3.md index b630fb4..066b55e 100644 --- a/docs/models/components/source3.md +++ b/docs/models/components/source3.md @@ -3,12 +3,12 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `Type` | [components.AssetSource3Type](../../models/components/assetsource3type.md) | :heavy_check_mark: | N/A | -| `Encryption` | [*components.Encryption](../../models/components/encryption.md) | :heavy_minus_sign: | N/A | -| `SourceID` | **string* | :heavy_minus_sign: | ID of the asset or stream from which this asset was created. | -| `SessionID` | **string* | :heavy_minus_sign: | ID of the session from which this asset was created. | -| `PlaybackID` | **string* | :heavy_minus_sign: | Playback ID of the asset or stream from which this asset was created. | -| `RequesterID` | **string* | :heavy_minus_sign: | ID of the requester from which this asset was created. | -| `AssetID` | **string* | :heavy_minus_sign: | ID of the asset from which this asset was created. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `Type` | [components.AssetSource3Type](../../models/components/assetsource3type.md) | :heavy_check_mark: | N/A | +| `Encryption` | [*components.EncryptionOutput](../../models/components/encryptionoutput.md) | :heavy_minus_sign: | N/A | +| `SourceID` | **string* | :heavy_minus_sign: | ID of the asset or stream from which this asset was created. | +| `SessionID` | **string* | :heavy_minus_sign: | ID of the session from which this asset was created. | +| `PlaybackID` | **string* | :heavy_minus_sign: | Playback ID of the asset or stream from which this asset was created. | +| `RequesterID` | **string* | :heavy_minus_sign: | ID of the requester from which this asset was created. | +| `AssetID` | **string* | :heavy_minus_sign: | ID of the asset from which this asset was created. | \ No newline at end of file diff --git a/docs/sdks/asset/README.md b/docs/sdks/asset/README.md index c0da3af..2fb1605 100644 --- a/docs/sdks/asset/README.md +++ b/docs/sdks/asset/README.md @@ -155,38 +155,6 @@ func main() { request := components.NewAssetPayload{ Name: "filename.mp4", - ProjectID: &components.AssetInput{ - Type: components.AssetTypeVideo.ToPointer(), - PlaybackID: livepeergo.String("eaw4nk06ts2d0mzb"), - PlaybackPolicy: &components.PlaybackPolicy{ - Type: components.TypeWebhook, - WebhookID: livepeergo.String("1bde4o2i6xycudoy"), - WebhookContext: map[string]any{ - "streamerId": "my-custom-id", - }, - RefreshInterval: livepeergo.Float64(600), - }, - Source: components.CreateSourceTwo( - components.Two{ - Type: components.AssetSourceTypeRecording, - SessionID: "", - }, - ), - CreatorID: components.CreateCreatorIDCreatorID1( - components.CreatorID1{ - Type: components.CreatorIDTypeUnverified, - Value: "user123", - }, - ), - Name: "filename.mp4", - ProjectID: livepeergo.String("aac12556-4d65-4d34-9fb6-d1f0985eb0a9"), - Hash: []components.Hash{ - components.Hash{ - Hash: livepeergo.String("9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57"), - Algorithm: livepeergo.String("sha256"), - }, - }, - }, StaticMp4: livepeergo.Bool(true), PlaybackPolicy: &components.PlaybackPolicy{ Type: components.TypeWebhook, diff --git a/livepeer.go b/livepeer.go index db3625a..bd7798b 100644 --- a/livepeer.go +++ b/livepeer.go @@ -165,9 +165,9 @@ func New(opts ...SDKOption) *Livepeer { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.0.0", - SDKVersion: "0.1.7", + SDKVersion: "0.1.8", GenVersion: "2.333.3", - UserAgent: "speakeasy-sdk/go 0.1.7 2.333.3 1.0.0 github.com/livepeer/livepeer-go", + UserAgent: "speakeasy-sdk/go 0.1.8 2.333.3 1.0.0 github.com/livepeer/livepeer-go", Hooks: hooks.New(), }, } diff --git a/models/components/asset.go b/models/components/asset.go index 61f6cb6..1c32321 100644 --- a/models/components/asset.go +++ b/models/components/asset.go @@ -62,7 +62,7 @@ func (e *AssetSource3Type) UnmarshalJSON(data []byte) error { } } -type AssetSource3 struct { +type Source3 struct { Type AssetSource3Type `json:"type"` Encryption *EncryptionOutput `json:"encryption,omitempty"` // ID of the asset or stream from which this asset was created. @@ -77,49 +77,49 @@ type AssetSource3 struct { AssetID *string `json:"assetId,omitempty"` } -func (o *AssetSource3) GetType() AssetSource3Type { +func (o *Source3) GetType() AssetSource3Type { if o == nil { return AssetSource3Type("") } return o.Type } -func (o *AssetSource3) GetEncryption() *EncryptionOutput { +func (o *Source3) GetEncryption() *EncryptionOutput { if o == nil { return nil } return o.Encryption } -func (o *AssetSource3) GetSourceID() *string { +func (o *Source3) GetSourceID() *string { if o == nil { return nil } return o.SourceID } -func (o *AssetSource3) GetSessionID() *string { +func (o *Source3) GetSessionID() *string { if o == nil { return nil } return o.SessionID } -func (o *AssetSource3) GetPlaybackID() *string { +func (o *Source3) GetPlaybackID() *string { if o == nil { return nil } return o.PlaybackID } -func (o *AssetSource3) GetRequesterID() *string { +func (o *Source3) GetRequesterID() *string { if o == nil { return nil } return o.RequesterID } -func (o *AssetSource3) GetAssetID() *string { +func (o *Source3) GetAssetID() *string { if o == nil { return nil } @@ -192,7 +192,7 @@ func (e *SourceType) UnmarshalJSON(data []byte) error { } } -type AssetSource1 struct { +type Source1 struct { Type SourceType `json:"type"` // URL from which the asset was uploaded. URL string `json:"url"` @@ -201,117 +201,117 @@ type AssetSource1 struct { Encryption *EncryptionOutput `json:"encryption,omitempty"` } -func (o *AssetSource1) GetType() SourceType { +func (o *Source1) GetType() SourceType { if o == nil { return SourceType("") } return o.Type } -func (o *AssetSource1) GetURL() string { +func (o *Source1) GetURL() string { if o == nil { return "" } return o.URL } -func (o *AssetSource1) GetGatewayURL() *string { +func (o *Source1) GetGatewayURL() *string { if o == nil { return nil } return o.GatewayURL } -func (o *AssetSource1) GetEncryption() *EncryptionOutput { +func (o *Source1) GetEncryption() *EncryptionOutput { if o == nil { return nil } return o.Encryption } -type AssetSourceUnionType string +type SourceUnionType string const ( - AssetSourceUnionTypeAssetSource1 AssetSourceUnionType = "asset_source_1" - AssetSourceUnionTypeTwo AssetSourceUnionType = "2" - AssetSourceUnionTypeAssetSource3 AssetSourceUnionType = "asset_source_3" + SourceUnionTypeSource1 SourceUnionType = "source_1" + SourceUnionTypeTwo SourceUnionType = "2" + SourceUnionTypeSource3 SourceUnionType = "source_3" ) -type AssetSource struct { - AssetSource1 *AssetSource1 - Two *Two - AssetSource3 *AssetSource3 +type Source struct { + Source1 *Source1 + Two *Two + Source3 *Source3 - Type AssetSourceUnionType + Type SourceUnionType } -func CreateAssetSourceAssetSource1(assetSource1 AssetSource1) AssetSource { - typ := AssetSourceUnionTypeAssetSource1 +func CreateSourceSource1(source1 Source1) Source { + typ := SourceUnionTypeSource1 - return AssetSource{ - AssetSource1: &assetSource1, - Type: typ, + return Source{ + Source1: &source1, + Type: typ, } } -func CreateAssetSourceTwo(two Two) AssetSource { - typ := AssetSourceUnionTypeTwo +func CreateSourceTwo(two Two) Source { + typ := SourceUnionTypeTwo - return AssetSource{ + return Source{ Two: &two, Type: typ, } } -func CreateAssetSourceAssetSource3(assetSource3 AssetSource3) AssetSource { - typ := AssetSourceUnionTypeAssetSource3 +func CreateSourceSource3(source3 Source3) Source { + typ := SourceUnionTypeSource3 - return AssetSource{ - AssetSource3: &assetSource3, - Type: typ, + return Source{ + Source3: &source3, + Type: typ, } } -func (u *AssetSource) UnmarshalJSON(data []byte) error { +func (u *Source) UnmarshalJSON(data []byte) error { var two Two = Two{} if err := utils.UnmarshalJSON(data, &two, "", true, true); err == nil { u.Two = &two - u.Type = AssetSourceUnionTypeTwo + u.Type = SourceUnionTypeTwo return nil } - var assetSource1 AssetSource1 = AssetSource1{} - if err := utils.UnmarshalJSON(data, &assetSource1, "", true, true); err == nil { - u.AssetSource1 = &assetSource1 - u.Type = AssetSourceUnionTypeAssetSource1 + var source1 Source1 = Source1{} + if err := utils.UnmarshalJSON(data, &source1, "", true, true); err == nil { + u.Source1 = &source1 + u.Type = SourceUnionTypeSource1 return nil } - var assetSource3 AssetSource3 = AssetSource3{} - if err := utils.UnmarshalJSON(data, &assetSource3, "", true, true); err == nil { - u.AssetSource3 = &assetSource3 - u.Type = AssetSourceUnionTypeAssetSource3 + var source3 Source3 = Source3{} + if err := utils.UnmarshalJSON(data, &source3, "", true, true); err == nil { + u.Source3 = &source3 + u.Type = SourceUnionTypeSource3 return nil } - return fmt.Errorf("could not unmarshal `%s` into any supported union types for AssetSource", string(data)) + return fmt.Errorf("could not unmarshal `%s` into any supported union types for Source", string(data)) } -func (u AssetSource) MarshalJSON() ([]byte, error) { - if u.AssetSource1 != nil { - return utils.MarshalJSON(u.AssetSource1, "", true) +func (u Source) MarshalJSON() ([]byte, error) { + if u.Source1 != nil { + return utils.MarshalJSON(u.Source1, "", true) } if u.Two != nil { return utils.MarshalJSON(u.Two, "", true) } - if u.AssetSource3 != nil { - return utils.MarshalJSON(u.AssetSource3, "", true) + if u.Source3 != nil { + return utils.MarshalJSON(u.Source3, "", true) } - return nil, errors.New("could not marshal union type AssetSource: all fields are null") + return nil, errors.New("could not marshal union type Source: all fields are null") } // AssetNftMetadataTemplate - Name of the NFT metadata template to export. 'player' @@ -743,7 +743,7 @@ type Asset struct { DownloadURL *string `json:"downloadUrl,omitempty"` // Whether the playback policy for a asset or stream is public or signed PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - Source AssetSource `json:"source"` + Source Source `json:"source"` CreatorID *CreatorID `json:"creatorId,omitempty"` Storage *AssetStorage `json:"storage,omitempty"` // Status of the asset @@ -814,9 +814,9 @@ func (o *Asset) GetPlaybackPolicy() *PlaybackPolicy { return o.PlaybackPolicy } -func (o *Asset) GetSource() AssetSource { +func (o *Asset) GetSource() Source { if o == nil { - return AssetSource{} + return Source{} } return o.Source } @@ -890,318 +890,3 @@ func (o *Asset) GetVideoSpec() *VideoSpec { } return o.VideoSpec } - -type Source3 struct { - Type AssetSource3Type `json:"type"` - Encryption *Encryption `json:"encryption,omitempty"` - // ID of the asset or stream from which this asset was created. - SourceID *string `json:"sourceId,omitempty"` - // ID of the session from which this asset was created. - SessionID *string `json:"sessionId,omitempty"` - // Playback ID of the asset or stream from which this asset was created. - PlaybackID *string `json:"playbackId,omitempty"` - // ID of the requester from which this asset was created. - RequesterID *string `json:"requesterId,omitempty"` - // ID of the asset from which this asset was created. - AssetID *string `json:"assetId,omitempty"` -} - -func (o *Source3) GetType() AssetSource3Type { - if o == nil { - return AssetSource3Type("") - } - return o.Type -} - -func (o *Source3) GetEncryption() *Encryption { - if o == nil { - return nil - } - return o.Encryption -} - -func (o *Source3) GetSourceID() *string { - if o == nil { - return nil - } - return o.SourceID -} - -func (o *Source3) GetSessionID() *string { - if o == nil { - return nil - } - return o.SessionID -} - -func (o *Source3) GetPlaybackID() *string { - if o == nil { - return nil - } - return o.PlaybackID -} - -func (o *Source3) GetRequesterID() *string { - if o == nil { - return nil - } - return o.RequesterID -} - -func (o *Source3) GetAssetID() *string { - if o == nil { - return nil - } - return o.AssetID -} - -type Source1 struct { - Type SourceType `json:"type"` - // URL from which the asset was uploaded. - URL string `json:"url"` - // Gateway URL from asset if parsed from provided URL on upload. - GatewayURL *string `json:"gatewayUrl,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` -} - -func (o *Source1) GetType() SourceType { - if o == nil { - return SourceType("") - } - return o.Type -} - -func (o *Source1) GetURL() string { - if o == nil { - return "" - } - return o.URL -} - -func (o *Source1) GetGatewayURL() *string { - if o == nil { - return nil - } - return o.GatewayURL -} - -func (o *Source1) GetEncryption() *Encryption { - if o == nil { - return nil - } - return o.Encryption -} - -type SourceUnionType string - -const ( - SourceUnionTypeSource1 SourceUnionType = "source_1" - SourceUnionTypeTwo SourceUnionType = "2" - SourceUnionTypeSource3 SourceUnionType = "source_3" -) - -type Source struct { - Source1 *Source1 - Two *Two - Source3 *Source3 - - Type SourceUnionType -} - -func CreateSourceSource1(source1 Source1) Source { - typ := SourceUnionTypeSource1 - - return Source{ - Source1: &source1, - Type: typ, - } -} - -func CreateSourceTwo(two Two) Source { - typ := SourceUnionTypeTwo - - return Source{ - Two: &two, - Type: typ, - } -} - -func CreateSourceSource3(source3 Source3) Source { - typ := SourceUnionTypeSource3 - - return Source{ - Source3: &source3, - Type: typ, - } -} - -func (u *Source) UnmarshalJSON(data []byte) error { - - var two Two = Two{} - if err := utils.UnmarshalJSON(data, &two, "", true, true); err == nil { - u.Two = &two - u.Type = SourceUnionTypeTwo - return nil - } - - var source1 Source1 = Source1{} - if err := utils.UnmarshalJSON(data, &source1, "", true, true); err == nil { - u.Source1 = &source1 - u.Type = SourceUnionTypeSource1 - return nil - } - - var source3 Source3 = Source3{} - if err := utils.UnmarshalJSON(data, &source3, "", true, true); err == nil { - u.Source3 = &source3 - u.Type = SourceUnionTypeSource3 - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for Source", string(data)) -} - -func (u Source) MarshalJSON() ([]byte, error) { - if u.Source1 != nil { - return utils.MarshalJSON(u.Source1, "", true) - } - - if u.Two != nil { - return utils.MarshalJSON(u.Two, "", true) - } - - if u.Source3 != nil { - return utils.MarshalJSON(u.Source3, "", true) - } - - return nil, errors.New("could not marshal union type Source: all fields are null") -} - -type AssetIpfsInput struct { - Spec *AssetSpec `json:"spec,omitempty"` - DollarRef any `json:"$ref,omitempty"` - NftMetadata *IpfsFileInfoInput `json:"nftMetadata,omitempty"` -} - -func (o *AssetIpfsInput) GetSpec() *AssetSpec { - if o == nil { - return nil - } - return o.Spec -} - -func (o *AssetIpfsInput) GetDollarRef() any { - if o == nil { - return nil - } - return o.DollarRef -} - -func (o *AssetIpfsInput) GetNftMetadata() *IpfsFileInfoInput { - if o == nil { - return nil - } - return o.NftMetadata -} - -type AssetStorageInput struct { - Ipfs *AssetIpfsInput `json:"ipfs,omitempty"` -} - -func (o *AssetStorageInput) GetIpfs() *AssetIpfsInput { - if o == nil { - return nil - } - return o.Ipfs -} - -type AssetInput struct { - // Type of the asset. - Type *AssetType `json:"type,omitempty"` - // The playback ID to use with the Playback Info endpoint to retrieve playback URLs. - PlaybackID *string `json:"playbackId,omitempty"` - // Whether to generate MP4s for the asset. - StaticMp4 *bool `json:"staticMp4,omitempty"` - // Whether the playback policy for a asset or stream is public or signed - PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"` - Source Source `json:"source"` - CreatorID *CreatorID `json:"creatorId,omitempty"` - Storage *AssetStorageInput `json:"storage,omitempty"` - // The name of the asset. This is not necessarily the filename - it can be a custom name or title. - // - Name string `json:"name"` - // The ID of the project - ProjectID *string `json:"projectId,omitempty"` - // Hash of the asset - Hash []Hash `json:"hash,omitempty"` -} - -func (o *AssetInput) GetType() *AssetType { - if o == nil { - return nil - } - return o.Type -} - -func (o *AssetInput) GetPlaybackID() *string { - if o == nil { - return nil - } - return o.PlaybackID -} - -func (o *AssetInput) GetStaticMp4() *bool { - if o == nil { - return nil - } - return o.StaticMp4 -} - -func (o *AssetInput) GetPlaybackPolicy() *PlaybackPolicy { - if o == nil { - return nil - } - return o.PlaybackPolicy -} - -func (o *AssetInput) GetSource() Source { - if o == nil { - return Source{} - } - return o.Source -} - -func (o *AssetInput) GetCreatorID() *CreatorID { - if o == nil { - return nil - } - return o.CreatorID -} - -func (o *AssetInput) GetStorage() *AssetStorageInput { - if o == nil { - return nil - } - return o.Storage -} - -func (o *AssetInput) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *AssetInput) GetProjectID() *string { - if o == nil { - return nil - } - return o.ProjectID -} - -func (o *AssetInput) GetHash() []Hash { - if o == nil { - return nil - } - return o.Hash -} diff --git a/models/components/ipfsfileinfoinput.go b/models/components/ipfsfileinfoinput.go deleted file mode 100644 index 4e3f518..0000000 --- a/models/components/ipfsfileinfoinput.go +++ /dev/null @@ -1,15 +0,0 @@ -// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. - -package components - -type IpfsFileInfoInput struct { - // CID of the file on IPFS - Cid string `json:"cid"` -} - -func (o *IpfsFileInfoInput) GetCid() string { - if o == nil { - return "" - } - return o.Cid -} diff --git a/models/components/newassetpayload.go b/models/components/newassetpayload.go index 1c0dd2e..6502ea8 100644 --- a/models/components/newassetpayload.go +++ b/models/components/newassetpayload.go @@ -115,8 +115,7 @@ func (o *NewAssetPayloadEncryption) GetEncryptedKey() string { type NewAssetPayload struct { // The name of the asset. This is not necessarily the filename - it can be a custom name or title. // - Name string `json:"name"` - ProjectID *AssetInput `json:"projectId,omitempty"` + Name string `json:"name"` // Whether to generate MP4s for the asset. StaticMp4 *bool `json:"staticMp4,omitempty"` // Whether the playback policy for a asset or stream is public or signed @@ -138,13 +137,6 @@ func (o *NewAssetPayload) GetName() string { return o.Name } -func (o *NewAssetPayload) GetProjectID() *AssetInput { - if o == nil { - return nil - } - return o.ProjectID -} - func (o *NewAssetPayload) GetStaticMp4() *bool { if o == nil { return nil diff --git a/models/components/playbackpolicy.go b/models/components/playbackpolicy.go index 46caaa4..71bd5f7 100644 --- a/models/components/playbackpolicy.go +++ b/models/components/playbackpolicy.go @@ -47,6 +47,8 @@ type PlaybackPolicy struct { // refreshed (default 600 seconds) // RefreshInterval *float64 `json:"refreshInterval,omitempty"` + // List of allowed origins for CORS playback (://:, ://) + AllowedOrigins []string `json:"allowedOrigins,omitempty"` } func (o *PlaybackPolicy) GetType() Type { @@ -76,3 +78,10 @@ func (o *PlaybackPolicy) GetRefreshInterval() *float64 { } return o.RefreshInterval } + +func (o *PlaybackPolicy) GetAllowedOrigins() []string { + if o == nil { + return nil + } + return o.AllowedOrigins +}