From 6d63d7de8b9b270ccdc8c66bfc31524b8afcbf42 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 12 Jul 2024 00:15:57 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.332.1 --- .speakeasy/gen.lock | 10 +- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 8 +- RELEASES.md | 10 +- codeSamples.yaml | 868 +++++++++++++++---------------- setup.py | 2 +- src/livepeer/sdkconfiguration.py | 6 +- 7 files changed, 457 insertions(+), 449 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e2a0070..30dd741 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 8c3ff122-1fb8-439c-8680-989f956dfd8d management: docChecksum: bd22d35dc6bf62d09e41897481fef714 docVersion: 1.0.0 - speakeasyVersion: 1.326.2 - generationVersion: 2.359.1 - releaseVersion: 0.0.9 - configChecksum: 90954ce50db15e521b2117511c4a7312 + speakeasyVersion: 1.332.1 + generationVersion: 2.366.1 + releaseVersion: 0.1.0 + configChecksum: b8377b3392c6a1ac01e2e558eb20ee44 repoURL: https://github.com/livepeer/livepeer-python.git installationURL: https://github.com/livepeer/livepeer-python.git features: @@ -14,7 +14,7 @@ features: additionalDependencies: 0.1.0 additionalProperties: 0.1.0 constsAndDefaults: 0.1.3 - core: 4.6.13 + core: 4.8.1 deprecations: 2.81.1 flattening: 2.81.1 globalSecurity: 2.83.5 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2d2043b..04a15a4 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true python: - version: 0.0.9 + version: 0.1.0 additionalDependencies: dependencies: {} extraDependencies: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0b8bd00..1d11813 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.326.0 sources: livepeer-studio-api: sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:2f835cb98317c1cc68d9f41aeb5f4abf801bc313bcbdf02ec7d3a170e51084e1 - sourceBlobDigest: sha256:d354ae04127f51409f66ad5422feee48c467c308ac695fc73737676c008dc310 + sourceRevisionDigest: sha256:9a9d72e319534e5d5525297a8ac2a1b4e5c1270941818756835759be44803dfd + sourceBlobDigest: sha256:325036f1e2ef18ca296e6fc9be547e7c143311b312474806e0f46ddc8ce56531 tags: - latest - main @@ -11,8 +11,8 @@ targets: livepeer-python: source: livepeer-studio-api sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:2f835cb98317c1cc68d9f41aeb5f4abf801bc313bcbdf02ec7d3a170e51084e1 - sourceBlobDigest: sha256:d354ae04127f51409f66ad5422feee48c467c308ac695fc73737676c008dc310 + sourceRevisionDigest: sha256:9a9d72e319534e5d5525297a8ac2a1b4e5c1270941818756835759be44803dfd + sourceBlobDigest: sha256:325036f1e2ef18ca296e6fc9be547e7c143311b312474806e0f46ddc8ce56531 outLocation: /github/workspace/repo my-first-target: source: livepeer-studio-api diff --git a/RELEASES.md b/RELEASES.md index a7d825e..f971b17 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -54,4 +54,12 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.326.2 (2.359.1) https://github.com/speakeasy-api/speakeasy ### Generated -- [python v0.0.9] . \ No newline at end of file +- [python v0.0.9] . + +## 2024-07-12 00:15:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.332.1 (2.366.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.1.0] . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 90c86d1..67effcb 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,83 +3,11 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: - - target: $["paths"]["/stream/{id}/terminate"]["delete"] - update: - x-codeSamples: - - lang: python - label: terminateStream - source: |- - import livepeer - - s = livepeer.Livepeer( - api_key="", - ) - - - res = s.stream.terminate(id='') - - if res is not None: - # handle response - pass - - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getWebhookLog - source: |- - import livepeer - - s = livepeer.Livepeer( - api_key="", - ) - - - res = s.webhook.get_log(id='', log_id='') - - if res.webhook_log is not None: - # handle response - pass - - target: $["paths"]["/room/{id}"]["get"] - update: - x-codeSamples: - - lang: python - label: getRoom - source: |- - import livepeer - - s = livepeer.Livepeer( - api_key="", - ) - - - res = s.room.get(id='') - - if res.room is not None: - # handle response - pass - - target: $["paths"]["/task/{taskId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getTask - source: |- - import livepeer - - s = livepeer.Livepeer( - api_key="", - ) - - - res = s.task.get(task_id='') - - if res.task is not None: - # handle response - pass - - target: $["paths"]["/multistream/target"]["post"] + - target: $["paths"]["/clip"]["post"] update: x-codeSamples: - lang: python - label: createMultistreamTarget + label: createClip source: |- import livepeer from livepeer.models import components @@ -89,36 +17,49 @@ actions: ) - res = s.multistream.create(request=components.MultistreamTargetInput( - url='rtmps://live.my-service.tv/channel/secretKey', + res = s.stream.create_clip(request=components.ClipPayload( + playback_id='eaw4nk06ts2d0mzb', + start_time=1587667174725, + end_time=1587667174725, + name='My Clip', + session_id='de7818e7-610a-4057-8f6f-b785dc1e6f88', )) - if res.multistream_target is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/webhook/{id}/log"]["get"] + - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] update: x-codeSamples: - lang: python - label: getWebhookLogs + label: addMultistreamTarget source: |- import livepeer + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.webhook.get_logs(id='') + res = s.stream.add_multistream_target(id='', target_add_payload=components.TargetAddPayload( + profile='720p0', + video_only=False, + id='PUSH123', + spec=components.TargetAddPayloadSpec( + name='My target', + url='rtmps://live.my-service.tv/channel/secretKey', + ), + )) - if res.data is not None: + if res is not None: # handle response pass - - target: $["paths"]["/asset/{assetId}"]["get"] + - target: $["paths"]["/asset/{assetId}"]["delete"] update: x-codeSamples: - lang: python - label: getAsset + label: deleteAsset source: |- import livepeer @@ -127,16 +68,16 @@ actions: ) - res = s.asset.get(asset_id='') + res = s.asset.delete(asset_id='') - if res.asset is not None: + if res is not None: # handle response pass - - target: $["paths"]["/room"]["post"] + - target: $["paths"]["/playback/{id}"]["get"] update: x-codeSamples: - lang: python - label: createRoom + label: getPlaybackInfo source: |- import livepeer @@ -145,16 +86,16 @@ actions: ) - res = s.room.create() + res = s.playback.get(id='') - if res.create_room_response is not None: + if res.playback_info is not None: # handle response pass - - target: $["paths"]["/room/{id}"]["delete"] + - target: $["paths"]["/webhook/{id}"]["get"] update: x-codeSamples: - lang: python - label: deleteRoom + label: getWebhook source: |- import livepeer @@ -163,27 +104,28 @@ actions: ) - res = s.room.delete(id='') + res = s.webhook.get(id='') - if res is not None: + if res.webhook is not None: # handle response pass - - target: $["paths"]["/webhook"]["get"] + - target: $["paths"]["/data/usage/query"]["get"] update: x-codeSamples: - lang: python - label: getWebhooks + label: getUsageMetrics source: |- import livepeer + from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.webhook.get_all() + res = s.metrics.get_usage(request=operations.GetUsageMetricsRequest()) - if res.data is not None: + if res.usage_metric is not None: # handle response pass - target: $["paths"]["/asset/{assetId}"]["patch"] @@ -215,11 +157,11 @@ actions: if res.asset is not None: # handle response pass - - target: $["paths"]["/stream/{parentId}/sessions"]["get"] + - target: $["paths"]["/room"]["post"] update: x-codeSamples: - lang: python - label: getRecordedSessions + label: createRoom source: |- import livepeer @@ -228,9 +170,9 @@ actions: ) - res = s.session.get_recorded(parent_id='', record=True) + res = s.room.create() - if res.data is not None: + if res.create_room_response is not None: # handle response pass - target: $["paths"]["/stream/{id}"]["patch"] @@ -303,11 +245,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/session"]["get"] + - target: $["paths"]["/stream/{id}/clips"]["get"] update: x-codeSamples: - lang: python - label: getSessions + label: getClips source: |- import livepeer @@ -316,108 +258,74 @@ actions: ) - res = s.session.get_all() + res = s.stream.get_clips(id='') if res.data is not None: # handle response pass - - target: $["paths"]["/session/{id}"]["get"] + - target: $["paths"]["/room/{id}/egress"]["post"] update: x-codeSamples: - lang: python - label: getSession + label: startRoomEgress source: |- import livepeer + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.session.get(id='') + res = s.room.start_egress(id='', room_egress_payload=components.RoomEgressPayload( + stream_id='aac12556-4d65-4d34-9fb6-d1f0985eb0a9', + )) - if res.session is not None: + if res is not None: # handle response pass - - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] update: x-codeSamples: - lang: python - label: deleteSigningKey + label: updateSigningKey source: |- import livepeer + from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.access_control.delete(key_id='') + res = s.access_control.update(key_id='', request_body=operations.UpdateSigningKeyRequestBody()) if res is not None: # handle response pass - - target: $["paths"]["/transcode"]["post"] + - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] update: x-codeSamples: - lang: python - label: transcodeVideo + label: removeMultistreamTarget source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.transcode.create(request=components.TranscodePayload( - input=components.Input1( - url='https://s3.amazonaws.com/bucket/file.mp4', - ), - storage=components.Storage1( - type=components.StorageType.S3, - endpoint='https://gateway.storjshare.io', - bucket='outputbucket', - credentials=components.StorageCredentials( - access_key_id='AKIAIOSFODNN7EXAMPLE', - secret_access_key='wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - ), - ), - outputs=components.Outputs( - hls=components.Hls( - path='/samplevideo/hls', - ), - mp4=components.Mp4( - path='/samplevideo/mp4', - ), - fmp4=components.Fmp4( - path='/samplevideo/fmp4', - ), - ), - profiles=[ - components.TranscodeProfile( - width=1280, - name='720p', - bitrate=3000000, - quality=23, - fps=30, - fps_den=1, - gop='2', - profile=components.TranscodeProfileProfile.H264_BASELINE, - encoder=components.TranscodeProfileEncoder.H_264, - ), - ], - )) + res = s.stream.remove_multistream_target(id='', target_id='') - if res.task is not None: + if res is not None: # handle response pass - - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] + - target: $["paths"]["/multistream/target"]["get"] update: x-codeSamples: - lang: python - label: removeMultistreamTarget + label: getMultistreamTargets source: |- import livepeer @@ -426,16 +334,16 @@ actions: ) - res = s.stream.remove_multistream_target(id='', target_id='') + res = s.multistream.get_all() - if res is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/multistream/target/{id}"]["delete"] + - target: $["paths"]["/webhook"]["get"] update: x-codeSamples: - lang: python - label: deleteMultistreamTarget + label: getWebhooks source: |- import livepeer @@ -444,114 +352,135 @@ actions: ) - res = s.multistream.delete(id='') + res = s.webhook.get_all() - if res is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/room/{id}/egress"]["post"] + - target: $["paths"]["/asset/{assetId}"]["get"] update: x-codeSamples: - lang: python - label: startRoomEgress + label: getAsset source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.room.start_egress(id='', room_egress_payload=components.RoomEgressPayload( - stream_id='aac12556-4d65-4d34-9fb6-d1f0985eb0a9', - )) + res = s.asset.get(asset_id='') - if res is not None: + if res.asset is not None: # handle response pass - - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] + - target: $["paths"]["/session"]["get"] update: x-codeSamples: - lang: python - label: updateSigningKey + label: getSessions source: |- import livepeer - from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.access_control.update(key_id='', request_body=operations.UpdateSigningKeyRequestBody()) + res = s.session.get_all() - if res is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/data/views/now"]["get"] + - target: $["paths"]["/room/{id}/egress"]["delete"] update: x-codeSamples: - lang: python - label: getRealtimeViewershipNow + label: stopRoomEgress source: |- import livepeer - from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.metrics.get_realtime_viewership(playback_id='', creator_id='', breakdown_by=[ - operations.BreakdownBy.PLAYBACK_ID, - ]) + res = s.room.stop_egress(id='') + + if res is not None: + # handle response + pass + - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] + update: + x-codeSamples: + - lang: python + label: getPublicViewershipMetrics + source: |- + import livepeer + + s = livepeer.Livepeer( + api_key="", + ) + + + res = s.metrics.get_public_viewership(playback_id='') if res.data is not None: # handle response pass - - target: $["paths"]["/data/usage/query"]["get"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] update: x-codeSamples: - lang: python - label: getUsageMetrics + label: getSigningKey source: |- import livepeer - from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.metrics.get_usage(request=operations.GetUsageMetricsRequest()) + res = s.access_control.get(key_id='') - if res.usage_metric is not None: + if res.signing_key is not None: # handle response pass - - target: $["paths"]["/stream/{id}"]["delete"] + - target: $["paths"]["/webhook"]["post"] update: x-codeSamples: - lang: python - label: deleteStream + label: createWebhook source: |- import livepeer + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.stream.delete(id='') + res = s.webhook.create(request=components.WebhookInput( + name='test_webhook', + project_id='aac12556-4d65-4d34-9fb6-d1f0985eb0a9', + events=[ + components.Events.STREAM_STARTED, + components.Events.STREAM_IDLE, + ], + url='https://my-service.com/webhook', + shared_secret='my-secret', + stream_id='de7818e7-610a-4057-8f6f-b785dc1e6f88', + )) - if res is not None: + if res.webhook is not None: # handle response pass - - target: $["paths"]["/room/{id}/user/{userId}"]["put"] + - target: $["paths"]["/webhook/{id}"]["put"] update: x-codeSamples: - lang: python - label: updateRoomUser + label: updateWebhook source: |- import livepeer from livepeer.models import components @@ -561,19 +490,26 @@ actions: ) - res = s.room.update_user(id='', user_id='', room_user_update_payload=components.RoomUserUpdatePayload( - can_publish=True, - can_publish_data=True, + res = s.webhook.update(id='', webhook=components.WebhookInput( + name='test_webhook', + project_id='aac12556-4d65-4d34-9fb6-d1f0985eb0a9', + events=[ + components.Events.STREAM_STARTED, + components.Events.STREAM_IDLE, + ], + url='https://my-service.com/webhook', + shared_secret='my-secret', + stream_id='de7818e7-610a-4057-8f6f-b785dc1e6f88', )) - if res is not None: + if res.webhook is not None: # handle response pass - - target: $["paths"]["/stream"]["get"] + - target: $["paths"]["/stream/{parentId}/sessions"]["get"] update: x-codeSamples: - lang: python - label: getStreams + label: getRecordedSessions source: |- import livepeer @@ -582,16 +518,16 @@ actions: ) - res = s.stream.get_all(streamsonly='') + res = s.session.get_recorded(parent_id='', record=True) if res.data is not None: # handle response pass - - target: $["paths"]["/stream/{id}/start-pull"]["post"] + - target: $["paths"]["/task/{taskId}"]["get"] update: x-codeSamples: - lang: python - label: startPullStream + label: getTask source: |- import livepeer @@ -600,55 +536,126 @@ actions: ) - res = s.stream.start_pull(id='') + res = s.task.get(task_id='') - if res is not None: + if res.task is not None: # handle response pass - - target: $["paths"]["/stream/{id}/clips"]["get"] + - target: $["paths"]["/transcode"]["post"] update: x-codeSamples: - lang: python - label: getClips + label: transcodeVideo source: |- import livepeer + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.stream.get_clips(id='') + res = s.transcode.create(request=components.TranscodePayload( + input=components.Input1( + url='https://s3.amazonaws.com/bucket/file.mp4', + ), + storage=components.Storage1( + type=components.StorageType.S3, + endpoint='https://gateway.storjshare.io', + bucket='outputbucket', + credentials=components.StorageCredentials( + access_key_id='AKIAIOSFODNN7EXAMPLE', + secret_access_key='wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + ), + ), + outputs=components.Outputs( + hls=components.Hls( + path='/samplevideo/hls', + ), + mp4=components.Mp4( + path='/samplevideo/mp4', + ), + fmp4=components.Fmp4( + path='/samplevideo/fmp4', + ), + ), + profiles=[ + components.TranscodeProfile( + width=1280, + name='720p', + bitrate=3000000, + quality=23, + fps=30, + fps_den=1, + gop='2', + profile=components.TranscodeProfileProfile.H264_BASELINE, + encoder=components.TranscodeProfileEncoder.H_264, + ), + ], + )) + + if res.task is not None: + # handle response + pass + - target: $["paths"]["/stream/{id}"]["get"] + update: + x-codeSamples: + - lang: python + label: getStream + source: |- + import livepeer + + s = livepeer.Livepeer( + api_key="", + ) + + + res = s.stream.get(id='') + + if res.stream is not None: + # handle response + pass + - target: $["paths"]["/webhook/{id}/log"]["get"] + update: + x-codeSamples: + - lang: python + label: getWebhookLogs + source: |- + import livepeer + + s = livepeer.Livepeer( + api_key="", + ) + + + res = s.webhook.get_logs(id='') if res.data is not None: # handle response pass - - target: $["paths"]["/multistream/target/{id}"]["patch"] + - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] update: x-codeSamples: - lang: python - label: updateMultistreamTarget + label: deleteRoomUser source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.multistream.update(id='', multistream_target_patch_payload=components.MultistreamTargetPatchPayload( - url='rtmps://live.my-service.tv/channel/secretKey', - )) + res = s.room.delete_user(id='', user_id='') if res is not None: # handle response pass - - target: $["paths"]["/asset/upload/url"]["post"] + - target: $["paths"]["/stream"]["post"] update: x-codeSamples: - lang: python - label: uploadAsset + label: createStream source: |- import livepeer from livepeer.models import components @@ -658,9 +665,18 @@ actions: ) - res = s.asset.create_via_url(request=components.NewAssetFromURLPayload( - name='filename.mp4', - static_mp4=True, + res = s.stream.create(request=components.NewStreamPayload( + name='test_stream', + pull=components.Pull( + source='https://myservice.com/live/stream.flv', + headers={ + 'Authorization': 'Bearer 123', + }, + location=components.Location( + lat=39.739, + lon=-104.988, + ), + ), playback_policy=components.PlaybackPolicy( type=components.Type.WEBHOOK, webhook_id='1bde4o2i6xycudoy', @@ -669,30 +685,58 @@ actions: }, refresh_interval=600, ), - url='https://s3.amazonaws.com/my-bucket/path/filename.mp4', profiles=[ - components.TranscodeProfile( + components.FfmpegProfile( width=1280, name='720p', + height=486589, bitrate=3000000, - quality=23, fps=30, fps_den=1, + quality=23, gop='2', - profile=components.TranscodeProfileProfile.H264_BASELINE, - encoder=components.TranscodeProfileEncoder.H_264, + profile=components.Profile.H264_BASELINE, ), ], + record=False, + recording_spec=components.NewStreamPayloadRecordingSpec( + profiles=[ + components.TranscodeProfile( + width=1280, + name='720p', + bitrate=3000000, + quality=23, + fps=30, + fps_den=1, + gop='2', + profile=components.TranscodeProfileProfile.H264_BASELINE, + encoder=components.TranscodeProfileEncoder.H_264, + ), + ], + ), + multistream=components.Multistream( + targets=[ + components.Target( + profile='720p', + video_only=False, + id='PUSH123', + spec=components.TargetSpec( + name='My target', + url='rtmps://live.my-service.tv/channel/secretKey', + ), + ), + ], + ), )) - if res.two_hundred_application_json_data is not None: + if res.stream is not None: # handle response pass - - target: $["paths"]["/asset/{assetId}"]["delete"] + - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] update: x-codeSamples: - lang: python - label: deleteAsset + label: getWebhookLog source: |- import livepeer @@ -701,16 +745,16 @@ actions: ) - res = s.asset.delete(asset_id='') + res = s.webhook.get_log(id='', log_id='') - if res is not None: + if res.webhook_log is not None: # handle response pass - - target: $["paths"]["/access-control/signing-key"]["post"] + - target: $["paths"]["/session/{id}/clips"]["get"] update: x-codeSamples: - lang: python - label: createSigningKey + label: getSessionClips source: |- import livepeer @@ -719,90 +763,63 @@ actions: ) - res = s.access_control.create() + res = s.session.get_clips(id='') - if res.signing_key is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/clip"]["post"] + - target: $["paths"]["/room/{id}/user/{userId}"]["get"] update: x-codeSamples: - lang: python - label: createClip + label: getRoomUser source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.stream.create_clip(request=components.ClipPayload( - playback_id='eaw4nk06ts2d0mzb', - start_time=1587667174725, - end_time=1587667174725, - name='My Clip', - session_id='de7818e7-610a-4057-8f6f-b785dc1e6f88', - )) + res = s.room.get_user(id='', user_id='') - if res.data is not None: + if res.get_room_user_response is not None: # handle response pass - - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] update: x-codeSamples: - lang: python - label: addMultistreamTarget + label: deleteSigningKey source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.stream.add_multistream_target(id='', target_add_payload=components.TargetAddPayload( - profile='720p0', - video_only=False, - id='PUSH123', - spec=components.TargetAddPayloadSpec( - name='My target', - url='rtmps://live.my-service.tv/channel/secretKey', - ), - )) + res = s.access_control.delete(key_id='') if res is not None: # handle response pass - - target: $["paths"]["/webhook"]["post"] + - target: $["paths"]["/multistream/target/{id}"]["get"] update: x-codeSamples: - lang: python - label: createWebhook + label: getMultistreamTarget source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.webhook.create(request=components.WebhookInput( - name='test_webhook', - project_id='aac12556-4d65-4d34-9fb6-d1f0985eb0a9', - events=[ - components.Events.STREAM_STARTED, - components.Events.STREAM_IDLE, - ], - url='https://my-service.com/webhook', - shared_secret='my-secret', - stream_id='de7818e7-610a-4057-8f6f-b785dc1e6f88', - )) + res = s.multistream.get(id='') - if res.webhook is not None: + if res.multistream_target is not None: # handle response pass - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] @@ -823,11 +840,73 @@ actions: if res.webhook_log is not None: # handle response pass - - target: $["paths"]["/asset"]["get"] + - target: $["paths"]["/asset/upload/url"]["post"] + update: + x-codeSamples: + - lang: python + label: uploadAsset + source: |- + import livepeer + from livepeer.models import components + + s = livepeer.Livepeer( + api_key="", + ) + + + res = s.asset.create_via_url(request=components.NewAssetFromURLPayload( + name='filename.mp4', + static_mp4=True, + playback_policy=components.PlaybackPolicy( + type=components.Type.WEBHOOK, + webhook_id='1bde4o2i6xycudoy', + webhook_context={ + 'streamerId': 'my-custom-id', + }, + refresh_interval=600, + ), + url='https://s3.amazonaws.com/my-bucket/path/filename.mp4', + profiles=[ + components.TranscodeProfile( + width=1280, + name='720p', + bitrate=3000000, + quality=23, + fps=30, + fps_den=1, + gop='2', + profile=components.TranscodeProfileProfile.H264_BASELINE, + encoder=components.TranscodeProfileEncoder.H_264, + ), + ], + )) + + if res.two_hundred_application_json_data is not None: + # handle response + pass + - target: $["paths"]["/stream/{id}/terminate"]["delete"] + update: + x-codeSamples: + - lang: python + label: terminateStream + source: |- + import livepeer + + s = livepeer.Livepeer( + api_key="", + ) + + + res = s.stream.terminate(id='') + + if res is not None: + # handle response + pass + - target: $["paths"]["/access-control/signing-key"]["get"] update: x-codeSamples: - lang: python - label: getAssets + label: getSigningKeys source: |- import livepeer @@ -836,35 +915,37 @@ actions: ) - res = s.asset.get_all() + res = s.access_control.get_all() if res.data is not None: # handle response pass - - target: $["paths"]["/data/views/query/creator"]["get"] + - target: $["paths"]["/multistream/target/{id}"]["patch"] update: x-codeSamples: - lang: python - label: getCreatorViewershipMetrics + label: updateMultistreamTarget source: |- import livepeer - from livepeer.models import operations + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.metrics.get_creator_viewership(request=operations.GetCreatorViewershipMetricsRequest()) + res = s.multistream.update(id='', multistream_target_patch_payload=components.MultistreamTargetPatchPayload( + url='rtmps://live.my-service.tv/channel/secretKey', + )) - if res.data is not None: + if res is not None: # handle response pass - - target: $["paths"]["/stream/{id}"]["get"] + - target: $["paths"]["/room/{id}"]["get"] update: x-codeSamples: - lang: python - label: getStream + label: getRoom source: |- import livepeer @@ -873,9 +954,9 @@ actions: ) - res = s.stream.get(id='') + res = s.room.get(id='') - if res.stream is not None: + if res.room is not None: # handle response pass - target: $["paths"]["/asset/request-upload"]["post"] @@ -921,34 +1002,29 @@ actions: if res.data is not None: # handle response pass - - target: $["paths"]["/room/{id}/user"]["post"] + - target: $["paths"]["/stream"]["get"] update: x-codeSamples: - lang: python - label: createRoomUser + label: getStreams source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.room.create_user(id='', room_user_payload=components.RoomUserPayload( - name='name', - can_publish=True, - can_publish_data=True, - )) + res = s.stream.get_all(streamsonly='') - if res.room_user_response is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/room/{id}/user/{userId}"]["get"] + - target: $["paths"]["/stream/{id}"]["delete"] update: x-codeSamples: - lang: python - label: getRoomUser + label: deleteStream source: |- import livepeer @@ -957,16 +1033,16 @@ actions: ) - res = s.room.get_user(id='', user_id='') + res = s.stream.delete(id='') - if res.get_room_user_response is not None: + if res is not None: # handle response pass - - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] + - target: $["paths"]["/multistream/target/{id}"]["delete"] update: x-codeSamples: - lang: python - label: deleteRoomUser + label: deleteMultistreamTarget source: |- import livepeer @@ -975,16 +1051,16 @@ actions: ) - res = s.room.delete_user(id='', user_id='') + res = s.multistream.delete(id='') if res is not None: # handle response pass - - target: $["paths"]["/access-control/signing-key"]["get"] + - target: $["paths"]["/session/{id}"]["get"] update: x-codeSamples: - lang: python - label: getSigningKeys + label: getSession source: |- import livepeer @@ -993,16 +1069,16 @@ actions: ) - res = s.access_control.get_all() + res = s.session.get(id='') - if res.data is not None: + if res.session is not None: # handle response pass - - target: $["paths"]["/task"]["get"] + - target: $["paths"]["/access-control/signing-key"]["post"] update: x-codeSamples: - lang: python - label: getTasks + label: createSigningKey source: |- import livepeer @@ -1011,16 +1087,16 @@ actions: ) - res = s.task.get_all() + res = s.access_control.create() - if res.data is not None: + if res.signing_key is not None: # handle response pass - - target: $["paths"]["/webhook/{id}"]["delete"] + - target: $["paths"]["/asset"]["get"] update: x-codeSamples: - lang: python - label: deleteWebhook + label: getAssets source: |- import livepeer @@ -1029,16 +1105,16 @@ actions: ) - res = s.webhook.delete(id='') + res = s.asset.get_all() - if res.webhook is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/session/{id}/clips"]["get"] + - target: $["paths"]["/room/{id}"]["delete"] update: x-codeSamples: - lang: python - label: getSessionClips + label: deleteRoom source: |- import livepeer @@ -1047,34 +1123,39 @@ actions: ) - res = s.session.get_clips(id='') + res = s.room.delete(id='') - if res.data is not None: + if res is not None: # handle response pass - - target: $["paths"]["/room/{id}/egress"]["delete"] + - target: $["paths"]["/room/{id}/user"]["post"] update: x-codeSamples: - lang: python - label: stopRoomEgress + label: createRoomUser source: |- import livepeer + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.room.stop_egress(id='') + res = s.room.create_user(id='', room_user_payload=components.RoomUserPayload( + name='name', + can_publish=True, + can_publish_data=True, + )) - if res is not None: + if res.room_user_response is not None: # handle response pass - - target: $["paths"]["/data/views/query"]["get"] + - target: $["paths"]["/data/views/now"]["get"] update: x-codeSamples: - lang: python - label: getViewershipMetrics + label: getRealtimeViewershipNow source: |- import livepeer from livepeer.models import operations @@ -1084,34 +1165,37 @@ actions: ) - res = s.metrics.get_viewership(request=operations.GetViewershipMetricsRequest()) + res = s.metrics.get_realtime_viewership(playback_id='', creator_id='', breakdown_by=[ + operations.BreakdownBy.PLAYBACK_ID, + ]) if res.data is not None: # handle response pass - - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] + - target: $["paths"]["/data/views/query/creator"]["get"] update: x-codeSamples: - lang: python - label: getPublicViewershipMetrics + label: getCreatorViewershipMetrics source: |- import livepeer + from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.metrics.get_public_viewership(playback_id='') + res = s.metrics.get_creator_viewership(request=operations.GetCreatorViewershipMetricsRequest()) if res.data is not None: # handle response pass - - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] + - target: $["paths"]["/stream/{id}/start-pull"]["post"] update: x-codeSamples: - lang: python - label: getSigningKey + label: startPullStream source: |- import livepeer @@ -1120,16 +1204,16 @@ actions: ) - res = s.access_control.get(key_id='') + res = s.stream.start_pull(id='') - if res.signing_key is not None: + if res is not None: # handle response pass - - target: $["paths"]["/stream"]["post"] + - target: $["paths"]["/multistream/target"]["post"] update: x-codeSamples: - lang: python - label: createStream + label: createMultistreamTarget source: |- import livepeer from livepeer.models import components @@ -1139,161 +1223,77 @@ actions: ) - res = s.stream.create(request=components.NewStreamPayload( - name='test_stream', - pull=components.Pull( - source='https://myservice.com/live/stream.flv', - headers={ - 'Authorization': 'Bearer 123', - }, - location=components.Location( - lat=39.739, - lon=-104.988, - ), - ), - playback_policy=components.PlaybackPolicy( - type=components.Type.WEBHOOK, - webhook_id='1bde4o2i6xycudoy', - webhook_context={ - 'streamerId': 'my-custom-id', - }, - refresh_interval=600, - ), - profiles=[ - components.FfmpegProfile( - width=1280, - name='720p', - height=486589, - bitrate=3000000, - fps=30, - fps_den=1, - quality=23, - gop='2', - profile=components.Profile.H264_BASELINE, - ), - ], - record=False, - recording_spec=components.NewStreamPayloadRecordingSpec( - profiles=[ - components.TranscodeProfile( - width=1280, - name='720p', - bitrate=3000000, - quality=23, - fps=30, - fps_den=1, - gop='2', - profile=components.TranscodeProfileProfile.H264_BASELINE, - encoder=components.TranscodeProfileEncoder.H_264, - ), - ], - ), - multistream=components.Multistream( - targets=[ - components.Target( - profile='720p', - video_only=False, - id='PUSH123', - spec=components.TargetSpec( - name='My target', - url='rtmps://live.my-service.tv/channel/secretKey', - ), - ), - ], - ), + res = s.multistream.create(request=components.MultistreamTargetInput( + url='rtmps://live.my-service.tv/channel/secretKey', )) - if res.stream is not None: + if res.multistream_target is not None: # handle response pass - - target: $["paths"]["/webhook/{id}"]["put"] + - target: $["paths"]["/webhook/{id}"]["delete"] update: x-codeSamples: - lang: python - label: updateWebhook + label: deleteWebhook source: |- import livepeer - from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.webhook.update(id='', webhook=components.WebhookInput( - name='test_webhook', - project_id='aac12556-4d65-4d34-9fb6-d1f0985eb0a9', - events=[ - components.Events.STREAM_STARTED, - components.Events.STREAM_IDLE, - ], - url='https://my-service.com/webhook', - shared_secret='my-secret', - stream_id='de7818e7-610a-4057-8f6f-b785dc1e6f88', - )) + res = s.webhook.delete(id='') if res.webhook is not None: # handle response pass - - target: $["paths"]["/multistream/target"]["get"] - update: - x-codeSamples: - - lang: python - label: getMultistreamTargets - source: |- - import livepeer - - s = livepeer.Livepeer( - api_key="", - ) - - - res = s.multistream.get_all() - - if res.data is not None: - # handle response - pass - - target: $["paths"]["/multistream/target/{id}"]["get"] + - target: $["paths"]["/room/{id}/user/{userId}"]["put"] update: x-codeSamples: - lang: python - label: getMultistreamTarget + label: updateRoomUser source: |- import livepeer + from livepeer.models import components s = livepeer.Livepeer( api_key="", ) - res = s.multistream.get(id='') + res = s.room.update_user(id='', user_id='', room_user_update_payload=components.RoomUserUpdatePayload( + can_publish=True, + can_publish_data=True, + )) - if res.multistream_target is not None: + if res is not None: # handle response pass - - target: $["paths"]["/webhook/{id}"]["get"] + - target: $["paths"]["/data/views/query"]["get"] update: x-codeSamples: - lang: python - label: getWebhook + label: getViewershipMetrics source: |- import livepeer + from livepeer.models import operations s = livepeer.Livepeer( api_key="", ) - res = s.webhook.get(id='') + res = s.metrics.get_viewership(request=operations.GetViewershipMetricsRequest()) - if res.webhook is not None: + if res.data is not None: # handle response pass - - target: $["paths"]["/playback/{id}"]["get"] + - target: $["paths"]["/task"]["get"] update: x-codeSamples: - lang: python - label: getPlaybackInfo + label: getTasks source: |- import livepeer @@ -1302,8 +1302,8 @@ actions: ) - res = s.playback.get(id='') + res = s.task.get_all() - if res.playback_info is not None: + if res.data is not None: # handle response pass diff --git a/setup.py b/setup.py index 5c199aa..2c7bb51 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ setuptools.setup( name='livepeer', - version='0.0.9', + version='0.1.0', author='Livepeer', description='Python Client SDK for Livepeer Studio', url='https://github.com/livepeer/livepeer-python.git', diff --git a/src/livepeer/sdkconfiguration.py b/src/livepeer/sdkconfiguration.py index 5689778..29f7a82 100644 --- a/src/livepeer/sdkconfiguration.py +++ b/src/livepeer/sdkconfiguration.py @@ -23,9 +23,9 @@ class SDKConfiguration: server_idx: Optional[int] = 0 language: str = 'python' openapi_doc_version: str = '1.0.0' - sdk_version: str = '0.0.9' - gen_version: str = '2.359.1' - user_agent: str = 'speakeasy-sdk/python 0.0.9 2.359.1 1.0.0 livepeer' + sdk_version: str = '0.1.0' + gen_version: str = '2.366.1' + user_agent: str = 'speakeasy-sdk/python 0.1.0 2.366.1 1.0.0 livepeer' retry_config: Optional[RetryConfig] = None def __post_init__(self):