diff --git a/.gitignore b/.gitignore index 4949179..ecc58ab 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.speakeasy/temp/ +.speakeasy/reports .venv/ pyrightconfig.json README-PYPI.md diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 506f7b0..2f2a8e4 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 8c3ff122-1fb8-439c-8680-989f956dfd8d management: - docChecksum: a4f46cb330dd59f1f60caa6eaccdbd3b + docChecksum: d5178fea7af23529e09cd3b74d1d23c1 docVersion: 1.0.0 - speakeasyVersion: 1.399.0 - generationVersion: 2.415.8 - releaseVersion: 0.3.0 - configChecksum: e2a3f034034c8b68bbb6d9b34363d9f6 + speakeasyVersion: 1.540.0 + generationVersion: 2.593.3 + releaseVersion: 0.4.0 + configChecksum: d9bccc66803b552bc19dea010682a30c repoURL: https://github.com/livepeer/livepeer-python.git installationURL: https://github.com/livepeer/livepeer-python.git published: true @@ -14,31 +14,31 @@ features: python: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 - constsAndDefaults: 1.0.2 - core: 5.5.3 + constsAndDefaults: 1.0.5 + core: 5.16.0 defaultEnabledRetries: 0.2.0 - deprecations: 3.0.0 + deprecations: 3.0.2 enumUnions: 0.1.0 - envVarSecurityUsage: 0.3.1 + envVarSecurityUsage: 0.3.2 errorUnions: 1.0.2 - flattening: 3.0.0 - globalSecurity: 3.0.2 + flattening: 3.1.1 + globalSecurity: 3.0.3 globalSecurityCallbacks: 1.0.0 globalSecurityFlattening: 1.0.0 - globalServerURLs: 3.0.0 + globalServerURLs: 3.1.0 inputOutputModels: 3.0.0 multipartFileContentType: 1.0.0 - nameOverrides: 3.0.0 - nullables: 1.0.0 - responseFormat: 1.0.0 + nameOverrides: 3.0.1 + nullables: 1.0.1 + responseFormat: 1.0.1 retries: 3.0.2 - sdkHooks: 1.0.0 - unions: 3.0.2 + sdkHooks: 1.0.1 + unions: 3.0.4 uploadStreams: 1.0.0 generatedFiles: - .gitattributes + - .python-version - .vscode/settings.json - - CONTRIBUTING.md - USAGE.md - docs/models/components/apierror.md - docs/models/components/asset.md @@ -63,6 +63,7 @@ generatedFiles: - docs/models/components/bodygenimagetoimage.md - docs/models/components/bodygenimagetovideo.md - docs/models/components/bodygenimagetovideoimage.md + - docs/models/components/bodygenllm.md - docs/models/components/bodygensegmentanything2.md - docs/models/components/bodygensegmentanything2image.md - docs/models/components/bodygenupscale.md @@ -82,7 +83,9 @@ generatedFiles: - docs/models/components/domain.md - docs/models/components/dvrplayback.md - docs/models/components/encoder.md + - docs/models/components/encryption.md - docs/models/components/encryptionoutput.md + - docs/models/components/error.md - docs/models/components/events.md - docs/models/components/export.md - docs/models/components/exportdata.md @@ -113,6 +116,7 @@ generatedFiles: - docs/models/components/ismobile1.md - docs/models/components/lastfailure.md - docs/models/components/live.md + - docs/models/components/llmresponse.md - docs/models/components/loc.md - docs/models/components/location.md - docs/models/components/masksresponse.md @@ -122,7 +126,7 @@ generatedFiles: - docs/models/components/mp4.md - docs/models/components/multistream.md - docs/models/components/multistreamtarget.md - - docs/models/components/multistreamtargetpatchpayload.md + - docs/models/components/multistreamtargetinput.md - docs/models/components/name.md - docs/models/components/newassetfromurlpayload.md - docs/models/components/newassetpayload.md @@ -188,6 +192,8 @@ generatedFiles: - docs/models/components/streampull.md - docs/models/components/streamrecordingspec.md - docs/models/components/streamusertags.md + - docs/models/components/studioapierror.md + - docs/models/components/target.md - docs/models/components/targetaddpayload.md - docs/models/components/targetaddpayloadspec.md - docs/models/components/targetoutput.md @@ -230,8 +236,10 @@ generatedFiles: - docs/models/components/videospec.md - docs/models/components/viewershipmetric.md - docs/models/components/webhook.md + - docs/models/components/webhookinput.md - docs/models/components/webhooklog.md - docs/models/errors/error.md + - docs/models/errors/genaudiototextgenerateresponse415responsebody.md - docs/models/errors/genaudiototextgenerateresponse422responsebody.md - docs/models/errors/genaudiototextgenerateresponse500responsebody.md - docs/models/errors/genaudiototextgenerateresponsebody.md @@ -245,6 +253,10 @@ generatedFiles: - docs/models/errors/genimagetovideogenerateresponsebody.md - docs/models/errors/genimagetovideogenerateresponseresponsebody.md - docs/models/errors/genimagetovideoresponsebody.md + - docs/models/errors/genllmgenerateresponse500responsebody.md + - docs/models/errors/genllmgenerateresponsebody.md + - docs/models/errors/genllmgenerateresponseresponsebody.md + - docs/models/errors/genllmresponsebody.md - docs/models/errors/gensegmentanything2generateresponse500responsebody.md - docs/models/errors/gensegmentanything2generateresponsebody.md - docs/models/errors/gensegmentanything2generateresponseresponsebody.md @@ -291,6 +303,7 @@ generatedFiles: - docs/models/operations/genaudiototextresponse.md - docs/models/operations/genimagetoimageresponse.md - docs/models/operations/genimagetovideoresponse.md + - docs/models/operations/genllmresponse.md - docs/models/operations/gensegmentanything2response.md - docs/models/operations/gentexttoimageresponse.md - docs/models/operations/genupscaleresponse.md @@ -405,19 +418,20 @@ generatedFiles: - py.typed - pylintrc - pyproject.toml - - scripts/compile.sh - - scripts/prepare-readme.py + - scripts/prepare_readme.py - scripts/publish.sh - src/livepeer/__init__.py - src/livepeer/_hooks/__init__.py - src/livepeer/_hooks/sdkhooks.py - src/livepeer/_hooks/types.py + - src/livepeer/_version.py - src/livepeer/accesscontrol.py - src/livepeer/asset.py - src/livepeer/basesdk.py - src/livepeer/generate.py - src/livepeer/httpclient.py - src/livepeer/metrics.py + - src/livepeer/models/__init__.py - src/livepeer/models/components/__init__.py - src/livepeer/models/components/apierror.py - src/livepeer/models/components/asset.py @@ -426,6 +440,7 @@ generatedFiles: - src/livepeer/models/components/body_genaudiototext.py - src/livepeer/models/components/body_genimagetoimage.py - src/livepeer/models/components/body_genimagetovideo.py + - src/livepeer/models/components/body_genllm.py - src/livepeer/models/components/body_gensegmentanything2.py - src/livepeer/models/components/body_genupscale.py - src/livepeer/models/components/chunk.py @@ -434,6 +449,7 @@ generatedFiles: - src/livepeer/models/components/creator_id.py - src/livepeer/models/components/encryption.py - src/livepeer/models/components/encryption_output.py + - src/livepeer/models/components/error.py - src/livepeer/models/components/export_task_params.py - src/livepeer/models/components/ffmpeg_profile.py - src/livepeer/models/components/get_room_user_response.py @@ -442,12 +458,12 @@ generatedFiles: - src/livepeer/models/components/input_creator_id.py - src/livepeer/models/components/ipfs_export_params.py - src/livepeer/models/components/ipfs_file_info.py + - src/livepeer/models/components/llmresponse.py - src/livepeer/models/components/masksresponse.py - src/livepeer/models/components/media.py - src/livepeer/models/components/multistream.py - src/livepeer/models/components/multistream_target.py - src/livepeer/models/components/multistream_target_input.py - - src/livepeer/models/components/multistream_target_patch_payload.py - src/livepeer/models/components/new_asset_from_url_payload.py - src/livepeer/models/components/new_asset_payload.py - src/livepeer/models/components/new_stream_payload.py @@ -469,6 +485,7 @@ generatedFiles: - src/livepeer/models/components/storage_status.py - src/livepeer/models/components/stream.py - src/livepeer/models/components/stream_patch_payload.py + - src/livepeer/models/components/studio_api_error.py - src/livepeer/models/components/target.py - src/livepeer/models/components/target_add_payload.py - src/livepeer/models/components/target_output.py @@ -489,6 +506,7 @@ generatedFiles: - src/livepeer/models/errors/genaudiototext.py - src/livepeer/models/errors/genimagetoimage.py - src/livepeer/models/errors/genimagetovideo.py + - src/livepeer/models/errors/genllm.py - src/livepeer/models/errors/gensegmentanything2.py - src/livepeer/models/errors/gentexttoimage.py - src/livepeer/models/errors/genupscale.py @@ -515,6 +533,7 @@ generatedFiles: - src/livepeer/models/operations/genaudiototext.py - src/livepeer/models/operations/genimagetoimage.py - src/livepeer/models/operations/genimagetovideo.py + - src/livepeer/models/operations/genllm.py - src/livepeer/models/operations/gensegmentanything2.py - src/livepeer/models/operations/gentexttoimage.py - src/livepeer/models/operations/genupscale.py @@ -574,6 +593,7 @@ generatedFiles: - src/livepeer/types/basemodel.py - src/livepeer/utils/__init__.py - src/livepeer/utils/annotations.py + - src/livepeer/utils/datetimes.py - src/livepeer/utils/enums.py - src/livepeer/utils/eventstreaming.py - src/livepeer/utils/forms.py @@ -592,17 +612,17 @@ examples: createStream: speakeasy-default-create-stream: requestBody: - application/json: {"name": "test_stream", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [], "record": false, "recordingSpec": {"profiles": []}, "multistream": {"targets": [{"profile": "720p", "videoOnly": false, "id": "PUSH123", "spec": {"name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey"}}]}} + application/json: {"name": "test_stream", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "record": false, "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}, "multistream": {"targets": [{"profile": "720p0", "videoOnly": false, "id": "PUSH123", "spec": {"name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey"}}]}} responses: "201": - application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_stream", "creatorId": {"type": "unverified", "value": "user123"}, "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "isActive": true, "createdByTokenName": "abc-123-xyz-456", "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "streamKey": "hgebdhhigq", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackId": "eaw4nk06ts2d0mzb", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [], "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "recordingSpec": {"profiles": []}, "multistream": {"targets": [{"profile": "720p", "videoOnly": false, "id": "PUSH123"}]}, "lastTerminatedAt": 1713281212993} + application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_stream", "creatorId": {"type": "unverified", "value": "user123"}, "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "isActive": true, "createdByTokenName": "abc-123-xyz-456", "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "streamKey": "hgebdhhigq", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackId": "eaw4nk06ts2d0mzb", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}, "multistream": {"targets": [{"profile": "720p0", "videoOnly": false, "id": "PUSH123"}]}, "lastTerminatedAt": 1713281212993} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getStreams: speakeasy-default-get-streams: responses: "200": - application/json: [] + application/json: [{"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_stream", "creatorId": {"type": "unverified", "value": "user123"}, "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "isActive": true, "createdByTokenName": "abc-123-xyz-456", "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "streamKey": "hgebdhhigq", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackId": "eaw4nk06ts2d0mzb", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}, "multistream": {"targets": [{"profile": "720p0", "videoOnly": false, "id": "PUSH123"}]}, "lastTerminatedAt": 1713281212993}, {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_stream", "creatorId": {"type": "unverified", "value": "user123"}, "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "isActive": true, "createdByTokenName": "abc-123-xyz-456", "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "streamKey": "hgebdhhigq", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackId": "eaw4nk06ts2d0mzb", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}, "multistream": {"targets": [{"profile": "720p0", "videoOnly": false, "id": "PUSH123"}]}, "lastTerminatedAt": 1713281212993}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getStream: @@ -612,7 +632,7 @@ examples: id: "" responses: "200": - application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_stream", "creatorId": {"type": "unverified", "value": "user123"}, "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "isActive": true, "createdByTokenName": "abc-123-xyz-456", "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "streamKey": "hgebdhhigq", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackId": "eaw4nk06ts2d0mzb", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [], "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "recordingSpec": {"profiles": []}, "multistream": {"targets": [{"profile": "720p", "videoOnly": false, "id": "PUSH123"}]}, "lastTerminatedAt": 1713281212993} + application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_stream", "creatorId": {"type": "unverified", "value": "user123"}, "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "isActive": true, "createdByTokenName": "abc-123-xyz-456", "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "streamKey": "hgebdhhigq", "pull": {"source": "https://myservice.com/live/stream.flv", "headers": {"Authorization": "Bearer 123"}, "location": {"lat": 39.739, "lon": -104.988}}, "playbackId": "eaw4nk06ts2d0mzb", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}, "multistream": {"targets": [{"profile": "720p0", "videoOnly": false, "id": "PUSH123"}]}, "lastTerminatedAt": 1713281212993} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} updateStream: @@ -621,7 +641,7 @@ examples: path: id: "" requestBody: - application/json: {"record": false, "multistream": {"targets": [{"profile": "720p", "videoOnly": false, "id": "PUSH123", "spec": {"name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey"}}]}, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [], "recordingSpec": {"profiles": []}} + application/json: {"record": false, "multistream": {"targets": [{"profile": "720p0", "videoOnly": false, "id": "PUSH123", "spec": {"name": "My target", "url": "rtmps://live.my-service.tv/channel/secretKey"}}]}, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}, "name": "test_stream"} responses: default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} @@ -655,7 +675,7 @@ examples: application/json: {"playbackId": "eaw4nk06ts2d0mzb", "startTime": 1587667174725, "endTime": 1587667174725, "name": "My Clip", "sessionId": "de7818e7-610a-4057-8f6f-b785dc1e6f88"} responses: "200": - application/json: {"asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "directUpload"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "failed", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} + application/json: {"asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "clip"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "failed", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getClips: @@ -665,7 +685,7 @@ examples: id: "" responses: "200": - application/json: [] + application/json: [{"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "clip"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "ready", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} addMultistreamTarget: @@ -683,7 +703,7 @@ examples: parameters: path: id: "" - targetId: "" + targetId: "" responses: default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} @@ -691,7 +711,7 @@ examples: speakeasy-default-get-multistream-targets: responses: "200": - application/json: [] + application/json: [{"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "createdAt": 1587667174725}, {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "createdAt": 1587667174725}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} createMultistreamTarget: @@ -735,7 +755,7 @@ examples: speakeasy-default-get-webhooks: responses: "200": - application/json: [] + application/json: [{"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_webhook", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "events": ["stream.started", "stream.idle"], "url": "https://my-service.com/webhook", "streamId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "status": {"lastFailure": {"timestamp": 1587667174725, "error": "Error message", "response": "Response body", "statusCode": 500}, "lastTriggeredAt": 1587667174725}}, {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_webhook", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "events": ["stream.started", "stream.idle"], "url": "https://my-service.com/webhook", "streamId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "status": {"lastFailure": {"timestamp": 1587667174725, "error": "Error message", "response": "Response body", "statusCode": 500}, "lastTriggeredAt": 1587667174725}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} createWebhook: @@ -786,7 +806,7 @@ examples: id: "" responses: "200": - application/json: [] + application/json: [{"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "webhookId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "event": "stream.started", "createdAt": 1587667174725, "duration": 0.5, "success": true, "request": {"url": "https://my-service.com/webhook", "method": "POST", "headers": {"User-Agent": "livepeer.studio"}, "body": "{\"event\": \"stream.started\"}"}}, {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "webhookId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "event": "stream.started", "createdAt": 1587667174725, "duration": 0.5, "success": true, "request": {"url": "https://my-service.com/webhook", "method": "POST", "headers": {"User-Agent": "livepeer.studio"}, "body": "{\"event\": \"stream.started\"}"}}, {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "webhookId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "event": "stream.started", "createdAt": 1587667174725, "duration": 0.5, "success": true, "request": {"url": "https://my-service.com/webhook", "method": "POST", "headers": {"User-Agent": "livepeer.studio"}, "body": "{\"event\": \"stream.started\"}"}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getWebhookLog: @@ -794,7 +814,7 @@ examples: parameters: path: id: "" - logId: "" + logId: "" responses: "200": application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "webhookId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "event": "stream.started", "createdAt": 1587667174725, "duration": 0.5, "success": true, "request": {"url": "https://my-service.com/webhook", "method": "POST", "headers": {"User-Agent": "livepeer.studio"}, "body": "{\"event\": \"stream.started\"}"}} @@ -805,7 +825,7 @@ examples: parameters: path: id: "" - logId: "" + logId: "" responses: "200": application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "webhookId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "event": "stream.started", "createdAt": 1587667174725, "duration": 0.5, "success": true, "request": {"url": "https://my-service.com/webhook", "method": "POST", "headers": {"User-Agent": "livepeer.studio"}, "body": "{\"event\": \"stream.started\"}"}} @@ -815,56 +835,56 @@ examples: speakeasy-default-get-assets: responses: "200": - application/json: [] + application/json: [{"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "url", "url": "https://puzzled-adviser.info"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "uploading", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}, {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "url", "url": "https://yummy-concentration.info/"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "failed", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} requestUpload: speakeasy-default-request-upload: requestBody: - application/json: {"name": "filename.mp4", "staticMp4": true, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": []} + application/json: {"name": "filename.mp4", "staticMp4": true, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]} responses: "200": - application/json: {"url": "https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q", "tusEndpoint": "https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q", "asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "recording", "sessionId": ""}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "ready", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} + application/json: {"url": "https://origin.livepeer.com/api/asset/upload/direct?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q", "tusEndpoint": "https://origin.livepeer.com/api/asset/upload/tus?token=eyJhbGciOiJIUzI1NiJ9.eyJtc2ciOiJoZWxsbyBoYWNrZXIsIHRoZXJlJ3Mgbm90aGluZyBmb3IgeW91IGhlcmUg8J-YhiJ9.1YDjmXsqLcgNyMSzT4kXl_kIni46_EuGX_xfqmC7e0Q", "asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "recording", "sessionId": ""}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "uploading", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} uploadAsset: speakeasy-default-upload-asset: requestBody: - application/json: {"name": "filename.mp4", "staticMp4": true, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4", "profiles": []} + application/json: {"name": "filename.mp4", "staticMp4": true, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4", "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]} responses: "200": - application/json: {"asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "recording", "sessionId": ""}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "waiting", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} + application/json: {"asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "url", "url": "https://creative-tenant.com/"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "ready", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} "201": - application/json: {"asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "url", "url": "http://dutiful-colorlessness.com"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "uploading", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} + application/json: {"asset": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "directUpload"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "deleted", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}, "task": {"id": "34d7618e-fd42-4798-acf5-19504616a11e"}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getAsset: speakeasy-default-get-asset: parameters: path: - assetId: "" + assetId: "" responses: "200": - application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "directUpload"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "ready", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}} + application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "clip"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "ready", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} updateAsset: speakeasy-default-update-asset: parameters: path: - assetId: "" + assetId: "" requestBody: application/json: {"name": "filename.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}} responses: "200": - application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "directUpload"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "failed", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}} + application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "clip"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "deleted", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} deleteAsset: speakeasy-default-delete-asset: parameters: path: - assetId: "" + assetId: "" responses: default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} @@ -875,14 +895,14 @@ examples: id: "" responses: "200": - application/json: [] + application/json: [{"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "clip"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "ready", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getSessions: speakeasy-default-get-sessions: responses: "200": - application/json: [] + application/json: [{"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_session", "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "playbackId": "eaw4nk06ts2d0mzb", "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}}, {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_session", "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "playbackId": "eaw4nk06ts2d0mzb", "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getSession: @@ -892,19 +912,19 @@ examples: id: "" responses: "200": - application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_session", "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "playbackId": "eaw4nk06ts2d0mzb", "profiles": [], "recordingSpec": {"profiles": []}} + application/json: {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_session", "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "playbackId": "eaw4nk06ts2d0mzb", "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getRecordedSessions: speakeasy-default-get-recorded-sessions: parameters: path: - parentId: "" + parentId: "" query: record: true responses: "200": - application/json: [] + application/json: [{"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_session", "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "playbackId": "eaw4nk06ts2d0mzb", "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}}, {"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "name": "test_session", "lastSeen": 1587667174725, "sourceSegments": 1, "transcodedSegments": 2, "sourceSegmentsDuration": 1, "transcodedSegmentsDuration": 2, "sourceBytes": 1, "transcodedBytes": 2, "ingestRate": 1, "outgoingRate": 2, "createdAt": 1587667174725, "parentId": "de7818e7-610a-4057-8f6f-b785dc1e6f88", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "record": false, "playbackId": "eaw4nk06ts2d0mzb", "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "fps": 30, "fpsDen": 1, "quality": 23, "gop": "2", "profile": "H264Baseline"}], "recordingSpec": {"profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} createRoom: @@ -921,7 +941,7 @@ examples: id: "" responses: "200": - application/json: {"id": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "createdAt": 1587667174725, "updatedAt": 1587667174725} + application/json: {"id": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "createdAt": 1587667174725, "updatedAt": 1587667174725, "participants": {"key": {}, "key1": {}}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} deleteRoom: @@ -967,7 +987,7 @@ examples: parameters: path: id: "" - userId: "" + userId: "" responses: "200": application/json: {"id": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "joinedAt": 1687517025261, "name": "name", "isPublisher": true} @@ -978,7 +998,7 @@ examples: parameters: path: id: "" - userId: "" + userId: "" requestBody: application/json: {"canPublish": true, "canPublishData": true} responses: @@ -989,7 +1009,7 @@ examples: parameters: path: id: "" - userId: "" + userId: "" responses: default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} @@ -997,28 +1017,28 @@ examples: speakeasy-default-get-realtime-viewership-now: responses: "200": - application/json: [] + application/json: [{"playbackId": "1bde4o2i6xycudoy", "device": "iPhone", "browser": "Safari", "country": "United States", "viewCount": 100, "errorRate": 0.1}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getViewershipMetrics: speakeasy-default-get-viewership-metrics: responses: "200": - application/json: [] + application/json: [{"playbackId": "1bde4o2i6xycudoy", "creatorId": "john@doe.com", "viewerId": "1bde4o2i6xycudoy", "dStorageUrl": "ipfs://QmZ4", "timestamp": 1587667174725, "device": "iPhone", "deviceType": "mobile", "cpu": "ARM", "os": "iOS", "browser": "Safari", "browserEngine": "WebKit", "continent": "North America", "country": "United States", "subdivision": "California", "timezone": "America/Los_Angeles", "geohash": "123", "viewCount": 100, "playtimeMins": 10, "ttffMs": 100, "rebufferRatio": 0.1, "errorRate": 0.1, "exitsBeforeStart": 0.5}, {"playbackId": "1bde4o2i6xycudoy", "creatorId": "john@doe.com", "viewerId": "1bde4o2i6xycudoy", "dStorageUrl": "ipfs://QmZ4", "timestamp": 1587667174725, "device": "iPhone", "deviceType": "mobile", "cpu": "ARM", "os": "iOS", "browser": "Safari", "browserEngine": "WebKit", "continent": "North America", "country": "United States", "subdivision": "California", "timezone": "America/Los_Angeles", "geohash": "123", "viewCount": 100, "playtimeMins": 10, "ttffMs": 100, "rebufferRatio": 0.1, "errorRate": 0.1, "exitsBeforeStart": 0.5}, {"playbackId": "1bde4o2i6xycudoy", "creatorId": "john@doe.com", "viewerId": "1bde4o2i6xycudoy", "dStorageUrl": "ipfs://QmZ4", "timestamp": 1587667174725, "device": "iPhone", "deviceType": "mobile", "cpu": "ARM", "os": "iOS", "browser": "Safari", "browserEngine": "WebKit", "continent": "North America", "country": "United States", "subdivision": "California", "timezone": "America/Los_Angeles", "geohash": "123", "viewCount": 100, "playtimeMins": 10, "ttffMs": 100, "rebufferRatio": 0.1, "errorRate": 0.1, "exitsBeforeStart": 0.5}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getCreatorViewershipMetrics: speakeasy-default-get-creator-viewership-metrics: responses: "200": - application/json: [] + application/json: [{"playbackId": "1bde4o2i6xycudoy", "creatorId": "john@doe.com", "viewerId": "1bde4o2i6xycudoy", "dStorageUrl": "ipfs://QmZ4", "timestamp": 1587667174725, "device": "iPhone", "deviceType": "mobile", "cpu": "ARM", "os": "iOS", "browser": "Safari", "browserEngine": "WebKit", "continent": "North America", "country": "United States", "subdivision": "California", "timezone": "America/Los_Angeles", "geohash": "123", "viewCount": 100, "playtimeMins": 10, "ttffMs": 100, "rebufferRatio": 0.1, "errorRate": 0.1, "exitsBeforeStart": 0.5}, {"playbackId": "1bde4o2i6xycudoy", "creatorId": "john@doe.com", "viewerId": "1bde4o2i6xycudoy", "dStorageUrl": "ipfs://QmZ4", "timestamp": 1587667174725, "device": "iPhone", "deviceType": "mobile", "cpu": "ARM", "os": "iOS", "browser": "Safari", "browserEngine": "WebKit", "continent": "North America", "country": "United States", "subdivision": "California", "timezone": "America/Los_Angeles", "geohash": "123", "viewCount": 100, "playtimeMins": 10, "ttffMs": 100, "rebufferRatio": 0.1, "errorRate": 0.1, "exitsBeforeStart": 0.5}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getPublicViewershipMetrics: speakeasy-default-get-public-viewership-metrics: parameters: path: - playbackId: "" + playbackId: "" responses: "200": application/json: {"playbackId": "1bde4o2i6xycudoy", "dStorageUrl": "ipfs://QmZ4", "viewCount": 100, "playtimeMins": 10} @@ -1042,14 +1062,14 @@ examples: speakeasy-default-get-signing-keys: responses: "200": - application/json: [] + application/json: [{"id": "78df0075-b5f3-4683-a618-1086faca35dc", "name": "key1", "createdAt": 1587667174725, "lastSeen": 1587667174725, "publicKey": "", "disabled": false, "projectId": "aac12556-4d65-4d34-9fb"}, {"id": "78df0075-b5f3-4683-a618-1086faca35dc", "name": "key1", "createdAt": 1587667174725, "lastSeen": 1587667174725, "publicKey": "", "disabled": false, "projectId": "aac12556-4d65-4d34-9fb"}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} deleteSigningKey: speakeasy-default-delete-signing-key: parameters: path: - keyId: "" + keyId: "" responses: default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} @@ -1057,7 +1077,7 @@ examples: speakeasy-default-get-signing-key: parameters: path: - keyId: "" + keyId: "" responses: "200": application/json: {"id": "78df0075-b5f3-4683-a618-1086faca35dc", "name": "key1", "createdAt": 1587667174725, "lastSeen": 1587667174725, "publicKey": "", "disabled": false, "projectId": "aac12556-4d65-4d34-9fb"} @@ -1067,7 +1087,9 @@ examples: speakeasy-default-update-signing-key: parameters: path: - keyId: "" + keyId: "" + requestBody: + application/json: {} responses: default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} @@ -1075,24 +1097,24 @@ examples: speakeasy-default-get-tasks: responses: "200": - application/json: [] + application/json: [{"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "upload", "createdAt": 1587667174725, "scheduledAt": 1587667174725, "inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "params": {"upload": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4", "c2pa": true, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 6}, "export": {"ipfs": {"pinata": {"apiKey": "1234567890"}}}, "exportData": {"content": {}, "ipfs": {"pinata": {}}, "type": "text/plain", "id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}, "transcode-file": {"input": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4"}, "storage": {"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 10, "c2pa": false}, "clip": {"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "clipStrategy": {"startTime": 1587667174725, "endTime": 1587667174725, "playbackId": "eaw4nk06ts2d0mzb"}, "catalystPipelineStrategy": "catalyst_ffmpeg", "sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}, "status": {"phase": "pending", "updatedAt": 1587667174725, "progress": 0.5, "errorMessage": "Failed to upload file", "retries": 3}, "output": {"upload": {"assetSpec": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "recording", "sessionId": ""}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "deleting", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}}, "export": {"ipfs": {"videoFileCid": "Qmabc123xyz341", "videoFileUrl": "ipfs://Qmabc123xyz341", "videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341", "nftMetadataCid": "Qmabc123xyz341", "nftMetadataUrl": "ipfs://Qmabc123xyz341", "nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"}}, "exportData": {"ipfs": {"cid": "Qmabc123xyz341"}}}}, {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "upload", "createdAt": 1587667174725, "scheduledAt": 1587667174725, "inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "params": {"upload": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4", "c2pa": true, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 6}, "export": {"ipfs": {"pinata": {}}}, "exportData": {"content": {}, "ipfs": {"pinata": {}}, "type": "text/plain", "id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}, "transcode-file": {"input": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4"}, "storage": {"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 10, "c2pa": false}, "clip": {"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "clipStrategy": {"startTime": 1587667174725, "endTime": 1587667174725, "playbackId": "eaw4nk06ts2d0mzb"}, "catalystPipelineStrategy": "catalyst_ffmpeg", "sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}, "status": {"phase": "pending", "updatedAt": 1587667174725, "progress": 0.5, "errorMessage": "Failed to upload file", "retries": 3}, "output": {"upload": {"assetSpec": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "recording", "sessionId": ""}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "processing", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}}, "export": {"ipfs": {"videoFileCid": "Qmabc123xyz341", "videoFileUrl": "ipfs://Qmabc123xyz341", "videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341", "nftMetadataCid": "Qmabc123xyz341", "nftMetadataUrl": "ipfs://Qmabc123xyz341", "nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"}}, "exportData": {"ipfs": {"cid": "Qmabc123xyz341"}}}}] default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getTask: speakeasy-default-get-task: parameters: path: - taskId: "" + taskId: "" responses: "200": - application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "upload", "createdAt": 1587667174725, "scheduledAt": 1587667174725, "inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "params": {"upload": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4", "c2pa": true, "profiles": [], "targetSegmentSizeSecs": 6}, "export": {"ipfs": {}}, "exportData": {"ipfs": {"pinata": {"apiKey": "1234567890"}}, "type": "text/plain", "id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}, "transcode-file": {"input": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4"}, "storage": {"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}}, "profiles": [], "targetSegmentSizeSecs": 10, "c2pa": false}, "clip": {"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "clipStrategy": {"startTime": 1587667174725, "endTime": 1587667174725, "playbackId": "eaw4nk06ts2d0mzb"}, "catalystPipelineStrategy": "catalyst_ffmpeg", "sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}, "status": {"phase": "pending", "updatedAt": 1587667174725, "progress": 0.5, "errorMessage": "Failed to upload file", "retries": 3}, "output": {"upload": {"assetSpec": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "clip"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "deleting", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}}, "key": "", "key1": ""}, "export": {"ipfs": {"videoFileCid": "Qmabc123xyz341", "videoFileUrl": "ipfs://Qmabc123xyz341", "videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341", "nftMetadataCid": "Qmabc123xyz341", "nftMetadataUrl": "ipfs://Qmabc123xyz341", "nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"}}, "exportData": {"ipfs": {"cid": "Qmabc123xyz341"}}}} + application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "upload", "createdAt": 1587667174725, "scheduledAt": 1587667174725, "inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "params": {"upload": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4", "c2pa": true, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 6}, "export": {"ipfs": {"pinata": {"apiKey": "1234567890"}}}, "exportData": {"content": {}, "ipfs": {"pinata": {"apiKey": "1234567890"}}, "type": "text/plain", "id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}, "transcode-file": {"input": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4"}, "storage": {"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 10, "c2pa": false}, "clip": {"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "clipStrategy": {"startTime": 1587667174725, "endTime": 1587667174725, "playbackId": "eaw4nk06ts2d0mzb"}, "catalystPipelineStrategy": "catalyst_ffmpeg", "sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}, "status": {"phase": "pending", "updatedAt": 1587667174725, "progress": 0.5, "errorMessage": "Failed to upload file", "retries": 3}, "output": {"upload": {"assetSpec": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "recording", "sessionId": ""}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "waiting", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}}, "export": {"ipfs": {"videoFileCid": "Qmabc123xyz341", "videoFileUrl": "ipfs://Qmabc123xyz341", "videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341", "nftMetadataCid": "Qmabc123xyz341", "nftMetadataUrl": "ipfs://Qmabc123xyz341", "nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"}}, "exportData": {"ipfs": {"cid": "Qmabc123xyz341"}}}} transcodeVideo: speakeasy-default-transcode-video: requestBody: - application/json: {"input": {"url": "https://s3.amazonaws.com/bucket/file.mp4"}, "storage": {"type": "s3", "endpoint": "https://gateway.storjshare.io", "bucket": "outputbucket", "credentials": {"accessKeyId": "AKIAIOSFODNN7EXAMPLE", "secretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}, "fmp4": {"path": "/samplevideo/fmp4"}}, "profiles": []} + application/json: {"input": {"url": "https://s3.amazonaws.com/bucket/file.mp4"}, "storage": {"type": "web3.storage", "credentials": {"proof": "EaJlcm9vdHOAZ3ZlcnNpb24BmgIBcRIg2uxHpcPYSWNtifMKFkPC7IEDvFDCxCd3ADViv0coV7SnYXNYRO2hA0AnblHEW38s3lSlcwaDjPn"}}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}, "fmp4": {"path": "/samplevideo/fmp4"}}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}]} responses: "200": - application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "upload", "createdAt": 1587667174725, "scheduledAt": 1587667174725, "inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "params": {"upload": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4", "c2pa": true, "profiles": [], "targetSegmentSizeSecs": 6}, "export": {"ipfs": {"pinata": {"apiKey": "1234567890"}}}, "exportData": {"ipfs": {}, "type": "text/plain", "id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}, "transcode-file": {"input": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4"}, "storage": {"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}}, "profiles": [], "targetSegmentSizeSecs": 10, "c2pa": false}, "clip": {"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "clipStrategy": {"startTime": 1587667174725, "endTime": 1587667174725, "playbackId": "eaw4nk06ts2d0mzb"}, "catalystPipelineStrategy": "catalyst_ffmpeg", "sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}, "status": {"phase": "pending", "updatedAt": 1587667174725, "progress": 0.5, "errorMessage": "Failed to upload file", "retries": 3}, "output": {"upload": {"assetSpec": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "url", "url": "http://speedy-basil.org"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "deleting", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": []}}, "key": ""}, "export": {"ipfs": {"videoFileCid": "Qmabc123xyz341", "videoFileUrl": "ipfs://Qmabc123xyz341", "videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341", "nftMetadataCid": "Qmabc123xyz341", "nftMetadataUrl": "ipfs://Qmabc123xyz341", "nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"}}, "exportData": {"ipfs": {"cid": "Qmabc123xyz341"}}}} + application/json: {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "upload", "createdAt": 1587667174725, "scheduledAt": 1587667174725, "inputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "outputAssetId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "projectId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "requesterId": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "params": {"upload": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4", "c2pa": true, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 6}, "export": {"custom": {"url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=LLMMB", "method": "POST"}}, "exportData": {"content": {}, "ipfs": {"pinata": {"apiKey": "1234567890"}}, "type": "text/plain", "id": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}, "transcode-file": {"input": {"url": "https://cdn.livepeer.com/ABC123/filename.mp4"}, "storage": {"url": "s3+https://accessKeyId:secretAccessKey@s3Endpoint/bucket"}, "outputs": {"hls": {"path": "/samplevideo/hls"}, "mp4": {"path": "/samplevideo/mp4"}}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "targetSegmentSizeSecs": 10, "c2pa": false}, "clip": {"url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "clipStrategy": {"startTime": 1587667174725, "endTime": 1587667174725, "playbackId": "eaw4nk06ts2d0mzb"}, "catalystPipelineStrategy": "catalyst_ffmpeg", "sessionId": "d32ae9e6-c459-4931-9898-e86e2f5e7e16", "inputId": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}, "status": {"phase": "pending", "updatedAt": 1587667174725, "progress": 0.5, "errorMessage": "Failed to upload file", "retries": 3}, "output": {"upload": {"assetSpec": {"id": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "type": "video", "playbackId": "eaw4nk06ts2d0mzb", "playbackUrl": "https://livepeercdn.com/asset/ea03f37e-f861-4cdd-b495-0e60b6d753ad/index.m3u8", "downloadUrl": "https://livepeercdn.com/asset/eaw4nk06ts2d0mzb/video/download.mp4", "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": {"type": "url", "url": "https://brisk-seafood.net/"}, "creatorId": {"type": "unverified", "value": "user123"}, "profiles": [{"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}, {"width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, "quality": 23, "fps": 30, "fpsDen": 1, "gop": "2", "profile": "H264Baseline", "encoder": "H.264"}], "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}, "status": {"phase": "deleting", "updatedAt": 1587667174725}, "name": "filename.mp4", "projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", "createdAt": 1587667174725, "size": 84934509, "hash": [{"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}, {"hash": "9b560b28b85378a5004117539196ab24e21bbd75b0e9eb1a8bc7c5fd80dc5b57", "algorithm": "sha256"}], "videoSpec": {"format": "mp4", "duration": 23.8328, "bitrate": 1000000, "tracks": [{"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}, {"type": "video", "codec": "aac", "startTime": 23.8238, "duration": 23.8238, "bitrate": 1000000, "width": 1920, "height": 1080, "pixelFormat": "yuv420p", "fps": 30, "channels": 2, "sampleRate": 44100, "bitDepth": 16}]}}}, "export": {"ipfs": {"videoFileCid": "Qmabc123xyz341", "videoFileUrl": "ipfs://Qmabc123xyz341", "videoFileGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341", "nftMetadataCid": "Qmabc123xyz341", "nftMetadataUrl": "ipfs://Qmabc123xyz341", "nftMetadataGatewayUrl": "https://gateway.ipfs.io/ipfs/Qmabc123xyz341"}}, "exportData": {"ipfs": {"cid": "Qmabc123xyz341"}}}} default: application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} getPlaybackInfo: @@ -1102,7 +1124,7 @@ examples: id: "" responses: "200": - application/json: {"type": "vod", "meta": {"live": 0, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": [], "dvrPlayback": [], "attestation": {"id": "5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0", "primaryType": "VideoAttestation", "domain": {"name": "Verifiable Video", "version": "1"}, "message": {"video": "5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0", "attestations": [], "signer": "1311768467294899700", "timestamp": 1587667174725}, "signature": "1311768467294899700", "createdAt": 1587667174725, "signatureType": "eip712", "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}}}} + application/json: {"type": "vod", "meta": {"live": 0, "playbackPolicy": {"type": "webhook", "webhookId": "1bde4o2i6xycudoy", "webhookContext": {"streamerId": "my-custom-id"}, "refreshInterval": 600}, "source": [{"hrn": "MP4", "type": "html5/video/mp4", "url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "size": 494778, "width": 204, "height": 360, "bitrate": 449890}, {"hrn": "MP4", "type": "html5/video/mp4", "url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4", "size": 494778, "width": 204, "height": 360, "bitrate": 449890}], "dvrPlayback": [{"hrn": "HLS (TS)", "type": "html5/application/vnd.apple.mpegurl", "url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4"}, {"hrn": "HLS (TS)", "type": "html5/application/vnd.apple.mpegurl", "url": "https://asset-cdn.lp-playback.monster/hls/1bde4o2i6xycudoy/static360p0.mp4"}], "attestation": {"id": "5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0", "primaryType": "VideoAttestation", "domain": {"name": "Verifiable Video", "version": "1"}, "message": {"video": "5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0", "attestations": [{"role": "creator", "address": "1311768467294899700"}, {"role": "creator", "address": "1311768467294899700"}], "signer": "1311768467294899700", "timestamp": 1587667174725}, "signature": "1311768467294899700", "createdAt": 1587667174725, "signatureType": "eip712", "storage": {"ipfs": {"updatedAt": 1587667174725}, "status": {"phase": "ready", "progress": 0.5, "errorMessage": "Failed to update storage", "tasks": {"pending": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "last": "09F8B46C-61A0-4254-9875-F71F4C605BC7", "failed": "09F8B46C-61A0-4254-9875-F71F4C605BC7"}}}}}} "404": application/json: {"errors": ["[\"id not provided\",\"Account not found\"]"]} default: @@ -1110,29 +1132,29 @@ examples: genTextToImage: speakeasy-default-gen-text-to-image: requestBody: - application/json: {"prompt": ""} + application/json: {"model_id": "SG161222/RealVisXL_V4.0_Lightning", "loras": "", "prompt": "", "height": 576, "width": 1024, "guidance_scale": 7.5, "negative_prompt": "", "safety_check": true, "num_inference_steps": 50, "num_images_per_prompt": 1} responses: "200": - application/json: {"images": []} + application/json: {"images": [{"url": "https://hateful-cruelty.name", "seed": 857392, "nsfw": true}]} "400": application/json: {"detail": {"msg": ""}, "": {}} "401": - application/json: {"": {}} + application/json: {"detail": {"msg": ""}, "": {}} "422": application/json: {"": {}} "500": - application/json: {"": {}} + application/json: {"detail": {"msg": ""}, "": {}} default: application/json: {"": {}} genImageToImage: speakeasy-default-gen-image-to-image: requestBody: - multipart/form-data: {"prompt": "", "image": {}} + multipart/form-data: {"prompt": "", "image": {}, "model_id": "timbrooks/instruct-pix2pix", "loras": "", "strength": 0.8, "guidance_scale": 7.5, "image_guidance_scale": 1.5, "negative_prompt": "", "safety_check": true, "num_inference_steps": 100, "num_images_per_prompt": 1} responses: "200": - application/json: {"images": []} + application/json: {"images": [{"url": "https://selfish-operating.name/", "seed": 976514, "nsfw": false}]} "400": - application/json: {"detail": {"msg": ""}, "": {}} + application/json: {"": {}} "401": application/json: {"detail": {"msg": ""}, "": {}} "422": @@ -1144,14 +1166,14 @@ examples: genImageToVideo: speakeasy-default-gen-image-to-video: requestBody: - multipart/form-data: {"image": {}} + multipart/form-data: {"image": {}, "model_id": "stabilityai/stable-video-diffusion-img2vid-xt-1-1", "height": 576, "width": 1024, "fps": 6, "motion_bucket_id": 127, "noise_aug_strength": 0.02, "safety_check": true, "num_inference_steps": 25} responses: "200": - application/json: {"images": []} + application/json: {"images": [{"url": "https://low-handover.name/", "seed": 87160, "nsfw": true}]} "400": application/json: {"detail": {"msg": ""}, "": {}} "401": - application/json: {"detail": {"msg": ""}, "": {}} + application/json: {"": {}} "422": application/json: {"": {}} "500": @@ -1161,14 +1183,14 @@ examples: genUpscale: speakeasy-default-gen-upscale: requestBody: - multipart/form-data: {"prompt": "", "image": {}} + multipart/form-data: {"prompt": "", "image": {}, "model_id": "stabilityai/stable-diffusion-x4-upscaler", "safety_check": true, "num_inference_steps": 75} responses: "200": - application/json: {"images": []} + application/json: {"images": [{"url": "https://bogus-typewriter.net", "seed": 311567, "nsfw": false}]} "400": - application/json: {"detail": {"msg": ""}, "": {}} - "401": application/json: {"": {}} + "401": + application/json: {"detail": {"msg": ""}, "": {}} "422": application/json: {"": {}} "500": @@ -1178,26 +1200,28 @@ examples: genAudioToText: speakeasy-default-gen-audio-to-text: requestBody: - multipart/form-data: {"audio": {}} + multipart/form-data: {"audio": {}, "model_id": "openai/whisper-large-v3", "return_timestamps": "true"} responses: "200": - application/json: {"text": "", "chunks": []} + application/json: {"text": "", "chunks": [{"timestamp": ["", ""], "text": ""}, {"timestamp": [], "text": ""}]} "400": - application/json: {"": {}} + application/json: {"detail": {"msg": ""}, "": {}} "401": application/json: {"detail": {"msg": ""}, "": {}} "413": - application/json: {"": {}} + application/json: {"detail": {"msg": ""}, "": {}} + "415": + application/json: {"detail": {"msg": ""}, "": {}} "422": application/json: {"": {}} "500": - application/json: {"detail": {"msg": ""}, "": {}} + application/json: {"": {}} default: application/json: {"": {}} genSegmentAnything2: speakeasy-default-gen-segment-anything2: requestBody: - multipart/form-data: {"image": {}} + multipart/form-data: {"image": {}, "model_id": "facebook/sam2-hiera-large", "multimask_output": true, "return_logits": true, "normalize_coords": true} responses: "200": application/json: {"masks": "", "scores": "", "logits": ""} @@ -1207,7 +1231,26 @@ examples: application/json: {"detail": {"msg": ""}, "": {}} "422": application/json: {"": {}} + "500": + application/json: {"": {}} + default: + application/json: {"": {}} + genLLM: + speakeasy-default-gen-LLM: + requestBody: + application/x-www-form-urlencoded: {"prompt": "", "model_id": "meta-llama/Meta-Llama-3.1-8B-Instruct", "system_msg": "", "temperature": 0.7, "max_tokens": 256, "history": "[]", "stream": false} + responses: + "200": + application/json: {"response": "", "tokens_used": 60712} + "400": + application/json: {"detail": {"msg": ""}, "": {}} + "401": + application/json: {"": {}} + "422": + application/json: {"": {}} "500": application/json: {"detail": {"msg": ""}, "": {}} default: application/json: {"": {}} +examplesVersion: 1.0.1 +generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 4301118..fbfa9b3 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -7,12 +7,15 @@ generation: useClassNamesForArrayFields: true fixes: nameResolutionDec2023: true + nameResolutionFeb2025: false parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true + securityFeb2025: false auth: oAuth2ClientCredentialsEnabled: true + oAuth2PasswordEnabled: false python: - version: 0.3.0 + version: 0.4.0 additionalDependencies: dev: {} main: {} @@ -20,10 +23,15 @@ python: authors: - Speakeasy clientServerStatusCodesAsErrors: true + defaultErrorName: SDKError description: Python Client SDK for Livepeer Studio + enableCustomCodeRegions: false enumFormat: enum + fixFlags: + responseRequiredSep2024: false flattenGlobalSecurity: true flattenRequests: false + flatteningOrder: parameters-first imports: option: openapi paths: @@ -38,5 +46,6 @@ python: outputModelSuffix: output packageName: livepeer projectUrls: {} + pytestTimeout: 0 responseFormat: envelope-http templateVersion: v2 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4a9c227..9bf802d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,18 +1,21 @@ -speakeasyVersion: 1.399.0 +speakeasyVersion: 1.540.0 sources: livepeer-studio-api: sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:05b8e6f32af10787d3e904f94a0924c304ec1dd8357de9351eebd75f8ea9c3ca - sourceBlobDigest: sha256:aa27f19cd706fdbc92320eea5ca4d28aefd20557554f78a6fa0393320d8ee1d6 + sourceRevisionDigest: sha256:22e710fec1e7326c5865f0d136c0c92e12620b9d0258f6d18b828aefffa9da3a + sourceBlobDigest: sha256:4488790737c35e02b007209a1c0f7c6828c03112914a4b4cd3c7a49256a80167 tags: - latest - - main + - speakeasy-sdk-regen-1744505080 + - 1.0.0 targets: livepeer-python: source: livepeer-studio-api sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:05b8e6f32af10787d3e904f94a0924c304ec1dd8357de9351eebd75f8ea9c3ca - sourceBlobDigest: sha256:aa27f19cd706fdbc92320eea5ca4d28aefd20557554f78a6fa0393320d8ee1d6 + sourceRevisionDigest: sha256:22e710fec1e7326c5865f0d136c0c92e12620b9d0258f6d18b828aefffa9da3a + sourceBlobDigest: sha256:4488790737c35e02b007209a1c0f7c6828c03112914a4b4cd3c7a49256a80167 + codeSamplesNamespace: livepeer-studio-api-python-code-samples + codeSamplesRevisionDigest: sha256:7c8a9d14daf8b2457d534d5bf9028dd85c3df098768122b039d2610fc46a0b7e my-first-target: source: livepeer-studio-api sourceNamespace: livepeer-studio-api @@ -37,3 +40,5 @@ workflow: token: $pypi_token codeSamples: output: codeSamples.yaml + registry: + location: registry.speakeasyapi.dev/livepeer/livepeer-studio/livepeer-studio-api-python-code-samples diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index dd3ba38..a0faba1 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -16,3 +16,5 @@ targets: token: $pypi_token codeSamples: output: codeSamples.yaml + registry: + location: registry.speakeasyapi.dev/livepeer/livepeer-studio/livepeer-studio-api-python-code-samples diff --git a/README.md b/README.md index 04f41e3..224c49d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ For full documentation and examples, please visit [docs.livepeer.org](https://do ## SDK Installation +> [!NOTE] +> **Python version upgrade policy** +> +> Once a Python version reaches its [official end of life date](https://devguide.python.org/versions/), a 3-month grace period is provided for users to upgrade. Following this grace period, the minimum python version supported in the SDK will be updated. + The SDK can be installed with either *pip* or *poetry* package managers. ### PIP @@ -27,6 +32,37 @@ pip install livepeer ```bash poetry add livepeer ``` + +### Shell and script usage with `uv` + +You can use this SDK in a Python shell with [uv](https://docs.astral.sh/uv/) and the `uvx` command that comes with it like so: + +```shell +uvx --from livepeer python +``` + +It's also possible to write a standalone Python script without needing to set up a whole project like so: + +```python +#!/usr/bin/env -S uv run --script +# /// script +# requires-python = ">=3.9" +# dependencies = [ +# "livepeer", +# ] +# /// + +from livepeer import Livepeer + +sdk = Livepeer( + # SDK arguments +) + +# Rest of script here... +``` + +Once that is saved to a file, you can run it with `uv run script.py` where +`script.py` can be replaced with the actual file name. @@ -85,6 +121,7 @@ if res.stream is not None: * [upscale](docs/sdks/generate/README.md#upscale) - Upscale * [audio_to_text](docs/sdks/generate/README.md#audio_to_text) - Audio To Text * [segment_anything2](docs/sdks/generate/README.md#segment_anything2) - Segment Anything 2 +* [llm](docs/sdks/generate/README.md#llm) - LLM ### [metrics](docs/sdks/metrics/README.md) @@ -176,21 +213,23 @@ Certain SDK methods accept file objects as part of a request body or multi-part ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.generate.image_to_image(request={ - "prompt": "", - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, -}) + res = l_client.generate.image_to_image(request={ + "prompt": "", + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) -if res.image_response is not None: - # handle response - pass + assert res.image_response is not None + + # Handle response + print(res.image_response) ``` @@ -206,79 +245,103 @@ from livepeer import Livepeer from livepeer.models import components from livepeer.utils import BackoffStrategy, RetryConfig -s = Livepeer( - api_key="", -) -res = s.stream.create(request={ - "name": "test_stream", - "pull": { - "source": "https://myservice.com/live/stream.flv", - "headers": { - "Authorization": "Bearer 123", - }, - "location": { - "lat": 39.739, - "lon": -104.988, - }, - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", +with Livepeer( + api_key="", +) as l_client: + + res = l_client.stream.create(request={ + "name": "test_stream", + "pull": { + "source": "https://myservice.com/live/stream.flv", + "headers": { + "Authorization": "Bearer 123", + }, + "location": { + "lat": 39.739, + "lon": -104.988, + }, }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "record": False, - "recording_spec": { "profiles": [ { - "bitrate": 3000000, "width": 1280, "name": "720p", "height": 720, - "quality": 23, + "bitrate": 3000000, "fps": 30, "fps_den": 1, + "quality": 23, "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "profile": components.Profile.H264_BASELINE, }, - ], - }, - "multistream": { - "targets": [ { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", - }, + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, }, ], + "record": False, + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }, + ], + }, }, -}, - RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) + RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False)) -if res.stream is not None: - # handle response - pass + assert res.stream is not None + + # Handle response + print(res.stream) ``` @@ -288,79 +351,103 @@ from livepeer import Livepeer from livepeer.models import components from livepeer.utils import BackoffStrategy, RetryConfig -s = Livepeer( + +with Livepeer( retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False), api_key="", -) - -res = s.stream.create(request={ - "name": "test_stream", - "pull": { - "source": "https://myservice.com/live/stream.flv", - "headers": { - "Authorization": "Bearer 123", - }, - "location": { - "lat": 39.739, - "lon": -104.988, - }, - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", +) as l_client: + + res = l_client.stream.create(request={ + "name": "test_stream", + "pull": { + "source": "https://myservice.com/live/stream.flv", + "headers": { + "Authorization": "Bearer 123", + }, + "location": { + "lat": 39.739, + "lon": -104.988, + }, }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "record": False, - "recording_spec": { "profiles": [ { - "bitrate": 3000000, "width": 1280, "name": "720p", "height": 720, - "quality": 23, + "bitrate": 3000000, "fps": 30, "fps_den": 1, + "quality": 23, "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "profile": components.Profile.H264_BASELINE, }, - ], - }, - "multistream": { - "targets": [ { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", - }, + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, }, ], - }, -}) + "record": False, + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }, + ], + }, + }) -if res.stream is not None: - # handle response - pass + assert res.stream is not None + + # Handle response + print(res.stream) ``` @@ -368,12 +455,23 @@ if res.stream is not None: ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an error. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate Error type. +Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception. + +By default, an API error will raise a errors.SDKError exception, which has the following properties: + +| Property | Type | Description | +|-----------------|------------------|-----------------------| +| `.status_code` | *int* | The HTTP status code | +| `.message` | *str* | The error message | +| `.raw_response` | *httpx.Response* | The raw HTTP response | +| `.body` | *str* | The response content | + +When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `get_async` method may raise the following exceptions: -| Error Object | Status Code | Content Type | -| ---------------- | ---------------- | ---------------- | -| errors.Error | 404 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| --------------- | ----------- | ---------------- | +| errors.Error | 404 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ### Example @@ -381,24 +479,26 @@ Handling errors in this SDK should largely match your expectations. All operati from livepeer import Livepeer from livepeer.models import errors -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + res = None + try: -res = None -try: - res = s.playback.get(id="") + res = l_client.playback.get(id="") - if res.playback_info is not None: - # handle response - pass + assert res.playback_info is not None -except errors.Error as e: - # handle e.data: errors.ErrorData - raise(e) -except errors.SDKError as e: - # handle exception - raise(e) + # Handle response + print(res.playback_info) + + except errors.Error as e: + # handle e.data: errors.ErrorData + raise(e) + except errors.SDKError as e: + # handle exception + raise(e) ``` @@ -492,87 +592,111 @@ s = Livepeer(async_client=CustomClient(httpx.AsyncClient())) This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ----------- | ----------- | ----------- | -| `api_key` | http | HTTP Bearer | +| Name | Type | Scheme | +| --------- | ---- | ----------- | +| `api_key` | http | HTTP Bearer | To authenticate with the API the `api_key` parameter must be set when initializing the SDK client instance. For example: ```python from livepeer import Livepeer from livepeer.models import components -s = Livepeer( - api_key="", -) -res = s.stream.create(request={ - "name": "test_stream", - "pull": { - "source": "https://myservice.com/live/stream.flv", - "headers": { - "Authorization": "Bearer 123", - }, - "location": { - "lat": 39.739, - "lon": -104.988, - }, - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", +with Livepeer( + api_key="", +) as l_client: + + res = l_client.stream.create(request={ + "name": "test_stream", + "pull": { + "source": "https://myservice.com/live/stream.flv", + "headers": { + "Authorization": "Bearer 123", + }, + "location": { + "lat": 39.739, + "lon": -104.988, + }, }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "record": False, - "recording_spec": { "profiles": [ { - "bitrate": 3000000, "width": 1280, "name": "720p", "height": 720, - "quality": 23, + "bitrate": 3000000, "fps": 30, "fps_den": 1, + "quality": 23, "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "profile": components.Profile.H264_BASELINE, }, - ], - }, - "multistream": { - "targets": [ { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", - }, + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, }, ], - }, -}) + "record": False, + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }, + ], + }, + }) -if res.stream is not None: - # handle response - pass + assert res.stream is not None + + # Handle response + print(res.stream) ``` @@ -587,18 +711,21 @@ what they return. ## Table of Contents + +* [Livepeer Python Library](#livepeer-python-library) + * [Documentation](#documentation) + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [File uploads](#file-uploads) + * [Retries](#retries) + * [Error Handling](#error-handling) + * [Custom HTTP Client](#custom-http-client) + * [Authentication](#authentication) + * [IDE Support](#ide-support) + * [Resource Management](#resource-management) + * [Debugging](#debugging) -* [SDK Installation](#sdk-installation) -* [IDE Support](#ide-support) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [File uploads](#file-uploads) -* [Retries](#retries) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) -* [Custom HTTP Client](#custom-http-client) -* [Authentication](#authentication) -* [Debugging](#debugging) @@ -611,6 +738,33 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u - [PyCharm Pydantic Plugin](https://docs.pydantic.dev/latest/integrations/pycharm/) + +## Resource Management + +The `Livepeer` class implements the context manager protocol and registers a finalizer function to close the underlying sync and async HTTPX clients it uses under the hood. This will close HTTP connections, release memory and free up other resources held by the SDK. In short-lived Python programs and notebooks that make a few SDK method calls, resource management may not be a concern. However, in longer-lived programs, it is beneficial to create a single SDK instance via a [context manager][context-manager] and reuse it across the application. + +[context-manager]: https://docs.python.org/3/reference/datamodel.html#context-managers + +```python +from livepeer import Livepeer +def main(): + + with Livepeer( + api_key="", + ) as l_client: + # Rest of application here... + + +# Or when using async: +async def amain(): + + async with Livepeer( + api_key="", + ) as l_client: + # Rest of application here... +``` + + ## Debugging diff --git a/RELEASES.md b/RELEASES.md index f5c4cca..0267433 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -104,4 +104,14 @@ Based on: ### Generated - [python v0.3.0] . ### Releases -- [PyPI v0.3.0] https://pypi.org/project/livepeer/0.3.0 - . \ No newline at end of file +- [PyPI v0.3.0] https://pypi.org/project/livepeer/0.3.0 - . + +## 2025-04-28 00:20:30 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.540.0 (2.593.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.4.0] . +### Releases +- [PyPI v0.4.0] https://pypi.org/project/livepeer/0.4.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 9349b1d..651851b 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,94 +4,12 @@ from livepeer import Livepeer from livepeer.models import components -s = Livepeer( - api_key="", -) - -res = s.stream.create(request={ - "name": "test_stream", - "pull": { - "source": "https://myservice.com/live/stream.flv", - "headers": { - "Authorization": "Bearer 123", - }, - "location": { - "lat": 39.739, - "lon": -104.988, - }, - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", - }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, - }, - ], - "record": False, - "recording_spec": { - "profiles": [ - { - "bitrate": 3000000, - "width": 1280, - "name": "720p", - "height": 720, - "quality": 23, - "fps": 30, - "fps_den": 1, - "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, - }, - ], - }, - "multistream": { - "targets": [ - { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", - }, - }, - ], - }, -}) - -if res.stream is not None: - # handle response - pass -``` -
- -The same SDK client can also be used to make asychronous requests by importing asyncio. -```python -# Asynchronous Example -import asyncio -from livepeer import Livepeer -from livepeer.models import components +with Livepeer( + api_key="", +) as l_client: -async def main(): - s = Livepeer( - api_key="", - ) - res = await s.stream.create_async(request={ + res = l_client.stream.create(request={ "name": "test_stream", "pull": { "source": "https://myservice.com/live/stream.flv", @@ -123,15 +41,38 @@ async def main(): "gop": "2", "profile": components.Profile.H264_BASELINE, }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, + }, ], "record": False, "recording_spec": { "profiles": [ { + "width": 1280, + "name": "720p", + "height": 720, "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { "width": 1280, "name": "720p", "height": 720, + "bitrate": 3000000, "quality": 23, "fps": 30, "fps_den": 1, @@ -144,20 +85,129 @@ async def main(): "multistream": { "targets": [ { - "profile": "720p", - "video_only": False, + "profile": "720p0", "id": "PUSH123", "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", }, }, ], }, }) - if res.stream is not None: - # handle response - pass + + assert res.stream is not None + + # Handle response + print(res.stream) +``` + +
+ +The same SDK client can also be used to make asychronous requests by importing asyncio. +```python +# Asynchronous Example +import asyncio +from livepeer import Livepeer +from livepeer.models import components + +async def main(): + + async with Livepeer( + api_key="", + ) as l_client: + + res = await l_client.stream.create_async(request={ + "name": "test_stream", + "pull": { + "source": "https://myservice.com/live/stream.flv", + "headers": { + "Authorization": "Bearer 123", + }, + "location": { + "lat": 39.739, + "lon": -104.988, + }, + }, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, + }, + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, + }, + ], + "record": False, + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }, + ], + }, + }) + + assert res.stream is not None + + # Handle response + print(res.stream) asyncio.run(main()) ``` diff --git a/codeSamples.yaml b/codeSamples.yaml index 71546ae..61e6e63 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -11,15 +11,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.access_control.get_all() - res = s.access_control.get_all() + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/access-control/signing-key"]["post"] update: x-codeSamples: @@ -28,15 +30,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.access_control.create() + res = l_client.access_control.create() - if res.signing_key is not None: - # handle response - pass + assert res.signing_key is not None + + # Handle response + print(res.signing_key) - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] update: x-codeSamples: @@ -45,15 +49,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.access_control.delete(key_id="") - res = s.access_control.delete(key_id="") + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] update: x-codeSamples: @@ -62,15 +68,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.access_control.get(key_id="") - res = s.access_control.get(key_id="") + assert res.signing_key is not None - if res.signing_key is not None: - # handle response - pass + # Handle response + print(res.signing_key) - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] update: x-codeSamples: @@ -79,16 +87,18 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.access_control.update(key_id="", request_body={}) + res = l_client.access_control.update(key_id="", request_body={}) - if res is not None: - # handle response - pass - - target: $["paths"]["/api/beta/generate/audio-to-text"]["post"] + assert res is not None + + # Handle response + print(res) + - target: $["paths"]["/api/generate/audio-to-text"]["post"] update: x-codeSamples: - lang: python @@ -96,21 +106,23 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.generate.audio_to_text(request={ - "audio": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, - }) - - if res.text_response is not None: - # handle response - pass - - target: $["paths"]["/api/beta/generate/image-to-image"]["post"] + ) as l_client: + + res = l_client.generate.audio_to_text(request={ + "audio": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) + + assert res.text_response is not None + + # Handle response + print(res.text_response) + - target: $["paths"]["/api/generate/image-to-image"]["post"] update: x-codeSamples: - lang: python @@ -118,22 +130,24 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.generate.image_to_image(request={ - "prompt": "", - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, - }) - - if res.image_response is not None: - # handle response - pass - - target: $["paths"]["/api/beta/generate/image-to-video"]["post"] + ) as l_client: + + res = l_client.generate.image_to_image(request={ + "prompt": "", + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) + + assert res.image_response is not None + + # Handle response + print(res.image_response) + - target: $["paths"]["/api/generate/image-to-video"]["post"] update: x-codeSamples: - lang: python @@ -141,21 +155,44 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( + api_key="", + ) as l_client: + + res = l_client.generate.image_to_video(request={ + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) + + assert res.video_response is not None + + # Handle response + print(res.video_response) + - target: $["paths"]["/api/generate/llm"]["post"] + update: + x-codeSamples: + - lang: python + label: genLLM + source: |- + from livepeer import Livepeer + + + with Livepeer( api_key="", - ) - - res = s.generate.image_to_video(request={ - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, - }) - - if res.video_response is not None: - # handle response - pass - - target: $["paths"]["/api/beta/generate/segment-anything-2"]["post"] + ) as l_client: + + res = l_client.generate.llm(request={ + "prompt": "", + }) + + assert res.llm_response is not None + + # Handle response + print(res.llm_response) + - target: $["paths"]["/api/generate/segment-anything-2"]["post"] update: x-codeSamples: - lang: python @@ -163,21 +200,23 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.generate.segment_anything2(request={ - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, - }) - - if res.masks_response is not None: - # handle response - pass - - target: $["paths"]["/api/beta/generate/text-to-image"]["post"] + ) as l_client: + + res = l_client.generate.segment_anything2(request={ + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) + + assert res.masks_response is not None + + # Handle response + print(res.masks_response) + - target: $["paths"]["/api/generate/text-to-image"]["post"] update: x-codeSamples: - lang: python @@ -185,18 +224,20 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.generate.text_to_image(request={ + "prompt": "", + }) - res = s.generate.text_to_image(request={ - "prompt": "", - }) + assert res.image_response is not None - if res.image_response is not None: - # handle response - pass - - target: $["paths"]["/api/beta/generate/upscale"]["post"] + # Handle response + print(res.image_response) + - target: $["paths"]["/api/generate/upscale"]["post"] update: x-codeSamples: - lang: python @@ -204,21 +245,23 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.generate.upscale(request={ - "prompt": "", - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, - }) - - if res.image_response is not None: - # handle response - pass + ) as l_client: + + res = l_client.generate.upscale(request={ + "prompt": "", + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) + + assert res.image_response is not None + + # Handle response + print(res.image_response) - target: $["paths"]["/asset"]["get"] update: x-codeSamples: @@ -227,15 +270,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.asset.get_all() + res = l_client.asset.get_all() - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/asset/request-upload"]["post"] update: x-codeSamples: @@ -245,40 +290,54 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.asset.create(request={ - "name": "filename.mp4", - "static_mp4": True, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", - }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "quality": 23, - "fps": 30, - "fps_den": 1, - "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + ) as l_client: + + res = l_client.asset.create(request={ + "name": "filename.mp4", + "static_mp4": True, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - }) + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }) + + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/asset/upload/url"]["post"] update: x-codeSamples: @@ -288,41 +347,55 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.asset.create_via_url(request={ - "name": "filename.mp4", - "static_mp4": True, - "playback_policy": { - "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": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "quality": 23, - "fps": 30, - "fps_den": 1, - "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + ) as l_client: + + res = l_client.asset.create_via_url(request={ + "name": "filename.mp4", + "static_mp4": True, + "playback_policy": { + "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": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "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 + assert res.two_hundred_application_json_data is not None + + # Handle response + print(res.two_hundred_application_json_data) - target: $["paths"]["/asset/{assetId}"]["delete"] update: x-codeSamples: @@ -331,15 +404,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.asset.delete(asset_id="") - res = s.asset.delete(asset_id="") + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/asset/{assetId}"]["get"] update: x-codeSamples: @@ -348,15 +423,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.asset.get(asset_id="") - res = s.asset.get(asset_id="") + assert res.asset is not None - if res.asset is not None: - # handle response - pass + # Handle response + print(res.asset) - target: $["paths"]["/asset/{assetId}"]["patch"] update: x-codeSamples: @@ -366,25 +443,27 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.asset.update(asset_id="", asset_patch_payload={ - "name": "filename.mp4", - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", + ) as l_client: + + res = l_client.asset.update(asset_id="", asset_patch_payload={ + "name": "filename.mp4", + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - "refresh_interval": 600, - }, - }) + }) + + assert res.asset is not None - if res.asset is not None: - # handle response - pass + # Handle response + print(res.asset) - target: $["paths"]["/clip"]["post"] update: x-codeSamples: @@ -393,21 +472,23 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.stream.create_clip(request={ - "playback_id": "eaw4nk06ts2d0mzb", - "start_time": 1587667174725, - "end_time": 1587667174725, - "name": "My Clip", - "session_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", - }) - - if res.data is not None: - # handle response - pass + ) as l_client: + + res = l_client.stream.create_clip(request={ + "playback_id": "eaw4nk06ts2d0mzb", + "start_time": 1587667174725, + "end_time": 1587667174725, + "name": "My Clip", + "session_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", + }) + + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/data/usage/query"]["get"] update: x-codeSamples: @@ -416,15 +497,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.metrics.get_usage(request={}) - res = s.metrics.get_usage(request={}) + assert res.usage_metric is not None - if res.usage_metric is not None: - # handle response - pass + # Handle response + print(res.usage_metric) - target: $["paths"]["/data/views/now"]["get"] update: x-codeSamples: @@ -433,15 +516,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.metrics.get_realtime_viewership() - res = s.metrics.get_realtime_viewership() + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/data/views/query"]["get"] update: x-codeSamples: @@ -450,15 +535,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.metrics.get_viewership(request={}) + res = l_client.metrics.get_viewership(request={}) - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/data/views/query/creator"]["get"] update: x-codeSamples: @@ -467,15 +554,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.metrics.get_creator_viewership(request={}) - res = s.metrics.get_creator_viewership(request={}) + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] update: x-codeSamples: @@ -484,15 +573,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.metrics.get_public_viewership(playback_id="") - res = s.metrics.get_public_viewership(playback_id="") + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/multistream/target"]["get"] update: x-codeSamples: @@ -501,15 +592,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.multistream.get_all() + res = l_client.multistream.get_all() - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/multistream/target"]["post"] update: x-codeSamples: @@ -518,17 +611,19 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.multistream.create(request={ - "url": "rtmps://live.my-service.tv/channel/secretKey", - }) + res = l_client.multistream.create(request={ + "url": "rtmps://live.my-service.tv/channel/secretKey", + }) - if res.multistream_target is not None: - # handle response - pass + assert res.multistream_target is not None + + # Handle response + print(res.multistream_target) - target: $["paths"]["/multistream/target/{id}"]["delete"] update: x-codeSamples: @@ -537,230 +632,76 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( - api_key="", - ) - res = s.multistream.delete(id="") - - if res is not None: - # handle response - pass - - target: $["paths"]["/multistream/target/{id}"]["get"] - update: - x-codeSamples: - - lang: python - label: getMultistreamTarget - source: |- - from livepeer import Livepeer - - s = Livepeer( + with Livepeer( api_key="", - ) + ) as l_client: - res = s.multistream.get(id="") + res = l_client.multistream.delete(id="") - if res.multistream_target is not None: - # handle response - pass - - target: $["paths"]["/multistream/target/{id}"]["patch"] - update: - x-codeSamples: - - lang: python - label: updateMultistreamTarget - source: |- - from livepeer import Livepeer - - s = Livepeer( - api_key="", - ) + assert res is not None - res = s.multistream.update(id="", multistream_target_patch_payload={ - "url": "rtmps://live.my-service.tv/channel/secretKey", - }) - - if res is not None: - # handle response - pass - - target: $["paths"]["/playback/{id}"]["get"] - update: - x-codeSamples: - - lang: python - label: getPlaybackInfo - source: |- - from livepeer import Livepeer - - s = Livepeer( - api_key="", - ) - - res = s.playback.get(id="") - - if res.playback_info is not None: - # handle response - pass - - target: $["paths"]["/room"]["post"] + # Handle response + print(res) + - target: $["paths"]["/multistream/target/{id}"]["get"] update: x-codeSamples: - lang: python - label: createRoom + label: getMultistreamTarget source: |- from livepeer import Livepeer - s = Livepeer( - api_key="", - ) - - res = s.room.create() - if res.create_room_response is not None: - # handle response - pass - - target: $["paths"]["/room/{id}"]["delete"] - update: - x-codeSamples: - - lang: python - label: deleteRoom - source: |- - from livepeer import Livepeer - - s = Livepeer( + with Livepeer( api_key="", - ) + ) as l_client: - res = s.room.delete(id="") + res = l_client.multistream.get(id="") - if res is not None: - # handle response - pass - - target: $["paths"]["/room/{id}"]["get"] - update: - x-codeSamples: - - lang: python - label: getRoom - source: |- - from livepeer import Livepeer + assert res.multistream_target is not None - s = Livepeer( - api_key="", - ) - - res = s.room.get(id="") - - if res.room is not None: - # handle response - pass - - target: $["paths"]["/room/{id}/egress"]["delete"] + # Handle response + print(res.multistream_target) + - target: $["paths"]["/multistream/target/{id}"]["patch"] update: x-codeSamples: - lang: python - label: stopRoomEgress + label: updateMultistreamTarget source: |- from livepeer import Livepeer - s = Livepeer( - api_key="", - ) - - res = s.room.stop_egress(id="") - if res is not None: - # handle response - pass - - target: $["paths"]["/room/{id}/egress"]["post"] - update: - x-codeSamples: - - lang: python - label: startRoomEgress - source: |- - from livepeer import Livepeer - - s = Livepeer( + with Livepeer( api_key="", - ) + ) as l_client: - res = s.room.start_egress(id="", room_egress_payload={ - "stream_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", - }) + res = l_client.multistream.update(id="", multistream_target={ + "url": "rtmps://live.my-service.tv/channel/secretKey", + }) - if res is not None: - # handle response - pass - - target: $["paths"]["/room/{id}/user"]["post"] - update: - x-codeSamples: - - lang: python - label: createRoomUser - source: |- - from livepeer import Livepeer + assert res is not None - s = Livepeer( - api_key="", - ) - - res = s.room.create_user(id="", room_user_payload={ - "name": "name", - "can_publish": True, - "can_publish_data": True, - }) - - if res.room_user_response is not None: - # handle response - pass - - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] + # Handle response + print(res) + - target: $["paths"]["/playback/{id}"]["get"] update: x-codeSamples: - lang: python - label: deleteRoomUser + label: getPlaybackInfo source: |- from livepeer import Livepeer - s = Livepeer( - api_key="", - ) - - res = s.room.delete_user(id="", user_id="") - - if res is not None: - # handle response - pass - - target: $["paths"]["/room/{id}/user/{userId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getRoomUser - source: |- - from livepeer import Livepeer - s = Livepeer( + with Livepeer( api_key="", - ) + ) as l_client: - res = s.room.get_user(id="", user_id="") + res = l_client.playback.get(id="") - if res.get_room_user_response is not None: - # handle response - pass - - target: $["paths"]["/room/{id}/user/{userId}"]["put"] - update: - x-codeSamples: - - lang: python - label: updateRoomUser - source: |- - from livepeer import Livepeer + assert res.playback_info is not None - s = Livepeer( - api_key="", - ) - - res = s.room.update_user(id="", user_id="", room_user_update_payload={ - "can_publish": True, - "can_publish_data": True, - }) - - if res is not None: - # handle response - pass + # Handle response + print(res.playback_info) - target: $["paths"]["/session"]["get"] update: x-codeSamples: @@ -769,15 +710,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.session.get_all() - res = s.session.get_all() + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/session/{id}"]["get"] update: x-codeSamples: @@ -786,15 +729,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.session.get(id="") + res = l_client.session.get(id="") - if res.session is not None: - # handle response - pass + assert res.session is not None + + # Handle response + print(res.session) - target: $["paths"]["/session/{id}/clips"]["get"] update: x-codeSamples: @@ -803,15 +748,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.session.get_clips(id="") - res = s.session.get_clips(id="") + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/stream"]["get"] update: x-codeSamples: @@ -820,15 +767,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.stream.get_all() - res = s.stream.get_all() + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/stream"]["post"] update: x-codeSamples: @@ -838,78 +787,102 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.stream.create(request={ - "name": "test_stream", - "pull": { - "source": "https://myservice.com/live/stream.flv", - "headers": { - "Authorization": "Bearer 123", - }, - "location": { - "lat": 39.739, - "lon": -104.988, - }, - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", + ) as l_client: + + res = l_client.stream.create(request={ + "name": "test_stream", + "pull": { + "source": "https://myservice.com/live/stream.flv", + "headers": { + "Authorization": "Bearer 123", + }, + "location": { + "lat": 39.739, + "lon": -104.988, + }, }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "record": False, - "recording_spec": { "profiles": [ { "width": 1280, "name": "720p", "height": 720, "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, }, - ], - }, - "multistream": { - "targets": [ { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "name": "My target", - "url": "rtmps://live.my-service.tv/channel/secretKey", - }, + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, }, ], - }, - }) + "record": False, + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }, + ], + }, + }) + + assert res.stream is not None - if res.stream is not None: - # handle response - pass + # Handle response + print(res.stream) - target: $["paths"]["/stream/{id}"]["delete"] update: x-codeSamples: @@ -918,15 +891,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.stream.delete(id="") - res = s.stream.delete(id="") + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/stream/{id}"]["get"] update: x-codeSamples: @@ -935,15 +910,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.stream.get(id="") + res = l_client.stream.get(id="") - if res.stream is not None: - # handle response - pass + assert res.stream is not None + + # Handle response + print(res.stream) - target: $["paths"]["/stream/{id}"]["patch"] update: x-codeSamples: @@ -953,67 +930,103 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( - api_key="", - ) - res = s.stream.update(id="", stream_patch_payload={ - "record": False, - "multistream": { - "targets": [ - { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "name": "My target", - "url": "rtmps://live.my-service.tv/channel/secretKey", + with Livepeer( + api_key="", + ) as l_client: + + res = l_client.stream.update(id="", stream_patch_payload={ + "record": False, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, }, - }, - ], - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", + ], }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "recording_spec": { "profiles": [ { "width": 1280, "name": "720p", "height": 720, "bitrate": 3000000, + "fps": 30, + "fps_den": 1, "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, "fps": 30, "fps_den": 1, + "quality": 23, "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "profile": components.Profile.H264_BASELINE, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, }, ], - }, - }) + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "name": "test_stream", + }) + + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/stream/{id}/clips"]["get"] update: x-codeSamples: @@ -1022,15 +1035,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.stream.get_clips(id="") + res = l_client.stream.get_clips(id="") - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] update: x-codeSamples: @@ -1039,23 +1054,24 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.stream.add_multistream_target(id="", target_add_payload={ - "profile": "720p0", - "video_only": False, - "id": "PUSH123", - "spec": { - "name": "My target", - "url": "rtmps://live.my-service.tv/channel/secretKey", - }, - }) + ) as l_client: + + res = l_client.stream.add_multistream_target(id="", target_add_payload={ + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }) + + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] update: x-codeSamples: @@ -1064,15 +1080,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.stream.remove_multistream_target(id="", target_id="") - res = s.stream.remove_multistream_target(id="", target_id="") + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/stream/{id}/start-pull"]["post"] update: x-codeSamples: @@ -1081,15 +1099,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.stream.start_pull(id="") + res = l_client.stream.start_pull(id="") - if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) - target: $["paths"]["/stream/{id}/terminate"]["delete"] update: x-codeSamples: @@ -1098,15 +1118,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.stream.terminate(id="") - res = s.stream.terminate(id="") + assert res is not None - if res is not None: - # handle response - pass + # Handle response + print(res) - target: $["paths"]["/stream/{parentId}/sessions"]["get"] update: x-codeSamples: @@ -1115,15 +1137,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.session.get_recorded(parent_id="", record=True) - res = s.session.get_recorded(parent_id="", record=True) + assert res.data is not None - if res.data is not None: - # handle response - pass + # Handle response + print(res.data) - target: $["paths"]["/task"]["get"] update: x-codeSamples: @@ -1132,15 +1156,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.task.get_all() + res = l_client.task.get_all() - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/task/{taskId}"]["get"] update: x-codeSamples: @@ -1149,15 +1175,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.task.get(task_id="") + res = l_client.task.get(task_id="") - if res.task is not None: - # handle response - pass + assert res.task is not None + + # Handle response + print(res.task) - target: $["paths"]["/transcode"]["post"] update: x-codeSamples: @@ -1167,53 +1195,64 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.transcode.create(request={ - "input": { - "url": "https://s3.amazonaws.com/bucket/file.mp4", - }, - "storage": { - "type": components.StorageType.S3, - "endpoint": "https://gateway.storjshare.io", - "bucket": "outputbucket", - "credentials": { - "access_key_id": "AKIAIOSFODNN7EXAMPLE", - "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", - }, - }, - "outputs": { - "hls": { - "path": "/samplevideo/hls", - }, - "mp4": { - "path": "/samplevideo/mp4", + ) as l_client: + + res = l_client.transcode.create(request={ + "input": { + "url": "https://s3.amazonaws.com/bucket/file.mp4", }, - "fmp4": { - "path": "/samplevideo/fmp4", + "storage": { + "type": components.TranscodePayloadStorageType.WEB3_STORAGE, + "credentials": { + "proof": "EaJlcm9vdHOAZ3ZlcnNpb24BmgIBcRIg2uxHpcPYSWNtifMKFkPC7IEDvFDCxCd3ADViv0coV7SnYXNYRO2hA0AnblHEW38s3lSlcwaDjPn", + }, }, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "quality": 23, - "fps": 30, - "fps_den": 1, - "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "outputs": { + "hls": { + "path": "/samplevideo/hls", + }, + "mp4": { + "path": "/samplevideo/mp4", + }, + "fmp4": { + "path": "/samplevideo/fmp4", + }, }, - ], - }) + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }) + + assert res.task is not None - if res.task is not None: - # handle response - pass + # Handle response + print(res.task) - target: $["paths"]["/webhook"]["get"] update: x-codeSamples: @@ -1222,15 +1261,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.webhook.get_all() + res = l_client.webhook.get_all() - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/webhook"]["post"] update: x-codeSamples: @@ -1240,25 +1281,27 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.webhook.create(request={ - "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.webhook is not None: - # handle response - pass + ) as l_client: + + res = l_client.webhook.create(request={ + "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", + }) + + assert res.webhook is not None + + # Handle response + print(res.webhook) - target: $["paths"]["/webhook/{id}"]["delete"] update: x-codeSamples: @@ -1267,15 +1310,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.webhook.delete(id="") + res = l_client.webhook.delete(id="") - if res.webhook is not None: - # handle response - pass + assert res.webhook is not None + + # Handle response + print(res.webhook) - target: $["paths"]["/webhook/{id}"]["get"] update: x-codeSamples: @@ -1284,15 +1329,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.webhook.get(id="") + res = l_client.webhook.get(id="") - if res.webhook is not None: - # handle response - pass + assert res.webhook is not None + + # Handle response + print(res.webhook) - target: $["paths"]["/webhook/{id}"]["put"] update: x-codeSamples: @@ -1302,25 +1349,27 @@ actions: from livepeer import Livepeer from livepeer.models import components - s = Livepeer( + + with Livepeer( api_key="", - ) - - res = s.webhook.update(id="", webhook={ - "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.webhook is not None: - # handle response - pass + ) as l_client: + + res = l_client.webhook.update(id="", webhook={ + "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", + }) + + assert res.webhook is not None + + # Handle response + print(res.webhook) - target: $["paths"]["/webhook/{id}/log"]["get"] update: x-codeSamples: @@ -1329,15 +1378,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: - res = s.webhook.get_logs(id="") + res = l_client.webhook.get_logs(id="") - if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] update: x-codeSamples: @@ -1346,15 +1397,17 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.webhook.get_log(id="", log_id="") - res = s.webhook.get_log(id="", log_id="") + assert res.webhook_log is not None - if res.webhook_log is not None: - # handle response - pass + # Handle response + print(res.webhook_log) - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] update: x-codeSamples: @@ -1363,12 +1416,14 @@ actions: source: |- from livepeer import Livepeer - s = Livepeer( + + with Livepeer( api_key="", - ) + ) as l_client: + + res = l_client.webhook.resend_log(id="", log_id="") - res = s.webhook.resend_log(id="", log_id="") + assert res.webhook_log is not None - if res.webhook_log is not None: - # handle response - pass + # Handle response + print(res.webhook_log) diff --git a/docs/models/components/asset.md b/docs/models/components/asset.md index 272ffc6..c87645a 100644 --- a/docs/models/components/asset.md +++ b/docs/models/components/asset.md @@ -6,18 +6,18 @@ | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | N/A | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | -| `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | -| `name` | *str* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | | `type` | [Optional[components.AssetType]](../../models/components/assettype.md) | :heavy_minus_sign: | Type of the asset. | video | | `playback_id` | *Optional[str]* | :heavy_minus_sign: | The playback ID to use with the Playback Info endpoint to retrieve playback URLs. | eaw4nk06ts2d0mzb | | ~~`user_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | | `playback_url` | *Optional[str]* | :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 | -| `download_url` | *Optional[str]* | :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 | +| `download_url` | *Optional[str]* | :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/download.mp4 | | `playback_policy` | [OptionalNullable[components.PlaybackPolicy]](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | +| `source` | [components.Source](../../models/components/source.md) | :heavy_check_mark: | N/A | | | `creator_id` | [Optional[components.CreatorID]](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | | `profiles` | List[[components.TranscodeProfile](../../models/components/transcodeprofile.md)] | :heavy_minus_sign: | Requested profiles for the asset to be transcoded into. Configured
on the upload APIs payload or through the `stream.recordingSpec`
field for recordings. If not specified, default profiles are derived
based on the source input. If this is a recording, the source will
not be present in this list but will be available for playback.
| | | `storage` | [Optional[components.AssetStorage]](../../models/components/assetstorage.md) | :heavy_minus_sign: | N/A | | | `status` | [Optional[components.AssetStatus]](../../models/components/assetstatus.md) | :heavy_minus_sign: | Status of the asset | | +| `name` | *str* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | | `project_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | | `created_at` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which asset was created | 1587667174725 | | `created_by_token_name` | *Optional[str]* | :heavy_minus_sign: | Name of the token used to create this object | | diff --git a/docs/models/components/attestation.md b/docs/models/components/attestation.md index 03ed5bc..7a1e8e6 100644 --- a/docs/models/components/attestation.md +++ b/docs/models/components/attestation.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 | | `primary_type` | [components.PrimaryType](../../models/components/primarytype.md) | :heavy_check_mark: | Video Metadata EIP-712 primaryType | VideoAttestation | | `domain` | [components.Domain](../../models/components/domain.md) | :heavy_check_mark: | Video Metadata EIP-712 domain | | | `message` | [components.Message](../../models/components/message.md) | :heavy_check_mark: | Video Metadata EIP-712 message content | | | `signature` | *str* | :heavy_check_mark: | Video Metadata EIP-712 message signature | 1311768467294899700 | -| `id` | *Optional[str]* | :heavy_minus_sign: | N/A | 5b9e63bb-6fd0-4bea-aff2-cc5d4eb9cad0 | | `created_at` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the object was created | 1587667174725 | | `signature_type` | [Optional[components.SignatureType]](../../models/components/signaturetype.md) | :heavy_minus_sign: | N/A | eip712 | | `storage` | [Optional[components.AttestationStorage]](../../models/components/attestationstorage.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/bodygenaudiototext.md b/docs/models/components/bodygenaudiototext.md index 4282b46..a8b04bf 100644 --- a/docs/models/components/bodygenaudiototext.md +++ b/docs/models/components/bodygenaudiototext.md @@ -3,7 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| `audio` | [components.Audio](../../models/components/audio.md) | :heavy_check_mark: | Uploaded audio file to be transcribed. | -| `model_id` | *Optional[str]* | :heavy_minus_sign: | Hugging Face model ID used for transcription. | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `audio` | [components.Audio](../../models/components/audio.md) | :heavy_check_mark: | Uploaded audio file to be transcribed. | +| `model_id` | *Optional[str]* | :heavy_minus_sign: | Hugging Face model ID used for transcription. | +| `return_timestamps` | *Optional[str]* | :heavy_minus_sign: | Return timestamps for the transcribed text. Supported values: 'sentence', 'word', or a string boolean ('true' or 'false'). Default is 'true' ('sentence'). 'false' means no timestamps. 'word' means word-based timestamps. | \ No newline at end of file diff --git a/docs/models/components/bodygenimagetoimage.md b/docs/models/components/bodygenimagetoimage.md index d79dc25..b285c88 100644 --- a/docs/models/components/bodygenimagetoimage.md +++ b/docs/models/components/bodygenimagetoimage.md @@ -3,16 +3,17 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `prompt` | *str* | :heavy_check_mark: | Text prompt(s) to guide image generation. | -| `image` | [components.Image](../../models/components/image.md) | :heavy_check_mark: | Uploaded image to modify with the pipeline. | -| `model_id` | *Optional[str]* | :heavy_minus_sign: | Hugging Face model ID used for image generation. | -| `strength` | *Optional[float]* | :heavy_minus_sign: | Degree of transformation applied to the reference image (0 to 1). | -| `guidance_scale` | *Optional[float]* | :heavy_minus_sign: | Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality). | -| `image_guidance_scale` | *Optional[float]* | :heavy_minus_sign: | Degree to which the generated image is pushed towards the initial image. | -| `negative_prompt` | *Optional[str]* | :heavy_minus_sign: | Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1. | -| `safety_check` | *Optional[bool]* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | -| `seed` | *Optional[int]* | :heavy_minus_sign: | Seed for random number generation. | -| `num_inference_steps` | *Optional[int]* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | -| `num_images_per_prompt` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate per prompt. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `prompt` | *str* | :heavy_check_mark: | Text prompt(s) to guide image generation. | +| `image` | [components.Image](../../models/components/image.md) | :heavy_check_mark: | Uploaded image to modify with the pipeline. | +| `model_id` | *Optional[str]* | :heavy_minus_sign: | Hugging Face model ID used for image generation. | +| `loras` | *Optional[str]* | :heavy_minus_sign: | A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}. | +| `strength` | *Optional[float]* | :heavy_minus_sign: | Degree of transformation applied to the reference image (0 to 1). | +| `guidance_scale` | *Optional[float]* | :heavy_minus_sign: | Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality). | +| `image_guidance_scale` | *Optional[float]* | :heavy_minus_sign: | Degree to which the generated image is pushed towards the initial image. | +| `negative_prompt` | *Optional[str]* | :heavy_minus_sign: | Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1. | +| `safety_check` | *Optional[bool]* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | +| `seed` | *Optional[int]* | :heavy_minus_sign: | Seed for random number generation. | +| `num_inference_steps` | *Optional[int]* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | +| `num_images_per_prompt` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate per prompt. | \ No newline at end of file diff --git a/docs/models/components/bodygenllm.md b/docs/models/components/bodygenllm.md new file mode 100644 index 0000000..5bbdda0 --- /dev/null +++ b/docs/models/components/bodygenllm.md @@ -0,0 +1,14 @@ +# BodyGenLLM + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `prompt` | *str* | :heavy_check_mark: | N/A | +| `model_id` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `system_msg` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `temperature` | *Optional[float]* | :heavy_minus_sign: | N/A | +| `max_tokens` | *Optional[int]* | :heavy_minus_sign: | N/A | +| `history` | *Optional[str]* | :heavy_minus_sign: | N/A | +| `stream` | *Optional[bool]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/encryption.md b/docs/models/components/encryption.md new file mode 100644 index 0000000..842a353 --- /dev/null +++ b/docs/models/components/encryption.md @@ -0,0 +1,8 @@ +# Encryption + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| `encrypted_key` | *str* | :heavy_check_mark: | Encryption key used to encrypt the asset. Only writable in the upload asset endpoints and cannot be retrieved back. | \ No newline at end of file diff --git a/docs/models/components/error.md b/docs/models/components/error.md new file mode 100644 index 0000000..729723b --- /dev/null +++ b/docs/models/components/error.md @@ -0,0 +1,8 @@ +# Error + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `errors` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/llmresponse.md b/docs/models/components/llmresponse.md new file mode 100644 index 0000000..d7c47f6 --- /dev/null +++ b/docs/models/components/llmresponse.md @@ -0,0 +1,9 @@ +# LLMResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `response` | *str* | :heavy_check_mark: | N/A | +| `tokens_used` | *int* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/meta.md b/docs/models/components/meta.md index c59336c..d31399f 100644 --- a/docs/models/components/meta.md +++ b/docs/models/components/meta.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `source` | List[[components.PlaybackInfoSource](../../models/components/playbackinfosource.md)] | :heavy_check_mark: | N/A | | | `live` | [Optional[components.Live]](../../models/components/live.md) | :heavy_minus_sign: | N/A | 0 | | `playback_policy` | [OptionalNullable[components.PlaybackPolicy]](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | +| `source` | List[[components.PlaybackInfoSource](../../models/components/playbackinfosource.md)] | :heavy_check_mark: | N/A | | | `dvr_playback` | List[[components.DvrPlayback](../../models/components/dvrplayback.md)] | :heavy_minus_sign: | N/A | | | `attestation` | [Optional[components.Attestation]](../../models/components/attestation.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/multistreamtargetpatchpayload.md b/docs/models/components/multistreamtargetinput.md similarity index 98% rename from docs/models/components/multistreamtargetpatchpayload.md rename to docs/models/components/multistreamtargetinput.md index e2a74ff..ea20093 100644 --- a/docs/models/components/multistreamtargetpatchpayload.md +++ b/docs/models/components/multistreamtargetinput.md @@ -1,10 +1,10 @@ -# MultistreamTargetPatchPayload +# MultistreamTargetInput ## Fields | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `url` | *str* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | | `name` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `url` | *str* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | | `disabled` | *Optional[bool]* | :heavy_minus_sign: | If true then this multistream target will not be used for pushing
even if it is configured in a stream object.
| | \ No newline at end of file diff --git a/docs/models/components/newassetfromurlpayload.md b/docs/models/components/newassetfromurlpayload.md index 0ac55ee..c0faffa 100644 --- a/docs/models/components/newassetfromurlpayload.md +++ b/docs/models/components/newassetfromurlpayload.md @@ -6,11 +6,11 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `name` | *str* | :heavy_check_mark: | The name of the asset. This is not necessarily the filename - it can be a custom name or title.
| filename.mp4 | -| `url` | *str* | :heavy_check_mark: | URL where the asset contents can be retrieved, e.g. `https://s3.amazonaws.com/my-bucket/path/filename.mp4`.
For an IPFS source, this should be similar to: `ipfs://{CID}`. For an Arweave
source: `ar://{CID}`.
| https://s3.amazonaws.com/my-bucket/path/filename.mp4 | | `static_mp4` | *Optional[bool]* | :heavy_minus_sign: | Whether to generate MP4s for the asset. | true | | `playback_policy` | [OptionalNullable[components.PlaybackPolicy]](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `creator_id` | [Optional[components.InputCreatorID]](../../models/components/inputcreatorid.md) | :heavy_minus_sign: | N/A | | | `storage` | [Optional[components.Storage]](../../models/components/storage.md) | :heavy_minus_sign: | N/A | | +| `url` | *str* | :heavy_check_mark: | URL where the asset contents can be retrieved, e.g. `https://s3.amazonaws.com/my-bucket/path/filename.mp4`.
For an IPFS source, this should be similar to: `ipfs://{CID}`. For an Arweave
source: `ar://{CID}`.
| https://s3.amazonaws.com/my-bucket/path/filename.mp4 | | `encryption` | [Optional[components.Encryption]](../../models/components/encryption.md) | :heavy_minus_sign: | N/A | | | `c2pa` | *Optional[bool]* | :heavy_minus_sign: | Decides if the output video should include C2PA signature | | | `profiles` | List[[components.TranscodeProfile](../../models/components/transcodeprofile.md)] | :heavy_minus_sign: | N/A | | diff --git a/docs/models/components/realtimeviewershipmetric.md b/docs/models/components/realtimeviewershipmetric.md index 11f1f66..e0fc5e5 100644 --- a/docs/models/components/realtimeviewershipmetric.md +++ b/docs/models/components/realtimeviewershipmetric.md @@ -8,9 +8,9 @@ An individual metric about realtime viewership of a stream/asset. | Field | Type | Required | Description | Example | | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `view_count` | *int* | :heavy_check_mark: | The number of views for the stream/asset. | 100 | -| `error_rate` | *float* | :heavy_check_mark: | The error rate for the stream/asset. | 0.1 | | `playback_id` | *Optional[str]* | :heavy_minus_sign: | The playback ID associated with the metric. | 1bde4o2i6xycudoy | | `device` | *Optional[str]* | :heavy_minus_sign: | The device used by the viewer. | iPhone | | `browser` | *Optional[str]* | :heavy_minus_sign: | The browser used by the viewer. | Safari | -| `country` | *Optional[str]* | :heavy_minus_sign: | The country where the viewer is located. | United States | \ No newline at end of file +| `country` | *Optional[str]* | :heavy_minus_sign: | The country where the viewer is located. | United States | +| `view_count` | *int* | :heavy_check_mark: | The number of views for the stream/asset. | 100 | +| `error_rate` | *float* | :heavy_check_mark: | The error rate for the stream/asset. | 0.1 | \ No newline at end of file diff --git a/docs/models/components/room.md b/docs/models/components/room.md index 87bf42e..4aeb4f5 100644 --- a/docs/models/components/room.md +++ b/docs/models/components/room.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | `id` | *str* | :heavy_check_mark: | room ID | d32ae9e6-c459-4931-9898-e86e2f5e7e16 | -| `participants` | Dict[str, [components.Participants](../../models/components/participants.md)] | :heavy_check_mark: | N/A | | | `created_at` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the room was created | 1587667174725 | | `updated_at` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which room was updated | 1587667174725 | -| `egress_id` | *Optional[str]* | :heavy_minus_sign: | internal ID for egress output | | \ No newline at end of file +| `egress_id` | *Optional[str]* | :heavy_minus_sign: | internal ID for egress output | | +| `participants` | Dict[str, [components.Participants](../../models/components/participants.md)] | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/session.md b/docs/models/components/session.md index 5b37351..f7c9c66 100644 --- a/docs/models/components/session.md +++ b/docs/models/components/session.md @@ -5,10 +5,10 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | test_session | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | | ~~`kind`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | stream | | ~~`user_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 66E2161C-7670-4D05-B71D-DA2D6979556F | +| `name` | *str* | :heavy_check_mark: | N/A | test_session | | `last_seen` | *Optional[float]* | :heavy_minus_sign: | N/A | 1587667174725 | | `source_segments` | *Optional[float]* | :heavy_minus_sign: | N/A | 1 | | `transcoded_segments` | *Optional[float]* | :heavy_minus_sign: | N/A | 2 | diff --git a/docs/models/components/signingkey.md b/docs/models/components/signingkey.md index e68fdef..aeee834 100644 --- a/docs/models/components/signingkey.md +++ b/docs/models/components/signingkey.md @@ -5,11 +5,11 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `public_key` | *str* | :heavy_check_mark: | N/A | | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | 78df0075-b5f3-4683-a618-1086faca35dc | | `name` | *Optional[str]* | :heavy_minus_sign: | Name of the signing key | key1 | | ~~`user_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | 78df0075-b5f3-4683-a618-1086faca35dc | | `created_at` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the signing-key was created | 1587667174725 | | `last_seen` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the signing-key was last used | 1587667174725 | +| `public_key` | *str* | :heavy_check_mark: | N/A | | | `disabled` | *Optional[bool]* | :heavy_minus_sign: | Disable the signing key to allow rotation safely | false | | `project_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb | \ No newline at end of file diff --git a/docs/models/components/storagestatus.md b/docs/models/components/storagestatus.md index 0a4bfbf..b77e2f6 100644 --- a/docs/models/components/storagestatus.md +++ b/docs/models/components/storagestatus.md @@ -6,6 +6,6 @@ | Field | Type | Required | Description | Example | | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | | `phase` | [components.Phase](../../models/components/phase.md) | :heavy_check_mark: | Phase of the asset storage | ready | -| `tasks` | [components.Tasks](../../models/components/tasks.md) | :heavy_check_mark: | N/A | | | `progress` | *Optional[float]* | :heavy_minus_sign: | Current progress of the task updating the storage. | 0.5 | -| `error_message` | *Optional[str]* | :heavy_minus_sign: | Error message if the last storage changed failed. | Failed to update storage | \ No newline at end of file +| `error_message` | *Optional[str]* | :heavy_minus_sign: | Error message if the last storage changed failed. | Failed to update storage | +| `tasks` | [components.Tasks](../../models/components/tasks.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/docs/models/components/stream.md b/docs/models/components/stream.md index 631706e..6ea8386 100644 --- a/docs/models/components/stream.md +++ b/docs/models/components/stream.md @@ -5,8 +5,8 @@ | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | test_stream | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `name` | *str* | :heavy_check_mark: | N/A | test_stream | | ~~`kind`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | stream | | `creator_id` | [Optional[components.CreatorID]](../../models/components/creatorid.md) | :heavy_minus_sign: | N/A | | | `user_tags` | Dict[str, [components.StreamUserTags](../../models/components/streamusertags.md)] | :heavy_minus_sign: | User input tags associated with the stream | | diff --git a/docs/models/components/streampatchpayload.md b/docs/models/components/streampatchpayload.md index 224d447..0ecaa73 100644 --- a/docs/models/components/streampatchpayload.md +++ b/docs/models/components/streampatchpayload.md @@ -12,4 +12,5 @@ | `playback_policy` | [OptionalNullable[components.PlaybackPolicy]](../../models/components/playbackpolicy.md) | :heavy_minus_sign: | Whether the playback policy for an asset or stream is public or signed | | | `profiles` | List[[components.FfmpegProfile](../../models/components/ffmpegprofile.md)] | :heavy_minus_sign: | N/A | | | `recording_spec` | [Optional[components.RecordingSpec]](../../models/components/recordingspec.md) | :heavy_minus_sign: | N/A | | -| `user_tags` | Dict[str, [components.UserTags](../../models/components/usertags.md)] | :heavy_minus_sign: | User input tags associated with the stream | | \ No newline at end of file +| `user_tags` | Dict[str, [components.UserTags](../../models/components/usertags.md)] | :heavy_minus_sign: | User input tags associated with the stream | | +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | test_stream | \ No newline at end of file diff --git a/docs/models/components/studioapierror.md b/docs/models/components/studioapierror.md new file mode 100644 index 0000000..0c1ebbe --- /dev/null +++ b/docs/models/components/studioapierror.md @@ -0,0 +1,9 @@ +# StudioAPIError + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `errors` | List[*str*] | :heavy_minus_sign: | N/A | +| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/target.md b/docs/models/components/target.md new file mode 100644 index 0000000..6538f8c --- /dev/null +++ b/docs/models/components/target.md @@ -0,0 +1,11 @@ +# Target + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `profile` | *str* | :heavy_check_mark: | Name of transcoding profile that should be sent. Use
"source" for pushing source stream data
| 720p0 | +| `video_only` | *Optional[bool]* | :heavy_minus_sign: | If true, the stream audio will be muted and only silent
video will be pushed to the target.
| false | +| `id` | *Optional[str]* | :heavy_minus_sign: | ID of multistream target object where to push this stream | PUSH123 | +| `spec` | [Optional[components.TargetSpec]](../../models/components/targetspec.md) | :heavy_minus_sign: | Inline multistream target object. Will automatically
create the target resource to be used by the created
stream.
| | \ No newline at end of file diff --git a/docs/models/components/targetaddpayloadspec.md b/docs/models/components/targetaddpayloadspec.md index 7ffab69..3277651 100644 --- a/docs/models/components/targetaddpayloadspec.md +++ b/docs/models/components/targetaddpayloadspec.md @@ -10,5 +10,5 @@ stream. | Field | Type | Required | Description | Example | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `url` | *str* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | -| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | My target | \ No newline at end of file +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | My target | +| `url` | *str* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | \ No newline at end of file diff --git a/docs/models/components/targetspec.md b/docs/models/components/targetspec.md index bbf1306..af449b5 100644 --- a/docs/models/components/targetspec.md +++ b/docs/models/components/targetspec.md @@ -10,5 +10,5 @@ stream. | Field | Type | Required | Description | Example | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `url` | *str* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | -| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | My target | \ No newline at end of file +| `name` | *Optional[str]* | :heavy_minus_sign: | N/A | My target | +| `url` | *str* | :heavy_check_mark: | Livepeer-compatible multistream target URL (RTMP(S) or SRT) | rtmps://live.my-service.tv/channel/secretKey | \ No newline at end of file diff --git a/docs/models/components/texttoimageparams.md b/docs/models/components/texttoimageparams.md index 4f55bb0..fb3111c 100644 --- a/docs/models/components/texttoimageparams.md +++ b/docs/models/components/texttoimageparams.md @@ -3,15 +3,16 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `prompt` | *str* | :heavy_check_mark: | Text prompt(s) to guide image generation. Separate multiple prompts with '\|' if supported by the model. | -| `model_id` | *Optional[str]* | :heavy_minus_sign: | Hugging Face model ID used for image generation. | -| `height` | *Optional[int]* | :heavy_minus_sign: | The height in pixels of the generated image. | -| `width` | *Optional[int]* | :heavy_minus_sign: | The width in pixels of the generated image. | -| `guidance_scale` | *Optional[float]* | :heavy_minus_sign: | Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality). | -| `negative_prompt` | *Optional[str]* | :heavy_minus_sign: | Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1. | -| `safety_check` | *Optional[bool]* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | -| `seed` | *Optional[int]* | :heavy_minus_sign: | Seed for random number generation. | -| `num_inference_steps` | *Optional[int]* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | -| `num_images_per_prompt` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate per prompt. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `model_id` | *Optional[str]* | :heavy_minus_sign: | Hugging Face model ID used for image generation. | +| `loras` | *Optional[str]* | :heavy_minus_sign: | A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { "latent-consistency/lcm-lora-sdxl": 1.0, "nerijs/pixel-art-xl": 1.2}. | +| `prompt` | *str* | :heavy_check_mark: | Text prompt(s) to guide image generation. Separate multiple prompts with '\|' if supported by the model. | +| `height` | *Optional[int]* | :heavy_minus_sign: | The height in pixels of the generated image. | +| `width` | *Optional[int]* | :heavy_minus_sign: | The width in pixels of the generated image. | +| `guidance_scale` | *Optional[float]* | :heavy_minus_sign: | Encourages model to generate images closely linked to the text prompt (higher values may reduce image quality). | +| `negative_prompt` | *Optional[str]* | :heavy_minus_sign: | Text prompt(s) to guide what to exclude from image generation. Ignored if guidance_scale < 1. | +| `safety_check` | *Optional[bool]* | :heavy_minus_sign: | Perform a safety check to estimate if generated images could be offensive or harmful. | +| `seed` | *Optional[int]* | :heavy_minus_sign: | Seed for random number generation. | +| `num_inference_steps` | *Optional[int]* | :heavy_minus_sign: | Number of denoising steps. More steps usually lead to higher quality images but slower inference. Modulated by strength. | +| `num_images_per_prompt` | *Optional[int]* | :heavy_minus_sign: | Number of images to generate per prompt. | \ No newline at end of file diff --git a/docs/models/components/transcodeprofile.md b/docs/models/components/transcodeprofile.md index 5f244cd..e7739bb 100644 --- a/docs/models/components/transcodeprofile.md +++ b/docs/models/components/transcodeprofile.md @@ -7,10 +7,10 @@ Transcode API profile | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `bitrate` | *int* | :heavy_check_mark: | N/A | 3000000 | | `width` | *Optional[int]* | :heavy_minus_sign: | N/A | 1280 | | `name` | *Optional[str]* | :heavy_minus_sign: | N/A | 720p | | `height` | *Optional[int]* | :heavy_minus_sign: | N/A | 720 | +| `bitrate` | *int* | :heavy_check_mark: | N/A | 3000000 | | `quality` | *Optional[int]* | :heavy_minus_sign: | Restricts the size of the output video using the constant quality feature. Increasing this value will result in a lower quality video. Note that this parameter might not work if the transcoder lacks support for it.
| 23 | | `fps` | *Optional[int]* | :heavy_minus_sign: | N/A | 30 | | `fps_den` | *Optional[int]* | :heavy_minus_sign: | N/A | 1 | diff --git a/docs/models/components/videospec.md b/docs/models/components/videospec.md index 656075c..a0f70b7 100644 --- a/docs/models/components/videospec.md +++ b/docs/models/components/videospec.md @@ -7,7 +7,7 @@ Video metadata | Field | Type | Required | Description | Example | | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `format` | *Optional[str]* | :heavy_minus_sign: | Format of the asset | mp4 | +| `format_` | *Optional[str]* | :heavy_minus_sign: | Format of the asset | mp4 | | `duration` | *Optional[float]* | :heavy_minus_sign: | Duration of the asset in seconds (float) | 23.8328 | | `bitrate` | *Optional[float]* | :heavy_minus_sign: | Bitrate of the video in bits per second | 1000000 | | `tracks` | List[[components.Tracks](../../models/components/tracks.md)] | :heavy_minus_sign: | List of tracks associated with the asset when the format
contemplates them (e.g. mp4)
| | \ No newline at end of file diff --git a/docs/models/components/viewershipmetric.md b/docs/models/components/viewershipmetric.md index b994a9d..9e4b314 100644 --- a/docs/models/components/viewershipmetric.md +++ b/docs/models/components/viewershipmetric.md @@ -9,8 +9,6 @@ An individual metric about viewership of a stream/asset. Necessarily, at least | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `view_count` | *int* | :heavy_check_mark: | The number of views for the stream/asset. | 100 | -| `playtime_mins` | *float* | :heavy_check_mark: | The total playtime in minutes for the stream/asset. | 10 | | `playback_id` | *Optional[str]* | :heavy_minus_sign: | The playback ID associated with the metric. | 1bde4o2i6xycudoy | | `creator_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the creator associated with the metric. | john@doe.com | | `viewer_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the viewer associated with the metric. | 1bde4o2i6xycudoy | @@ -27,6 +25,8 @@ An individual metric about viewership of a stream/asset. Necessarily, at least | `subdivision` | *Optional[str]* | :heavy_minus_sign: | The subdivision (e.g., state or province) where the viewer is
located.
| California | | `timezone` | *Optional[str]* | :heavy_minus_sign: | The timezone where the viewer is located. | America/Los_Angeles | | `geohash` | *Optional[str]* | :heavy_minus_sign: | Geographic encoding of the viewers location. Accurate to 3 digits. | 123 | +| `view_count` | *int* | :heavy_check_mark: | The number of views for the stream/asset. | 100 | +| `playtime_mins` | *float* | :heavy_check_mark: | The total playtime in minutes for the stream/asset. | 10 | | `ttff_ms` | *Optional[float]* | :heavy_minus_sign: | The time-to-first-frame (TTFF) in milliseconds. | 100 | | `rebuffer_ratio` | *Optional[float]* | :heavy_minus_sign: | The rebuffering ratio for the asset. | 0.1 | | `error_rate` | *Optional[float]* | :heavy_minus_sign: | The error rate for the stream/asset. | 0.1 | diff --git a/docs/models/components/webhook.md b/docs/models/components/webhook.md index 5190ec2..7397431 100644 --- a/docs/models/components/webhook.md +++ b/docs/models/components/webhook.md @@ -5,13 +5,13 @@ | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `name` | *str* | :heavy_check_mark: | N/A | test_webhook | -| `url` | *str* | :heavy_check_mark: | N/A | https://my-service.com/webhook | | `id` | *Optional[str]* | :heavy_minus_sign: | N/A | de7818e7-610a-4057-8f6f-b785dc1e6f88 | +| `name` | *str* | :heavy_check_mark: | N/A | test_webhook | | ~~`kind`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | webhook | | ~~`user_id`~~ | *Optional[str]* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | | `project_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | | `created_at` | *Optional[float]* | :heavy_minus_sign: | Timestamp (in milliseconds) at which stream object was created | 1587667174725 | | `events` | List[[components.Events](../../models/components/events.md)] | :heavy_minus_sign: | N/A | [
"stream.started",
"stream.idle"
] | +| `url` | *str* | :heavy_check_mark: | N/A | https://my-service.com/webhook | | `stream_id` | *Optional[str]* | :heavy_minus_sign: | streamId of the stream on which the webhook is applied | de7818e7-610a-4057-8f6f-b785dc1e6f88 | | `status` | [Optional[components.Status]](../../models/components/status.md) | :heavy_minus_sign: | status of webhook | | \ No newline at end of file diff --git a/docs/models/components/webhookinput.md b/docs/models/components/webhookinput.md new file mode 100644 index 0000000..8741df5 --- /dev/null +++ b/docs/models/components/webhookinput.md @@ -0,0 +1,13 @@ +# WebhookInput + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `name` | *str* | :heavy_check_mark: | N/A | test_webhook | +| `project_id` | *Optional[str]* | :heavy_minus_sign: | The ID of the project | aac12556-4d65-4d34-9fb6-d1f0985eb0a9 | +| `events` | List[[components.Events](../../models/components/events.md)] | :heavy_minus_sign: | N/A | [
"stream.started",
"stream.idle"
] | +| `url` | *str* | :heavy_check_mark: | N/A | https://my-service.com/webhook | +| `shared_secret` | *Optional[str]* | :heavy_minus_sign: | shared secret used to sign the webhook payload | my-secret | +| `stream_id` | *Optional[str]* | :heavy_minus_sign: | streamId of the stream on which the webhook is applied | de7818e7-610a-4057-8f6f-b785dc1e6f88 | \ No newline at end of file diff --git a/docs/models/errors/genaudiototextgenerateresponse415responsebody.md b/docs/models/errors/genaudiototextgenerateresponse415responsebody.md new file mode 100644 index 0000000..afc456d --- /dev/null +++ b/docs/models/errors/genaudiototextgenerateresponse415responsebody.md @@ -0,0 +1,19 @@ +# GenAudioToTextGenerateResponse415ResponseBody + +Unsupported Media Type + + +## Supported Types + +### `errors.HTTPError` + +```python +value: errors.HTTPError = /* values here */ +``` + +### `errors.StudioAPIError` + +```python +value: errors.StudioAPIError = /* values here */ +``` + diff --git a/docs/models/errors/genllmgenerateresponse500responsebody.md b/docs/models/errors/genllmgenerateresponse500responsebody.md new file mode 100644 index 0000000..235175c --- /dev/null +++ b/docs/models/errors/genllmgenerateresponse500responsebody.md @@ -0,0 +1,19 @@ +# GenLLMGenerateResponse500ResponseBody + +Internal Server Error + + +## Supported Types + +### `errors.HTTPError` + +```python +value: errors.HTTPError = /* values here */ +``` + +### `errors.StudioAPIError` + +```python +value: errors.StudioAPIError = /* values here */ +``` + diff --git a/docs/models/errors/genllmgenerateresponsebody.md b/docs/models/errors/genllmgenerateresponsebody.md new file mode 100644 index 0000000..281a7c3 --- /dev/null +++ b/docs/models/errors/genllmgenerateresponsebody.md @@ -0,0 +1,19 @@ +# GenLLMGenerateResponseBody + +Unauthorized + + +## Supported Types + +### `errors.HTTPError` + +```python +value: errors.HTTPError = /* values here */ +``` + +### `errors.StudioAPIError` + +```python +value: errors.StudioAPIError = /* values here */ +``` + diff --git a/docs/models/errors/genllmgenerateresponseresponsebody.md b/docs/models/errors/genllmgenerateresponseresponsebody.md new file mode 100644 index 0000000..d429c4e --- /dev/null +++ b/docs/models/errors/genllmgenerateresponseresponsebody.md @@ -0,0 +1,19 @@ +# GenLLMGenerateResponseResponseBody + +Validation Error + + +## Supported Types + +### `errors.HTTPValidationError` + +```python +value: errors.HTTPValidationError = /* values here */ +``` + +### `errors.StudioAPIError` + +```python +value: errors.StudioAPIError = /* values here */ +``` + diff --git a/docs/models/errors/genllmresponsebody.md b/docs/models/errors/genllmresponsebody.md new file mode 100644 index 0000000..7b9455f --- /dev/null +++ b/docs/models/errors/genllmresponsebody.md @@ -0,0 +1,19 @@ +# GenLLMResponseBody + +Bad Request + + +## Supported Types + +### `errors.HTTPError` + +```python +value: errors.HTTPError = /* values here */ +``` + +### `errors.StudioAPIError` + +```python +value: errors.StudioAPIError = /* values here */ +``` + diff --git a/docs/models/errors/httperror.md b/docs/models/errors/httperror.md index 41b434c..824e580 100644 --- a/docs/models/errors/httperror.md +++ b/docs/models/errors/httperror.md @@ -8,22 +8,4 @@ HTTP error response model. | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `detail` | [components.APIError](../../models/components/apierror.md) | :heavy_check_mark: | Detailed error information. | -| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta1` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta2` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta3` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta4` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta5` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta6` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta7` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta8` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta9` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta10` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta11` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta12` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta13` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta14` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta15` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta16` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta17` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta18` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/httpvalidationerror.md b/docs/models/errors/httpvalidationerror.md index cdabf14..73f362b 100644 --- a/docs/models/errors/httpvalidationerror.md +++ b/docs/models/errors/httpvalidationerror.md @@ -5,10 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta1` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta2` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta3` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta4` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta5` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `detail` | List[[components.ValidationError](../../models/components/validationerror.md)] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `detail` | List[[components.ValidationError](../../models/components/validationerror.md)] | :heavy_minus_sign: | N/A | +| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/studioapierror.md b/docs/models/errors/studioapierror.md index cfab96a..0c1ebbe 100644 --- a/docs/models/errors/studioapierror.md +++ b/docs/models/errors/studioapierror.md @@ -1,35 +1,9 @@ # StudioAPIError -Error - ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta1` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta2` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta3` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta4` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta5` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta6` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta7` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta8` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta9` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta10` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta11` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta12` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta13` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta14` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta15` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta16` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta17` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta18` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta19` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta20` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta21` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta22` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta23` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `http_meta24` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `errors` | List[*str*] | :heavy_minus_sign: | N/A | \ No newline at end of file +| `errors` | List[*str*] | :heavy_minus_sign: | N/A | +| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addmultistreamtargetresponse.md b/docs/models/operations/addmultistreamtargetresponse.md index cd8014c..3a7717f 100644 --- a/docs/models/operations/addmultistreamtargetresponse.md +++ b/docs/models/operations/addmultistreamtargetresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createclipresponse.md b/docs/models/operations/createclipresponse.md index 612da92..b7a6f19 100644 --- a/docs/models/operations/createclipresponse.md +++ b/docs/models/operations/createclipresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | [Optional[operations.CreateClipData]](../../models/operations/createclipdata.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createmultistreamtargetresponse.md b/docs/models/operations/createmultistreamtargetresponse.md index 3897522..7b5d2b9 100644 --- a/docs/models/operations/createmultistreamtargetresponse.md +++ b/docs/models/operations/createmultistreamtargetresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `multistream_target` | [Optional[components.MultistreamTarget]](../../models/components/multistreamtarget.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createroomresponse.md b/docs/models/operations/createroomresponse.md index 9d49675..740fa23 100644 --- a/docs/models/operations/createroomresponse.md +++ b/docs/models/operations/createroomresponse.md @@ -7,4 +7,4 @@ | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `create_room_response` | [Optional[components.CreateRoomResponse]](../../models/components/createroomresponse.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createroomuserresponse.md b/docs/models/operations/createroomuserresponse.md index 461d902..5b24a0a 100644 --- a/docs/models/operations/createroomuserresponse.md +++ b/docs/models/operations/createroomuserresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `room_user_response` | [Optional[components.RoomUserResponse]](../../models/components/roomuserresponse.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createsigningkeyresponse.md b/docs/models/operations/createsigningkeyresponse.md index 4e018a3..b9973e7 100644 --- a/docs/models/operations/createsigningkeyresponse.md +++ b/docs/models/operations/createsigningkeyresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `signing_key` | [Optional[components.SigningKey]](../../models/components/signingkey.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createstreamresponse.md b/docs/models/operations/createstreamresponse.md index 1482751..76b164e 100644 --- a/docs/models/operations/createstreamresponse.md +++ b/docs/models/operations/createstreamresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `stream` | [Optional[components.Stream]](../../models/components/stream.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/createwebhookresponse.md b/docs/models/operations/createwebhookresponse.md index 08542a4..00f69bb 100644 --- a/docs/models/operations/createwebhookresponse.md +++ b/docs/models/operations/createwebhookresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `webhook` | [Optional[components.Webhook]](../../models/components/webhook.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deleteassetresponse.md b/docs/models/operations/deleteassetresponse.md index 90e5945..a18c72a 100644 --- a/docs/models/operations/deleteassetresponse.md +++ b/docs/models/operations/deleteassetresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deletemultistreamtargetresponse.md b/docs/models/operations/deletemultistreamtargetresponse.md index d0dcf8b..281d88c 100644 --- a/docs/models/operations/deletemultistreamtargetresponse.md +++ b/docs/models/operations/deletemultistreamtargetresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deleteroomresponse.md b/docs/models/operations/deleteroomresponse.md index a3a9298..03808e0 100644 --- a/docs/models/operations/deleteroomresponse.md +++ b/docs/models/operations/deleteroomresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deleteroomuserresponse.md b/docs/models/operations/deleteroomuserresponse.md index 9e8085d..587064c 100644 --- a/docs/models/operations/deleteroomuserresponse.md +++ b/docs/models/operations/deleteroomuserresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deletesigningkeyresponse.md b/docs/models/operations/deletesigningkeyresponse.md index e1758fe..2638362 100644 --- a/docs/models/operations/deletesigningkeyresponse.md +++ b/docs/models/operations/deletesigningkeyresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deletestreamresponse.md b/docs/models/operations/deletestreamresponse.md index 3fd0726..6f57f2c 100644 --- a/docs/models/operations/deletestreamresponse.md +++ b/docs/models/operations/deletestreamresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/deletewebhookresponse.md b/docs/models/operations/deletewebhookresponse.md index 04ff0b6..7282e3f 100644 --- a/docs/models/operations/deletewebhookresponse.md +++ b/docs/models/operations/deletewebhookresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `webhook` | [Optional[components.Webhook]](../../models/components/webhook.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/genllmresponse.md b/docs/models/operations/genllmresponse.md new file mode 100644 index 0000000..b72751b --- /dev/null +++ b/docs/models/operations/genllmresponse.md @@ -0,0 +1,10 @@ +# GenLLMResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `llm_response` | [Optional[components.LLMResponse]](../../models/components/llmresponse.md) | :heavy_minus_sign: | Successful Response | +| `studio_api_error` | *Optional[errors.StudioAPIError]* | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/gentexttoimageresponse.md b/docs/models/operations/gentexttoimageresponse.md index df754f0..7c32825 100644 --- a/docs/models/operations/gentexttoimageresponse.md +++ b/docs/models/operations/gentexttoimageresponse.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `image_response` | [Optional[components.ImageResponse]](../../models/components/imageresponse.md) | :heavy_minus_sign: | Successful Response | -| `studio_api_error` | *Optional[errors.StudioAPIError]* | :heavy_minus_sign: | Error | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | +| `image_response` | [Optional[components.ImageResponse]](../../models/components/imageresponse.md) | :heavy_minus_sign: | Successful Response | +| `studio_api_error` | [Optional[components.StudioAPIError]](../../models/components/studioapierror.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getassetresponse.md b/docs/models/operations/getassetresponse.md index 27c1eba..85b4db7 100644 --- a/docs/models/operations/getassetresponse.md +++ b/docs/models/operations/getassetresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `asset` | [Optional[components.Asset]](../../models/components/asset.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getassetsresponse.md b/docs/models/operations/getassetsresponse.md index 4572c43..63db5b6 100644 --- a/docs/models/operations/getassetsresponse.md +++ b/docs/models/operations/getassetsresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Asset](../../models/components/asset.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getclipsresponse.md b/docs/models/operations/getclipsresponse.md index f1d7034..d27e6d3 100644 --- a/docs/models/operations/getclipsresponse.md +++ b/docs/models/operations/getclipsresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Asset](../../models/components/asset.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getcreatorviewershipmetricsresponse.md b/docs/models/operations/getcreatorviewershipmetricsresponse.md index 1ae4d50..8891181 100644 --- a/docs/models/operations/getcreatorviewershipmetricsresponse.md +++ b/docs/models/operations/getcreatorviewershipmetricsresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.ViewershipMetric](../../models/components/viewershipmetric.md)] | :heavy_minus_sign: | A list of Metric objects | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getmultistreamtargetresponse.md b/docs/models/operations/getmultistreamtargetresponse.md index 05f5d8d..7c8ec6d 100644 --- a/docs/models/operations/getmultistreamtargetresponse.md +++ b/docs/models/operations/getmultistreamtargetresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `multistream_target` | [Optional[components.MultistreamTarget]](../../models/components/multistreamtarget.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getmultistreamtargetsresponse.md b/docs/models/operations/getmultistreamtargetsresponse.md index 0d930c7..3648e72 100644 --- a/docs/models/operations/getmultistreamtargetsresponse.md +++ b/docs/models/operations/getmultistreamtargetsresponse.md @@ -7,4 +7,4 @@ | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.MultistreamTarget](../../models/components/multistreamtarget.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getplaybackinforesponse.md b/docs/models/operations/getplaybackinforesponse.md index 5769c1d..8095cae 100644 --- a/docs/models/operations/getplaybackinforesponse.md +++ b/docs/models/operations/getplaybackinforesponse.md @@ -7,4 +7,4 @@ | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `playback_info` | [Optional[components.PlaybackInfo]](../../models/components/playbackinfo.md) | :heavy_minus_sign: | Successful response | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Playback not found | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Playback not found | \ No newline at end of file diff --git a/docs/models/operations/getpublicviewershipmetricsresponse.md b/docs/models/operations/getpublicviewershipmetricsresponse.md index bd66d2e..e1d502a 100644 --- a/docs/models/operations/getpublicviewershipmetricsresponse.md +++ b/docs/models/operations/getpublicviewershipmetricsresponse.md @@ -7,4 +7,4 @@ | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | [Optional[operations.GetPublicViewershipMetricsData]](../../models/operations/getpublicviewershipmetricsdata.md) | :heavy_minus_sign: | A single Metric object with the viewCount and playtimeMins metrics. | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getrealtimeviewershipnowresponse.md b/docs/models/operations/getrealtimeviewershipnowresponse.md index 603dafe..406d59b 100644 --- a/docs/models/operations/getrealtimeviewershipnowresponse.md +++ b/docs/models/operations/getrealtimeviewershipnowresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.RealtimeViewershipMetric](../../models/components/realtimeviewershipmetric.md)] | :heavy_minus_sign: | A list of Metric objects | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getrecordedsessionsresponse.md b/docs/models/operations/getrecordedsessionsresponse.md index 89363ad..d13f1b3 100644 --- a/docs/models/operations/getrecordedsessionsresponse.md +++ b/docs/models/operations/getrecordedsessionsresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Session](../../models/components/session.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getroomresponse.md b/docs/models/operations/getroomresponse.md index 21bf5f8..0b82c04 100644 --- a/docs/models/operations/getroomresponse.md +++ b/docs/models/operations/getroomresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `room` | [Optional[components.Room]](../../models/components/room.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getroomuserresponse.md b/docs/models/operations/getroomuserresponse.md index e14cda5..abed0cf 100644 --- a/docs/models/operations/getroomuserresponse.md +++ b/docs/models/operations/getroomuserresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `get_room_user_response` | [Optional[components.GetRoomUserResponse]](../../models/components/getroomuserresponse.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getsessionclipsresponse.md b/docs/models/operations/getsessionclipsresponse.md index 24b68af..76cc86a 100644 --- a/docs/models/operations/getsessionclipsresponse.md +++ b/docs/models/operations/getsessionclipsresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Asset](../../models/components/asset.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getsessionresponse.md b/docs/models/operations/getsessionresponse.md index ce3b8c7..f87d8e3 100644 --- a/docs/models/operations/getsessionresponse.md +++ b/docs/models/operations/getsessionresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `session` | [Optional[components.Session]](../../models/components/session.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getsessionsresponse.md b/docs/models/operations/getsessionsresponse.md index a50e6ff..8982d77 100644 --- a/docs/models/operations/getsessionsresponse.md +++ b/docs/models/operations/getsessionsresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Session](../../models/components/session.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getsigningkeyresponse.md b/docs/models/operations/getsigningkeyresponse.md index ab7547a..b4085dc 100644 --- a/docs/models/operations/getsigningkeyresponse.md +++ b/docs/models/operations/getsigningkeyresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `signing_key` | [Optional[components.SigningKey]](../../models/components/signingkey.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getsigningkeysresponse.md b/docs/models/operations/getsigningkeysresponse.md index 578a77d..90b5ab5 100644 --- a/docs/models/operations/getsigningkeysresponse.md +++ b/docs/models/operations/getsigningkeysresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.SigningKey](../../models/components/signingkey.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getstreamresponse.md b/docs/models/operations/getstreamresponse.md index 084772d..3ae8aae 100644 --- a/docs/models/operations/getstreamresponse.md +++ b/docs/models/operations/getstreamresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `stream` | [Optional[components.Stream]](../../models/components/stream.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getstreamsresponse.md b/docs/models/operations/getstreamsresponse.md index 527c651..c0515b0 100644 --- a/docs/models/operations/getstreamsresponse.md +++ b/docs/models/operations/getstreamsresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Stream](../../models/components/stream.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/gettasksresponse.md b/docs/models/operations/gettasksresponse.md index dcd2aff..7d438dc 100644 --- a/docs/models/operations/gettasksresponse.md +++ b/docs/models/operations/gettasksresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Task](../../models/components/task.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getusagemetricsresponse.md b/docs/models/operations/getusagemetricsresponse.md index a0db105..b62ca84 100644 --- a/docs/models/operations/getusagemetricsresponse.md +++ b/docs/models/operations/getusagemetricsresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `usage_metric` | [Optional[components.UsageMetric]](../../models/components/usagemetric.md) | :heavy_minus_sign: | A Usage Metric object | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getviewershipmetricsresponse.md b/docs/models/operations/getviewershipmetricsresponse.md index 8f796d1..62c5417 100644 --- a/docs/models/operations/getviewershipmetricsresponse.md +++ b/docs/models/operations/getviewershipmetricsresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.ViewershipMetric](../../models/components/viewershipmetric.md)] | :heavy_minus_sign: | A list of Metric objects | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getwebhooklogresponse.md b/docs/models/operations/getwebhooklogresponse.md index fdcef2c..b2d2217 100644 --- a/docs/models/operations/getwebhooklogresponse.md +++ b/docs/models/operations/getwebhooklogresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `webhook_log` | [Optional[components.WebhookLog]](../../models/components/webhooklog.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getwebhooklogsresponse.md b/docs/models/operations/getwebhooklogsresponse.md index 88c8a3f..11c6c32 100644 --- a/docs/models/operations/getwebhooklogsresponse.md +++ b/docs/models/operations/getwebhooklogsresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.WebhookLog](../../models/components/webhooklog.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getwebhookresponse.md b/docs/models/operations/getwebhookresponse.md index 99ebd10..ad97a10 100644 --- a/docs/models/operations/getwebhookresponse.md +++ b/docs/models/operations/getwebhookresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `webhook` | [Optional[components.Webhook]](../../models/components/webhook.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/getwebhooksresponse.md b/docs/models/operations/getwebhooksresponse.md index 4ef11fd..40dd3f5 100644 --- a/docs/models/operations/getwebhooksresponse.md +++ b/docs/models/operations/getwebhooksresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | List[[components.Webhook](../../models/components/webhook.md)] | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/removemultistreamtargetresponse.md b/docs/models/operations/removemultistreamtargetresponse.md index b102046..18be702 100644 --- a/docs/models/operations/removemultistreamtargetresponse.md +++ b/docs/models/operations/removemultistreamtargetresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/requestuploadresponse.md b/docs/models/operations/requestuploadresponse.md index 7d5c9ac..c0908de 100644 --- a/docs/models/operations/requestuploadresponse.md +++ b/docs/models/operations/requestuploadresponse.md @@ -7,4 +7,4 @@ | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `data` | [Optional[operations.RequestUploadData]](../../models/operations/requestuploaddata.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/resendwebhookresponse.md b/docs/models/operations/resendwebhookresponse.md index 483c4d3..1159ed9 100644 --- a/docs/models/operations/resendwebhookresponse.md +++ b/docs/models/operations/resendwebhookresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `webhook_log` | [Optional[components.WebhookLog]](../../models/components/webhooklog.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/startpullstreamresponse.md b/docs/models/operations/startpullstreamresponse.md index 64554d2..775e44d 100644 --- a/docs/models/operations/startpullstreamresponse.md +++ b/docs/models/operations/startpullstreamresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/startroomegressresponse.md b/docs/models/operations/startroomegressresponse.md index 06ce886..c86bc7b 100644 --- a/docs/models/operations/startroomegressresponse.md +++ b/docs/models/operations/startroomegressresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/stoproomegressresponse.md b/docs/models/operations/stoproomegressresponse.md index 1b1ffd0..2899db1 100644 --- a/docs/models/operations/stoproomegressresponse.md +++ b/docs/models/operations/stoproomegressresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/terminatestreamresponse.md b/docs/models/operations/terminatestreamresponse.md index b1c1779..1705cc0 100644 --- a/docs/models/operations/terminatestreamresponse.md +++ b/docs/models/operations/terminatestreamresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/transcodevideoresponse.md b/docs/models/operations/transcodevideoresponse.md index 4b16179..3ad7f5d 100644 --- a/docs/models/operations/transcodevideoresponse.md +++ b/docs/models/operations/transcodevideoresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `task` | [Optional[components.Task]](../../models/components/task.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/updateassetresponse.md b/docs/models/operations/updateassetresponse.md index 59a0840..49bda4e 100644 --- a/docs/models/operations/updateassetresponse.md +++ b/docs/models/operations/updateassetresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `asset` | [Optional[components.Asset]](../../models/components/asset.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/updatemultistreamtargetrequest.md b/docs/models/operations/updatemultistreamtargetrequest.md index 7163a71..b965e0c 100644 --- a/docs/models/operations/updatemultistreamtargetrequest.md +++ b/docs/models/operations/updatemultistreamtargetrequest.md @@ -3,7 +3,7 @@ ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the multistream target | -| `multistream_target_patch_payload` | [components.MultistreamTargetPatchPayload](../../models/components/multistreamtargetpatchpayload.md) | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the multistream target | +| `multistream_target` | [components.MultistreamTargetInput](../../models/components/multistreamtargetinput.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatemultistreamtargetresponse.md b/docs/models/operations/updatemultistreamtargetresponse.md index 1ab6ed4..596d6a8 100644 --- a/docs/models/operations/updatemultistreamtargetresponse.md +++ b/docs/models/operations/updatemultistreamtargetresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/updateroomuserresponse.md b/docs/models/operations/updateroomuserresponse.md index 307fc84..3a0bc18 100644 --- a/docs/models/operations/updateroomuserresponse.md +++ b/docs/models/operations/updateroomuserresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/updatesigningkeyresponse.md b/docs/models/operations/updatesigningkeyresponse.md index 6391b44..a91570d 100644 --- a/docs/models/operations/updatesigningkeyresponse.md +++ b/docs/models/operations/updatesigningkeyresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/updatestreamresponse.md b/docs/models/operations/updatestreamresponse.md index 7813ea0..03d9155 100644 --- a/docs/models/operations/updatestreamresponse.md +++ b/docs/models/operations/updatestreamresponse.md @@ -6,4 +6,4 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/updatewebhookresponse.md b/docs/models/operations/updatewebhookresponse.md index 29ba655..551625b 100644 --- a/docs/models/operations/updatewebhookresponse.md +++ b/docs/models/operations/updatewebhookresponse.md @@ -7,4 +7,4 @@ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `webhook` | [Optional[components.Webhook]](../../models/components/webhook.md) | :heavy_minus_sign: | Success | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/models/operations/uploadassetresponse.md b/docs/models/operations/uploadassetresponse.md index a512e4a..daec12b 100644 --- a/docs/models/operations/uploadassetresponse.md +++ b/docs/models/operations/uploadassetresponse.md @@ -8,4 +8,4 @@ | `http_meta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | | `two_hundred_application_json_data` | [Optional[operations.UploadAssetData]](../../models/operations/uploadassetdata.md) | :heavy_minus_sign: | Upload in progress | | `two_hundred_and_one_application_json_data` | [Optional[operations.UploadAssetDataOutput]](../../models/operations/uploadassetdataoutput.md) | :heavy_minus_sign: | Upload started | -| `error` | *Optional[errors.Error]* | :heavy_minus_sign: | Error | \ No newline at end of file +| `error` | [Optional[components.Error]](../../models/components/error.md) | :heavy_minus_sign: | Error | \ No newline at end of file diff --git a/docs/sdks/accesscontrol/README.md b/docs/sdks/accesscontrol/README.md index a4cd301..015c2f0 100644 --- a/docs/sdks/accesscontrol/README.md +++ b/docs/sdks/accesscontrol/README.md @@ -24,15 +24,17 @@ Up to 10 signing keys can be generated, after that you must delete at least one ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.access_control.create() -res = s.access_control.create() + assert res.signing_key is not None -if res.signing_key is not None: - # handle response - pass + # Handle response + print(res.signing_key) ``` @@ -48,10 +50,9 @@ if res.signing_key is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_all @@ -62,15 +63,17 @@ Retrieves signing keys ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.access_control.get_all() + res = l_client.access_control.get_all() -if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) ``` @@ -86,10 +89,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -100,15 +102,17 @@ Delete Signing Key ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.access_control.delete(key_id="") + res = l_client.access_control.delete(key_id="") -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -125,10 +129,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -139,15 +142,17 @@ Retrieves a signing key ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.access_control.get(key_id="") -res = s.access_control.get(key_id="") + assert res.signing_key is not None -if res.signing_key is not None: - # handle response - pass + # Handle response + print(res.signing_key) ``` @@ -164,10 +169,9 @@ if res.signing_key is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -178,15 +182,17 @@ Update a signing key ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.access_control.update(key_id="", request_body={}) -res = s.access_control.update(key_id="", request_body={}) + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -204,6 +210,6 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/asset/README.md b/docs/sdks/asset/README.md index f1b540e..9349da7 100644 --- a/docs/sdks/asset/README.md +++ b/docs/sdks/asset/README.md @@ -23,15 +23,17 @@ Retrieve assets ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.asset.get_all() -res = s.asset.get_all() + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -47,10 +49,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -133,40 +134,54 @@ definition above. from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.asset.create(request={ - "name": "filename.mp4", - "static_mp4": True, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", - }, - "refresh_interval": 600, - }, - "profiles": [ - { - "bitrate": 3000000, - "width": 1280, - "name": "720p", - "height": 720, - "quality": 23, - "fps": 30, - "fps_den": 1, - "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, +) as l_client: + + res = l_client.asset.create(request={ + "name": "filename.mp4", + "static_mp4": True, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], -}) - -if res.data is not None: - # handle response - pass + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }) + + assert res.data is not None + + # Handle response + print(res.data) ``` @@ -183,10 +198,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## create_via_url @@ -198,41 +212,55 @@ Upload asset via URL from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.asset.create_via_url(request={ - "name": "filename.mp4", - "url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4", - "static_mp4": True, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", +) as l_client: + + res = l_client.asset.create_via_url(request={ + "name": "filename.mp4", + "static_mp4": True, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - "refresh_interval": 600, - }, - "profiles": [ - { - "bitrate": 3000000, - "width": 1280, - "name": "720p", - "height": 720, - "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 + "url": "https://s3.amazonaws.com/my-bucket/path/filename.mp4", + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }) + + assert res.two_hundred_application_json_data is not None + + # Handle response + print(res.two_hundred_application_json_data) ``` @@ -249,10 +277,9 @@ if res.two_hundred_application_json_data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -263,15 +290,17 @@ Retrieves an asset ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.asset.get(asset_id="") -res = s.asset.get(asset_id="") + assert res.asset is not None -if res.asset is not None: - # handle response - pass + # Handle response + print(res.asset) ``` @@ -288,10 +317,9 @@ if res.asset is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -303,25 +331,27 @@ Patch an asset from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.asset.update(asset_id="", asset_patch_payload={ - "name": "filename.mp4", - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", +) as l_client: + + res = l_client.asset.update(asset_id="", asset_patch_payload={ + "name": "filename.mp4", + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - "refresh_interval": 600, - }, -}) + }) -if res.asset is not None: - # handle response - pass + assert res.asset is not None + + # Handle response + print(res.asset) ``` @@ -339,10 +369,9 @@ if res.asset is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -353,15 +382,17 @@ Delete an asset ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.asset.delete(asset_id="") -res = s.asset.delete(asset_id="") + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -378,6 +409,6 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/generate/README.md b/docs/sdks/generate/README.md index 90da4a1..57b7baa 100644 --- a/docs/sdks/generate/README.md +++ b/docs/sdks/generate/README.md @@ -13,6 +13,7 @@ Operations related to AI generate api * [upscale](#upscale) - Upscale * [audio_to_text](#audio_to_text) - Audio To Text * [segment_anything2](#segment_anything2) - Segment Anything 2 +* [llm](#llm) - LLM ## text_to_image @@ -23,17 +24,19 @@ Generate images from text prompts. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.generate.text_to_image(request={ + "prompt": "", + }) -res = s.generate.text_to_image(request={ - "prompt": "", -}) + assert res.image_response is not None -if res.image_response is not None: - # handle response - pass + # Handle response + print(res.image_response) ``` @@ -50,14 +53,17 @@ if res.image_response is not None: ### Errors -| Error Object | Status Code | Content Type | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| errors.GenTextToImageResponseBody | 400 | application/json | -| errors.GenTextToImageGenerateResponseBody | 401 | application/json | -| errors.GenTextToImageGenerateResponseResponseBody | 422 | application/json | -| errors.GenTextToImageGenerateResponse500ResponseBody | 500 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## image_to_image @@ -68,21 +74,23 @@ Apply image transformations to a provided image. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.generate.image_to_image(request={ + "prompt": "", + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) -res = s.generate.image_to_image(request={ - "prompt": "", - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, -}) + assert res.image_response is not None -if res.image_response is not None: - # handle response - pass + # Handle response + print(res.image_response) ``` @@ -99,14 +107,17 @@ if res.image_response is not None: ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| errors.GenImageToImageResponseBody | 400 | application/json | -| errors.GenImageToImageGenerateResponseBody | 401 | application/json | -| errors.GenImageToImageGenerateResponseResponseBody | 422 | application/json | -| errors.GenImageToImageGenerateResponse500ResponseBody | 500 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## image_to_video @@ -117,20 +128,22 @@ Generate a video from a provided image. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.generate.image_to_video(request={ + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) -res = s.generate.image_to_video(request={ - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, -}) + assert res.video_response is not None -if res.video_response is not None: - # handle response - pass + # Handle response + print(res.video_response) ``` @@ -147,14 +160,17 @@ if res.video_response is not None: ### Errors -| Error Object | Status Code | Content Type | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| errors.GenImageToVideoResponseBody | 400 | application/json | -| errors.GenImageToVideoGenerateResponseBody | 401 | application/json | -| errors.GenImageToVideoGenerateResponseResponseBody | 422 | application/json | -| errors.GenImageToVideoGenerateResponse500ResponseBody | 500 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## upscale @@ -165,21 +181,23 @@ Upscale an image by increasing its resolution. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.generate.upscale(request={ + "prompt": "", + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) -res = s.generate.upscale(request={ - "prompt": "", - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, -}) + assert res.image_response is not None -if res.image_response is not None: - # handle response - pass + # Handle response + print(res.image_response) ``` @@ -196,14 +214,17 @@ if res.image_response is not None: ### Errors -| Error Object | Status Code | Content Type | -| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | -| errors.GenUpscaleResponseBody | 400 | application/json | -| errors.GenUpscaleGenerateResponseBody | 401 | application/json | -| errors.GenUpscaleGenerateResponseResponseBody | 422 | application/json | -| errors.GenUpscaleGenerateResponse500ResponseBody | 500 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## audio_to_text @@ -214,20 +235,22 @@ Transcribe audio files to text. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.generate.audio_to_text(request={ + "audio": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) -res = s.generate.audio_to_text(request={ - "audio": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, -}) + assert res.text_response is not None -if res.text_response is not None: - # handle response - pass + # Handle response + print(res.text_response) ``` @@ -244,15 +267,21 @@ if res.text_response is not None: ### Errors -| Error Object | Status Code | Content Type | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | -| errors.GenAudioToTextResponseBody | 400 | application/json | -| errors.GenAudioToTextGenerateResponseBody | 401 | application/json | -| errors.GenAudioToTextGenerateResponseResponseBody | 413 | application/json | -| errors.GenAudioToTextGenerateResponse422ResponseBody | 422 | application/json | -| errors.GenAudioToTextGenerateResponse500ResponseBody | 500 | application/json | -| errors.SDKError | 4xx-5xx | */* | - +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPError | 413 | application/json | +| errors.StudioAPIError | 413 | application/json | +| errors.HTTPError | 415 | application/json | +| errors.StudioAPIError | 415 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | ## segment_anything2 @@ -263,20 +292,22 @@ Segment objects in an image. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.generate.segment_anything2(request={ - "image": { - "file_name": "example.file", - "content": open("example.file", "rb"), - }, -}) + res = l_client.generate.segment_anything2(request={ + "image": { + "file_name": "example.file", + "content": open("example.file", "rb"), + }, + }) -if res.masks_response is not None: - # handle response - pass + assert res.masks_response is not None + + # Handle response + print(res.masks_response) ``` @@ -293,10 +324,64 @@ if res.masks_response is not None: ### Errors -| Error Object | Status Code | Content Type | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| errors.GenSegmentAnything2ResponseBody | 400 | application/json | -| errors.GenSegmentAnything2GenerateResponseBody | 401 | application/json | -| errors.GenSegmentAnything2GenerateResponseResponseBody | 422 | application/json | -| errors.GenSegmentAnything2GenerateResponse500ResponseBody | 500 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## llm + +Generate text using a language model. + +### Example Usage + +```python +from livepeer import Livepeer + + +with Livepeer( + api_key="", +) as l_client: + + res = l_client.generate.llm(request={ + "prompt": "", + }) + + assert res.llm_response is not None + + # Handle response + print(res.llm_response) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [components.BodyGenLLM](../../models/components/bodygenllm.md) | :heavy_check_mark: | The request object to use for the request. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[operations.GenLLMResponse](../../models/operations/genllmresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------- | -------------------------- | -------------------------- | +| errors.HTTPError | 400 | application/json | +| errors.StudioAPIError | 400 | application/json | +| errors.HTTPError | 401 | application/json | +| errors.StudioAPIError | 401 | application/json | +| errors.HTTPValidationError | 422 | application/json | +| errors.StudioAPIError | 422 | application/json | +| errors.HTTPError | 500 | application/json | +| errors.StudioAPIError | 500 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/livepeer/README.md b/docs/sdks/livepeer/README.md index 808685b..912df69 100644 --- a/docs/sdks/livepeer/README.md +++ b/docs/sdks/livepeer/README.md @@ -5,3 +5,6 @@ Livepeer API Reference: Welcome to the Livepeer API reference docs. Here you will find all the endpoints exposed on the standard Livepeer API, learn how to use them and what they return. + + +### Available Operations diff --git a/docs/sdks/metrics/README.md b/docs/sdks/metrics/README.md index 613fbe7..e437713 100644 --- a/docs/sdks/metrics/README.md +++ b/docs/sdks/metrics/README.md @@ -23,15 +23,17 @@ Requires a private (non-CORS) API key to be used. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.metrics.get_realtime_viewership() -res = s.metrics.get_realtime_viewership() + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -50,10 +52,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_viewership @@ -65,15 +66,17 @@ Requires a private (non-CORS) API key to be used. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.metrics.get_viewership(request={}) + res = l_client.metrics.get_viewership(request={}) -if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) ``` @@ -90,10 +93,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_creator_viewership @@ -105,15 +107,17 @@ Requires a proof of ownership to be sent in the request, which for now is just t ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.metrics.get_creator_viewership(request={}) + res = l_client.metrics.get_creator_viewership(request={}) -if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) ``` @@ -130,10 +134,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_public_viewership @@ -147,15 +150,17 @@ unauthenticated. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.metrics.get_public_viewership(playback_id="") -res = s.metrics.get_public_viewership(playback_id="") + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -172,10 +177,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_usage @@ -186,15 +190,17 @@ Query usage metrics ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.metrics.get_usage(request={}) -res = s.metrics.get_usage(request={}) + assert res.usage_metric is not None -if res.usage_metric is not None: - # handle response - pass + # Handle response + print(res.usage_metric) ``` @@ -211,6 +217,6 @@ if res.usage_metric is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/multistream/README.md b/docs/sdks/multistream/README.md index de9a910..63f1a24 100644 --- a/docs/sdks/multistream/README.md +++ b/docs/sdks/multistream/README.md @@ -22,15 +22,17 @@ Retrieve Multistream Targets ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.multistream.get_all() -res = s.multistream.get_all() + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -46,10 +48,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -60,17 +61,19 @@ Create a multistream target ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.multistream.create(request={ + "url": "rtmps://live.my-service.tv/channel/secretKey", + }) -res = s.multistream.create(request={ - "url": "rtmps://live.my-service.tv/channel/secretKey", -}) + assert res.multistream_target is not None -if res.multistream_target is not None: - # handle response - pass + # Handle response + print(res.multistream_target) ``` @@ -87,10 +90,9 @@ if res.multistream_target is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -101,15 +103,17 @@ Retrieve a multistream target ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.multistream.get(id="") + res = l_client.multistream.get(id="") -if res.multistream_target is not None: - # handle response - pass + assert res.multistream_target is not None + + # Handle response + print(res.multistream_target) ``` @@ -126,10 +130,9 @@ if res.multistream_target is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -140,27 +143,29 @@ Update Multistream Target ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.multistream.update(id="", multistream_target={ + "url": "rtmps://live.my-service.tv/channel/secretKey", + }) -res = s.multistream.update(id="", multistream_target_patch_payload={ - "url": "rtmps://live.my-service.tv/channel/secretKey", -}) + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `id` | *str* | :heavy_check_mark: | ID of the multistream target | -| `multistream_target_patch_payload` | [components.MultistreamTargetPatchPayload](../../models/components/multistreamtargetpatchpayload.md) | :heavy_check_mark: | N/A | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `id` | *str* | :heavy_check_mark: | ID of the multistream target | +| `multistream_target` | [components.MultistreamTargetInput](../../models/components/multistreamtargetinput.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response @@ -168,10 +173,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -184,15 +188,17 @@ streams before actually deleting it from the API. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.multistream.delete(id="") -res = s.multistream.delete(id="") + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -209,6 +215,6 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/playback/README.md b/docs/sdks/playback/README.md index c8394df..d780b32 100644 --- a/docs/sdks/playback/README.md +++ b/docs/sdks/playback/README.md @@ -18,15 +18,17 @@ Retrieve Playback Info ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.playback.get(id="") -res = s.playback.get(id="") + assert res.playback_info is not None -if res.playback_info is not None: - # handle response - pass + # Handle response + print(res.playback_info) ``` @@ -43,7 +45,7 @@ if res.playback_info is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ---------------- | ---------------- | ---------------- | | errors.Error | 404 | application/json | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/room/README.md b/docs/sdks/room/README.md index ce586f5..427e69e 100644 --- a/docs/sdks/room/README.md +++ b/docs/sdks/room/README.md @@ -29,15 +29,17 @@ Create a multiparticipant livestreaming room. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.room.create() -res = s.room.create() + assert res.create_room_response is not None -if res.create_room_response is not None: - # handle response - pass + # Handle response + print(res.create_room_response) ``` @@ -53,10 +55,9 @@ if res.create_room_response is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~get~~ @@ -69,15 +70,17 @@ Retrieve a room ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.room.get(id="") + res = l_client.room.get(id="") -if res.room is not None: - # handle response - pass + assert res.room is not None + + # Handle response + print(res.room) ``` @@ -94,10 +97,9 @@ if res.room is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~delete~~ @@ -110,15 +112,17 @@ Delete a room ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.room.delete(id="") + res = l_client.room.delete(id="") -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -135,10 +139,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~start_egress~~ @@ -153,17 +156,19 @@ This allows you to leverage livestreaming features like recording and HLS output ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.room.start_egress(id="", room_egress_payload={ - "stream_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", -}) + res = l_client.room.start_egress(id="", room_egress_payload={ + "stream_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", + }) -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -181,10 +186,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~stop_egress~~ @@ -197,15 +201,17 @@ Stop room RTMP egress ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.room.stop_egress(id="") + res = l_client.room.stop_egress(id="") -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -222,10 +228,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~create_user~~ @@ -241,19 +246,21 @@ Alternatively the joining token can be used with a custom app. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.room.create_user(id="", room_user_payload={ + "name": "name", + "can_publish": True, + "can_publish_data": True, + }) -res = s.room.create_user(id="", room_user_payload={ - "name": "name", - "can_publish": True, - "can_publish_data": True, -}) + assert res.room_user_response is not None -if res.room_user_response is not None: - # handle response - pass + # Handle response + print(res.room_user_response) ``` @@ -271,10 +278,9 @@ if res.room_user_response is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~get_user~~ @@ -287,15 +293,17 @@ Get user details ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.room.get_user(id="", user_id="") -res = s.room.get_user(id="", user_id="") + assert res.get_room_user_response is not None -if res.get_room_user_response is not None: - # handle response - pass + # Handle response + print(res.get_room_user_response) ``` @@ -313,10 +321,9 @@ if res.get_room_user_response is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~update_user~~ @@ -329,18 +336,17 @@ Update properties for a user. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.room.update_user(id="", user_id="", room_user_update_payload={}) -res = s.room.update_user(id="", user_id="", room_user_update_payload={ - "can_publish": True, - "can_publish_data": True, -}) + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -359,10 +365,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## ~~delete_user~~ @@ -375,15 +380,17 @@ Remove a user from the room ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.room.delete_user(id="", user_id="") -res = s.room.delete_user(id="", user_id="") + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -401,6 +408,6 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/session/README.md b/docs/sdks/session/README.md index f47a93f..bb4e3ae 100644 --- a/docs/sdks/session/README.md +++ b/docs/sdks/session/README.md @@ -21,15 +21,17 @@ Retrieve clips of a session ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.session.get_clips(id="") -res = s.session.get_clips(id="") + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -46,10 +48,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_all @@ -60,15 +61,17 @@ Retrieve sessions ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.session.get_all() -res = s.session.get_all() + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -84,10 +87,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -98,15 +100,17 @@ Retrieve a session ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.session.get(id="") -res = s.session.get(id="") + assert res.session is not None -if res.session is not None: - # handle response - pass + # Handle response + print(res.session) ``` @@ -123,10 +127,9 @@ if res.session is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_recorded @@ -137,15 +140,17 @@ Retrieve Recorded Sessions ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.session.get_recorded(parent_id="", record=True) -res = s.session.get_recorded(parent_id="", record=True) + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -163,6 +168,6 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/stream/README.md b/docs/sdks/stream/README.md index ef5e778..cae8bf3 100644 --- a/docs/sdks/stream/README.md +++ b/docs/sdks/stream/README.md @@ -42,78 +42,102 @@ also be added upon the creation of a new stream by adding from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.stream.create(request={ - "name": "test_stream", - "pull": { - "source": "https://myservice.com/live/stream.flv", - "headers": { - "Authorization": "Bearer 123", - }, - "location": { - "lat": 39.739, - "lon": -104.988, - }, - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", +) as l_client: + + res = l_client.stream.create(request={ + "name": "test_stream", + "pull": { + "source": "https://myservice.com/live/stream.flv", + "headers": { + "Authorization": "Bearer 123", + }, + "location": { + "lat": 39.739, + "lon": -104.988, + }, }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "record": False, - "recording_spec": { "profiles": [ { - "bitrate": 3000000, "width": 1280, "name": "720p", "height": 720, - "quality": 23, + "bitrate": 3000000, "fps": 30, "fps_den": 1, + "quality": 23, "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "profile": components.Profile.H264_BASELINE, }, - ], - }, - "multistream": { - "targets": [ { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", - }, + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, }, ], - }, -}) + "record": False, + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }, + ], + }, + }) -if res.stream is not None: - # handle response - pass + assert res.stream is not None + + # Handle response + print(res.stream) ``` @@ -130,10 +154,9 @@ if res.stream is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_all @@ -144,15 +167,17 @@ Retrieve streams ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.stream.get_all() + res = l_client.stream.get_all() -if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) ``` @@ -169,10 +194,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -183,15 +207,17 @@ Retrieve a stream ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.stream.get(id="") + res = l_client.stream.get(id="") -if res.stream is not None: - # handle response - pass + assert res.stream is not None + + # Handle response + print(res.stream) ``` @@ -208,10 +234,9 @@ if res.stream is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -223,67 +248,103 @@ Update a stream from livepeer import Livepeer from livepeer.models import components -s = Livepeer( - api_key="", -) -res = s.stream.update(id="", stream_patch_payload={ - "record": False, - "multistream": { - "targets": [ - { - "profile": "720p", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", +with Livepeer( + api_key="", +) as l_client: + + res = l_client.stream.update(id="", stream_patch_payload={ + "record": False, + "multistream": { + "targets": [ + { + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, }, - }, - ], - }, - "playback_policy": { - "type": components.Type.WEBHOOK, - "webhook_id": "1bde4o2i6xycudoy", - "webhook_context": { - "streamerId": "my-custom-id", + ], }, - "refresh_interval": 600, - }, - "profiles": [ - { - "width": 1280, - "name": "720p", - "height": 720, - "bitrate": 3000000, - "fps": 30, - "fps_den": 1, - "quality": 23, - "gop": "2", - "profile": components.Profile.H264_BASELINE, + "playback_policy": { + "type": components.Type.WEBHOOK, + "webhook_id": "1bde4o2i6xycudoy", + "webhook_context": { + "streamerId": "my-custom-id", + }, + "refresh_interval": 600, }, - ], - "recording_spec": { "profiles": [ { + "width": 1280, + "name": "720p", + "height": 720, "bitrate": 3000000, + "fps": 30, + "fps_den": 1, + "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, + }, + { "width": 1280, "name": "720p", "height": 720, + "bitrate": 3000000, + "fps": 30, + "fps_den": 1, "quality": 23, + "gop": "2", + "profile": components.Profile.H264_BASELINE, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, "fps": 30, "fps_den": 1, + "quality": 23, "gop": "2", - "profile": components.TranscodeProfileProfile.H264_BASELINE, - "encoder": components.TranscodeProfileEncoder.H_264, + "profile": components.Profile.H264_BASELINE, }, ], - }, -}) + "recording_spec": { + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }, + "name": "test_stream", + }) + + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -301,10 +362,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -319,15 +379,17 @@ using the PATCH stream API. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.stream.delete(id="") + res = l_client.stream.delete(id="") -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -344,10 +406,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## terminate @@ -366,15 +427,17 @@ terminated. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.stream.terminate(id="") + res = l_client.stream.terminate(id="") -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -391,10 +454,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## start_pull @@ -412,15 +474,17 @@ started. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.stream.start_pull(id="") + res = l_client.stream.start_pull(id="") -if res is not None: - # handle response - pass + assert res is not None + + # Handle response + print(res) ``` @@ -437,10 +501,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## create_clip @@ -451,21 +514,23 @@ Create a clip ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.stream.create_clip(request={ - "playback_id": "eaw4nk06ts2d0mzb", - "start_time": 1587667174725, - "end_time": 1587667174725, - "name": "My Clip", - "session_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", -}) + res = l_client.stream.create_clip(request={ + "playback_id": "eaw4nk06ts2d0mzb", + "start_time": 1587667174725, + "end_time": 1587667174725, + "name": "My Clip", + "session_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", + }) -if res.data is not None: - # handle response - pass + assert res.data is not None + + # Handle response + print(res.data) ``` @@ -482,10 +547,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_clips @@ -496,15 +560,17 @@ Retrieve clips of a livestream ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.stream.get_clips(id="") -res = s.stream.get_clips(id="") + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -521,10 +587,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## add_multistream_target @@ -535,23 +600,24 @@ Add a multistream target ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.stream.add_multistream_target(id="", target_add_payload={ - "profile": "720p0", - "video_only": False, - "id": "PUSH123", - "spec": { - "url": "rtmps://live.my-service.tv/channel/secretKey", - "name": "My target", - }, -}) - -if res is not None: - # handle response - pass +) as l_client: + + res = l_client.stream.add_multistream_target(id="", target_add_payload={ + "profile": "720p0", + "id": "PUSH123", + "spec": { + "name": "My target", + "url": "rtmps://live.my-service.tv/channel/secretKey", + }, + }) + + assert res is not None + + # Handle response + print(res) ``` @@ -569,10 +635,9 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## remove_multistream_target @@ -583,15 +648,17 @@ Remove a multistream target ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.stream.remove_multistream_target(id="", target_id="") -res = s.stream.remove_multistream_target(id="", target_id="") + assert res is not None -if res is not None: - # handle response - pass + # Handle response + print(res) ``` @@ -609,6 +676,6 @@ if res is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/task/README.md b/docs/sdks/task/README.md index f0e7056..8d26775 100644 --- a/docs/sdks/task/README.md +++ b/docs/sdks/task/README.md @@ -19,15 +19,17 @@ Retrieve Tasks ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.task.get_all() -res = s.task.get_all() + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -43,10 +45,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -57,15 +58,17 @@ Retrieve a Task ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.task.get(task_id="") -res = s.task.get(task_id="") + assert res.task is not None -if res.task is not None: - # handle response - pass + # Handle response + print(res.task) ``` @@ -82,6 +85,6 @@ if res.task is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/transcode/README.md b/docs/sdks/transcode/README.md index 0f9cd64..67a5510 100644 --- a/docs/sdks/transcode/README.md +++ b/docs/sdks/transcode/README.md @@ -140,53 +140,64 @@ This endpoint currently supports the following output types: from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.transcode.create(request={ - "input": { - "url": "https://s3.amazonaws.com/bucket/file.mp4", - }, - "storage": { - "type": components.StorageType.S3, - "endpoint": "https://gateway.storjshare.io", - "bucket": "outputbucket", - "credentials": { - "access_key_id": "AKIAIOSFODNN7EXAMPLE", - "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", - }, - }, - "outputs": { - "hls": { - "path": "/samplevideo/hls", + res = l_client.transcode.create(request={ + "input": { + "url": "https://s3.amazonaws.com/bucket/file.mp4", }, - "mp4": { - "path": "/samplevideo/mp4", + "storage": { + "type": components.TranscodePayloadStorageType.WEB3_STORAGE, + "credentials": { + "proof": "EaJlcm9vdHOAZ3ZlcnNpb24BmgIBcRIg2uxHpcPYSWNtifMKFkPC7IEDvFDCxCd3ADViv0coV7SnYXNYRO2hA0AnblHEW38s3lSlcwaDjPn", + }, }, - "fmp4": { - "path": "/samplevideo/fmp4", + "outputs": { + "hls": { + "path": "/samplevideo/hls", + }, + "mp4": { + "path": "/samplevideo/mp4", + }, + "fmp4": { + "path": "/samplevideo/fmp4", + }, }, - }, - "profiles": [ - { - "bitrate": 3000000, - "width": 1280, - "name": "720p", - "height": 720, - "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 + "profiles": [ + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + { + "width": 1280, + "name": "720p", + "height": 720, + "bitrate": 3000000, + "quality": 23, + "fps": 30, + "fps_den": 1, + "gop": "2", + "profile": components.TranscodeProfileProfile.H264_BASELINE, + "encoder": components.TranscodeProfileEncoder.H_264, + }, + ], + }) + + assert res.task is not None + + # Handle response + print(res.task) ``` @@ -203,6 +214,6 @@ if res.task is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/webhook/README.md b/docs/sdks/webhook/README.md index 957dcb9..1dbe738 100644 --- a/docs/sdks/webhook/README.md +++ b/docs/sdks/webhook/README.md @@ -25,15 +25,17 @@ Retrieve a Webhook ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.webhook.get_all() -res = s.webhook.get_all() + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -49,10 +51,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## create @@ -65,25 +66,27 @@ To create a new webhook, you need to make an API call with the events you want t from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.webhook.create(request={ - "name": "test_webhook", - "url": "https://my-service.com/webhook", - "project_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", - "events": [ - components.Events.STREAM_STARTED, - components.Events.STREAM_IDLE, - ], - "shared_secret": "my-secret", - "stream_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", -}) - -if res.webhook is not None: - # handle response - pass +) as l_client: + + res = l_client.webhook.create(request={ + "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", + }) + + assert res.webhook is not None + + # Handle response + print(res.webhook) ``` @@ -100,10 +103,9 @@ if res.webhook is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get @@ -114,15 +116,17 @@ Retrieve a webhook ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: -res = s.webhook.get(id="") + res = l_client.webhook.get(id="") -if res.webhook is not None: - # handle response - pass + assert res.webhook is not None + + # Handle response + print(res.webhook) ``` @@ -139,10 +143,9 @@ if res.webhook is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## update @@ -154,25 +157,27 @@ Update a webhook from livepeer import Livepeer from livepeer.models import components -s = Livepeer( + +with Livepeer( api_key="", -) - -res = s.webhook.update(id="", webhook={ - "name": "test_webhook", - "url": "https://my-service.com/webhook", - "project_id": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9", - "events": [ - components.Events.STREAM_STARTED, - components.Events.STREAM_IDLE, - ], - "shared_secret": "my-secret", - "stream_id": "de7818e7-610a-4057-8f6f-b785dc1e6f88", -}) - -if res.webhook is not None: - # handle response - pass +) as l_client: + + res = l_client.webhook.update(id="", webhook={ + "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", + }) + + assert res.webhook is not None + + # Handle response + print(res.webhook) ``` @@ -190,10 +195,9 @@ if res.webhook is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## delete @@ -204,15 +208,17 @@ Delete a webhook ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.webhook.delete(id="") -res = s.webhook.delete(id="") + assert res.webhook is not None -if res.webhook is not None: - # handle response - pass + # Handle response + print(res.webhook) ``` @@ -229,10 +235,9 @@ if res.webhook is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_logs @@ -243,15 +248,17 @@ Retrieve webhook logs ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.webhook.get_logs(id="") -res = s.webhook.get_logs(id="") + assert res.data is not None -if res.data is not None: - # handle response - pass + # Handle response + print(res.data) ``` @@ -268,10 +275,9 @@ if res.data is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## get_log @@ -282,15 +288,17 @@ Retrieve a webhook log ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.webhook.get_log(id="", log_id="") -res = s.webhook.get_log(id="", log_id="") + assert res.webhook_log is not None -if res.webhook_log is not None: - # handle response - pass + # Handle response + print(res.webhook_log) ``` @@ -308,10 +316,9 @@ if res.webhook_log is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | - +| errors.SDKError | 4XX, 5XX | \*/\* | ## resend_log @@ -325,15 +332,17 @@ to check or fix the behaviour in your handler. ```python from livepeer import Livepeer -s = Livepeer( + +with Livepeer( api_key="", -) +) as l_client: + + res = l_client.webhook.resend_log(id="", log_id="") -res = s.webhook.resend_log(id="", log_id="") + assert res.webhook_log is not None -if res.webhook_log is not None: - # handle response - pass + # Handle response + print(res.webhook_log) ``` @@ -351,6 +360,6 @@ if res.webhook_log is not None: ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | -| errors.SDKError | 4xx-5xx | */* | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 9b22df1..df65ce7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.1.2 and should not be changed by hand. [[package]] name = "annotated-types" @@ -6,20 +6,19 @@ version = "0.7.0" description = "Reusable constraint types to use with typing.Annotated" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.9\""} - [[package]] name = "anyio" version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, @@ -33,7 +32,7 @@ typing-extensions = {version = ">=4.1", markers = "python_version < \"3.11\""} [package.extras] doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] -test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] +test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17) ; platform_python_implementation == \"CPython\" and platform_system != \"Windows\""] trio = ["trio (>=0.23)"] [[package]] @@ -42,6 +41,7 @@ version = "3.2.4" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "astroid-3.2.4-py3-none-any.whl", hash = "sha256:413658a61eeca6202a59231abb473f932038fbcbf1666587f66d482083413a25"}, {file = "astroid-3.2.4.tar.gz", hash = "sha256:0e14202810b30da1b735827f78f5157be2bbd4a7a59b7707ca0bfc2fb4c0063a"}, @@ -56,6 +56,7 @@ version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, @@ -67,6 +68,8 @@ version = "0.4.6" description = "Cross-platform colored terminal text." optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\"" files = [ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, @@ -78,6 +81,7 @@ version = "0.3.8" description = "serialize all of Python" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, @@ -87,26 +91,14 @@ files = [ graph = ["objgraph (>=1.7.2)"] profile = ["gprof2dot (>=2022.7.29)"] -[[package]] -name = "eval-type-backport" -version = "0.2.0" -description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." -optional = false -python-versions = ">=3.8" -files = [ - {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, - {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, -] - -[package.extras] -tests = ["pytest"] - [[package]] name = "exceptiongroup" version = "1.2.2" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" +groups = ["main"] +markers = "python_version < \"3.11\"" files = [ {file = "exceptiongroup-1.2.2-py3-none-any.whl", hash = "sha256:3111b9d131c238bec2f8f516e123e14ba243563fb135d3fe885990585aa7795b"}, {file = "exceptiongroup-1.2.2.tar.gz", hash = "sha256:47c2edf7c6738fafb49fd34290706d1a1a2f4d1c6df275526b62cbb4aa5393cc"}, @@ -121,6 +113,7 @@ version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, @@ -132,6 +125,7 @@ version = "1.0.5" description = "A minimal low-level HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ {file = "httpcore-1.0.5-py3-none-any.whl", hash = "sha256:421f18bac248b25d310f3cacd198d55b8e6125c107797b609ff9b7a6ba7991b5"}, {file = "httpcore-1.0.5.tar.gz", hash = "sha256:34a38e2f9291467ee3b44e89dd52615370e152954ba21721378a87b2960f7a61"}, @@ -149,13 +143,14 @@ trio = ["trio (>=0.22.0,<0.26.0)"] [[package]] name = "httpx" -version = "0.27.2" +version = "0.28.1" description = "The next generation HTTP client." optional = false python-versions = ">=3.8" +groups = ["main"] files = [ - {file = "httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0"}, - {file = "httpx-0.27.2.tar.gz", hash = "sha256:f7c2be1d2f3c3c3160d441802406b206c2b76f5947b11115e6df10c6c65e66c2"}, + {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"}, + {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"}, ] [package.dependencies] @@ -163,10 +158,9 @@ anyio = "*" certifi = "*" httpcore = "==1.*" idna = "*" -sniffio = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -178,6 +172,7 @@ version = "3.10" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.6" +groups = ["main"] files = [ {file = "idna-3.10-py3-none-any.whl", hash = "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3"}, {file = "idna-3.10.tar.gz", hash = "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9"}, @@ -192,6 +187,7 @@ version = "5.13.2" description = "A Python utility / library to sort Python imports." optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6"}, {file = "isort-5.13.2.tar.gz", hash = "sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109"}, @@ -200,23 +196,13 @@ files = [ [package.extras] colors = ["colorama (>=0.4.6)"] -[[package]] -name = "jsonpath-python" -version = "1.0.6" -description = "A more powerful JSONPath implementation in modern python" -optional = false -python-versions = ">=3.6" -files = [ - {file = "jsonpath-python-1.0.6.tar.gz", hash = "sha256:dd5be4a72d8a2995c3f583cf82bf3cd1a9544cfdabf2d22595b67aff07349666"}, - {file = "jsonpath_python-1.0.6-py3-none-any.whl", hash = "sha256:1e3b78df579f5efc23565293612decee04214609208a2335884b3ee3f786b575"}, -] - [[package]] name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" optional = false python-versions = ">=3.6" +groups = ["dev"] files = [ {file = "mccabe-0.7.0-py2.py3-none-any.whl", hash = "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"}, {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, @@ -224,47 +210,54 @@ files = [ [[package]] name = "mypy" -version = "1.10.1" +version = "1.15.0" description = "Optional static typing for Python" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["dev"] files = [ - {file = "mypy-1.10.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e36f229acfe250dc660790840916eb49726c928e8ce10fbdf90715090fe4ae02"}, - {file = "mypy-1.10.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:51a46974340baaa4145363b9e051812a2446cf583dfaeba124af966fa44593f7"}, - {file = "mypy-1.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:901c89c2d67bba57aaaca91ccdb659aa3a312de67f23b9dfb059727cce2e2e0a"}, - {file = "mypy-1.10.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0cd62192a4a32b77ceb31272d9e74d23cd88c8060c34d1d3622db3267679a5d9"}, - {file = "mypy-1.10.1-cp310-cp310-win_amd64.whl", hash = "sha256:a2cbc68cb9e943ac0814c13e2452d2046c2f2b23ff0278e26599224cf164e78d"}, - {file = "mypy-1.10.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bd6f629b67bb43dc0d9211ee98b96d8dabc97b1ad38b9b25f5e4c4d7569a0c6a"}, - {file = "mypy-1.10.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a1bbb3a6f5ff319d2b9d40b4080d46cd639abe3516d5a62c070cf0114a457d84"}, - {file = "mypy-1.10.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8edd4e9bbbc9d7b79502eb9592cab808585516ae1bcc1446eb9122656c6066f"}, - {file = "mypy-1.10.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:6166a88b15f1759f94a46fa474c7b1b05d134b1b61fca627dd7335454cc9aa6b"}, - {file = "mypy-1.10.1-cp311-cp311-win_amd64.whl", hash = "sha256:5bb9cd11c01c8606a9d0b83ffa91d0b236a0e91bc4126d9ba9ce62906ada868e"}, - {file = "mypy-1.10.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d8681909f7b44d0b7b86e653ca152d6dff0eb5eb41694e163c6092124f8246d7"}, - {file = "mypy-1.10.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:378c03f53f10bbdd55ca94e46ec3ba255279706a6aacaecac52ad248f98205d3"}, - {file = "mypy-1.10.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6bacf8f3a3d7d849f40ca6caea5c055122efe70e81480c8328ad29c55c69e93e"}, - {file = "mypy-1.10.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:701b5f71413f1e9855566a34d6e9d12624e9e0a8818a5704d74d6b0402e66c04"}, - {file = "mypy-1.10.1-cp312-cp312-win_amd64.whl", hash = "sha256:3c4c2992f6ea46ff7fce0072642cfb62af7a2484efe69017ed8b095f7b39ef31"}, - {file = "mypy-1.10.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:604282c886497645ffb87b8f35a57ec773a4a2721161e709a4422c1636ddde5c"}, - {file = "mypy-1.10.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37fd87cab83f09842653f08de066ee68f1182b9b5282e4634cdb4b407266bade"}, - {file = "mypy-1.10.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8addf6313777dbb92e9564c5d32ec122bf2c6c39d683ea64de6a1fd98b90fe37"}, - {file = "mypy-1.10.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5cc3ca0a244eb9a5249c7c583ad9a7e881aa5d7b73c35652296ddcdb33b2b9c7"}, - {file = "mypy-1.10.1-cp38-cp38-win_amd64.whl", hash = "sha256:1b3a2ffce52cc4dbaeee4df762f20a2905aa171ef157b82192f2e2f368eec05d"}, - {file = "mypy-1.10.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:fe85ed6836165d52ae8b88f99527d3d1b2362e0cb90b005409b8bed90e9059b3"}, - {file = "mypy-1.10.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c2ae450d60d7d020d67ab440c6e3fae375809988119817214440033f26ddf7bf"}, - {file = "mypy-1.10.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6be84c06e6abd72f960ba9a71561c14137a583093ffcf9bbfaf5e613d63fa531"}, - {file = "mypy-1.10.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2189ff1e39db399f08205e22a797383613ce1cb0cb3b13d8bcf0170e45b96cc3"}, - {file = "mypy-1.10.1-cp39-cp39-win_amd64.whl", hash = "sha256:97a131ee36ac37ce9581f4220311247ab6cba896b4395b9c87af0675a13a755f"}, - {file = "mypy-1.10.1-py3-none-any.whl", hash = "sha256:71d8ac0b906354ebda8ef1673e5fde785936ac1f29ff6987c7483cfbd5a4235a"}, - {file = "mypy-1.10.1.tar.gz", hash = "sha256:1f8f492d7db9e3593ef42d4f115f04e556130f2819ad33ab84551403e97dd4c0"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:979e4e1a006511dacf628e36fadfecbcc0160a8af6ca7dad2f5025529e082c13"}, + {file = "mypy-1.15.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c4bb0e1bd29f7d34efcccd71cf733580191e9a264a2202b0239da95984c5b559"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:be68172e9fd9ad8fb876c6389f16d1c1b5f100ffa779f77b1fb2176fcc9ab95b"}, + {file = "mypy-1.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7be1e46525adfa0d97681432ee9fcd61a3964c2446795714699a998d193f1a3"}, + {file = "mypy-1.15.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:2e2c2e6d3593f6451b18588848e66260ff62ccca522dd231cd4dd59b0160668b"}, + {file = "mypy-1.15.0-cp310-cp310-win_amd64.whl", hash = "sha256:6983aae8b2f653e098edb77f893f7b6aca69f6cffb19b2cc7443f23cce5f4828"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2922d42e16d6de288022e5ca321cd0618b238cfc5570e0263e5ba0a77dbef56f"}, + {file = "mypy-1.15.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ee2d57e01a7c35de00f4634ba1bbf015185b219e4dc5909e281016df43f5ee5"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:973500e0774b85d9689715feeffcc980193086551110fd678ebe1f4342fb7c5e"}, + {file = "mypy-1.15.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5a95fb17c13e29d2d5195869262f8125dfdb5c134dc8d9a9d0aecf7525b10c2c"}, + {file = "mypy-1.15.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1905f494bfd7d85a23a88c5d97840888a7bd516545fc5aaedff0267e0bb54e2f"}, + {file = "mypy-1.15.0-cp311-cp311-win_amd64.whl", hash = "sha256:c9817fa23833ff189db061e6d2eff49b2f3b6ed9856b4a0a73046e41932d744f"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:aea39e0583d05124836ea645f412e88a5c7d0fd77a6d694b60d9b6b2d9f184fd"}, + {file = "mypy-1.15.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2f2147ab812b75e5b5499b01ade1f4a81489a147c01585cda36019102538615f"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ce436f4c6d218a070048ed6a44c0bbb10cd2cc5e272b29e7845f6a2f57ee4464"}, + {file = "mypy-1.15.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8023ff13985661b50a5928fc7a5ca15f3d1affb41e5f0a9952cb68ef090b31ee"}, + {file = "mypy-1.15.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e"}, + {file = "mypy-1.15.0-cp312-cp312-win_amd64.whl", hash = "sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:93faf3fdb04768d44bf28693293f3904bbb555d076b781ad2530214ee53e3445"}, + {file = "mypy-1.15.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:811aeccadfb730024c5d3e326b2fbe9249bb7413553f15499a4050f7c30e801d"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:98b7b9b9aedb65fe628c62a6dc57f6d5088ef2dfca37903a7d9ee374d03acca5"}, + {file = "mypy-1.15.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c43a7682e24b4f576d93072216bf56eeff70d9140241f9edec0c104d0c515036"}, + {file = "mypy-1.15.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:baefc32840a9f00babd83251560e0ae1573e2f9d1b067719479bfb0e987c6357"}, + {file = "mypy-1.15.0-cp313-cp313-win_amd64.whl", hash = "sha256:b9378e2c00146c44793c98b8d5a61039a048e31f429fb0eb546d93f4b000bedf"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078"}, + {file = "mypy-1.15.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:712e962a6357634fef20412699a3655c610110e01cdaa6180acec7fc9f8513ba"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5"}, + {file = "mypy-1.15.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8f8722560a14cde92fdb1e31597760dc35f9f5524cce17836c0d22841830fd5b"}, + {file = "mypy-1.15.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fbb8da62dc352133d7d7ca90ed2fb0e9d42bb1a32724c287d3c76c58cbaa9c2"}, + {file = "mypy-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980"}, + {file = "mypy-1.15.0-py3-none-any.whl", hash = "sha256:5469affef548bd1895d86d3bf10ce2b44e33d86923c29e4d675b3e323437ea3e"}, + {file = "mypy-1.15.0.tar.gz", hash = "sha256:404534629d51d3efea5c800ee7c42b72a6554d6c400e6a79eafe15d11341fd43"}, ] [package.dependencies] -mypy-extensions = ">=1.0.0" +mypy_extensions = ">=1.0.0" tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = ">=4.1.0" +typing_extensions = ">=4.6.0" [package.extras] dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] install-types = ["pip"] mypyc = ["setuptools (>=50)"] reports = ["lxml"] @@ -275,6 +268,7 @@ version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." optional = false python-versions = ">=3.5" +groups = ["dev"] files = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, @@ -286,6 +280,7 @@ version = "4.3.6" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, @@ -298,123 +293,133 @@ type = ["mypy (>=1.11.2)"] [[package]] name = "pydantic" -version = "2.9.2" +version = "2.11.3" description = "Data validation using Python type hints" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "pydantic-2.9.2-py3-none-any.whl", hash = "sha256:f048cec7b26778210e28a0459867920654d48e5e62db0958433636cde4254f12"}, - {file = "pydantic-2.9.2.tar.gz", hash = "sha256:d155cef71265d1e9807ed1c32b4c8deec042a44a50a4188b25ac67ecd81a9c0f"}, + {file = "pydantic-2.11.3-py3-none-any.whl", hash = "sha256:a082753436a07f9ba1289c6ffa01cd93db3548776088aa917cc43b63f68fa60f"}, + {file = "pydantic-2.11.3.tar.gz", hash = "sha256:7471657138c16adad9322fe3070c0116dd6c3ad8d649300e3cbdfe91f4db4ec3"}, ] [package.dependencies] annotated-types = ">=0.6.0" -pydantic-core = "2.23.4" -typing-extensions = [ - {version = ">=4.6.1", markers = "python_version < \"3.13\""}, - {version = ">=4.12.2", markers = "python_version >= \"3.13\""}, -] +pydantic-core = "2.33.1" +typing-extensions = ">=4.12.2" +typing-inspection = ">=0.4.0" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" -version = "2.23.4" +version = "2.33.1" description = "Core functionality for Pydantic validation and serialization" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "pydantic_core-2.23.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:b10bd51f823d891193d4717448fab065733958bdb6a6b351967bd349d48d5c9b"}, - {file = "pydantic_core-2.23.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:4fc714bdbfb534f94034efaa6eadd74e5b93c8fa6315565a222f7b6f42ca1166"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:63e46b3169866bd62849936de036f901a9356e36376079b05efa83caeaa02ceb"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ed1a53de42fbe34853ba90513cea21673481cd81ed1be739f7f2efb931b24916"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cfdd16ab5e59fc31b5e906d1a3f666571abc367598e3e02c83403acabc092e07"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:255a8ef062cbf6674450e668482456abac99a5583bbafb73f9ad469540a3a232"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a7cd62e831afe623fbb7aabbb4fe583212115b3ef38a9f6b71869ba644624a2"}, - {file = "pydantic_core-2.23.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f09e2ff1f17c2b51f2bc76d1cc33da96298f0a036a137f5440ab3ec5360b624f"}, - {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e38e63e6f3d1cec5a27e0afe90a085af8b6806ee208b33030e65b6516353f1a3"}, - {file = "pydantic_core-2.23.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0dbd8dbed2085ed23b5c04afa29d8fd2771674223135dc9bc937f3c09284d071"}, - {file = "pydantic_core-2.23.4-cp310-none-win32.whl", hash = "sha256:6531b7ca5f951d663c339002e91aaebda765ec7d61b7d1e3991051906ddde119"}, - {file = "pydantic_core-2.23.4-cp310-none-win_amd64.whl", hash = "sha256:7c9129eb40958b3d4500fa2467e6a83356b3b61bfff1b414c7361d9220f9ae8f"}, - {file = "pydantic_core-2.23.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:77733e3892bb0a7fa797826361ce8a9184d25c8dffaec60b7ffe928153680ba8"}, - {file = "pydantic_core-2.23.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b84d168f6c48fabd1f2027a3d1bdfe62f92cade1fb273a5d68e621da0e44e6d"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df49e7a0861a8c36d089c1ed57d308623d60416dab2647a4a17fe050ba85de0e"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff02b6d461a6de369f07ec15e465a88895f3223eb75073ffea56b84d9331f607"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:996a38a83508c54c78a5f41456b0103c30508fed9abcad0a59b876d7398f25fd"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d97683ddee4723ae8c95d1eddac7c192e8c552da0c73a925a89fa8649bf13eea"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:216f9b2d7713eb98cb83c80b9c794de1f6b7e3145eef40400c62e86cee5f4e1e"}, - {file = "pydantic_core-2.23.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6f783e0ec4803c787bcea93e13e9932edab72068f68ecffdf86a99fd5918878b"}, - {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d0776dea117cf5272382634bd2a5c1b6eb16767c223c6a5317cd3e2a757c61a0"}, - {file = "pydantic_core-2.23.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d5f7a395a8cf1621939692dba2a6b6a830efa6b3cee787d82c7de1ad2930de64"}, - {file = "pydantic_core-2.23.4-cp311-none-win32.whl", hash = "sha256:74b9127ffea03643e998e0c5ad9bd3811d3dac8c676e47db17b0ee7c3c3bf35f"}, - {file = "pydantic_core-2.23.4-cp311-none-win_amd64.whl", hash = "sha256:98d134c954828488b153d88ba1f34e14259284f256180ce659e8d83e9c05eaa3"}, - {file = "pydantic_core-2.23.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:f3e0da4ebaef65158d4dfd7d3678aad692f7666877df0002b8a522cdf088f231"}, - {file = "pydantic_core-2.23.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f69a8e0b033b747bb3e36a44e7732f0c99f7edd5cea723d45bc0d6e95377ffee"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:723314c1d51722ab28bfcd5240d858512ffd3116449c557a1336cbe3919beb87"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb2802e667b7051a1bebbfe93684841cc9351004e2badbd6411bf357ab8d5ac8"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d18ca8148bebe1b0a382a27a8ee60350091a6ddaf475fa05ef50dc35b5df6327"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33e3d65a85a2a4a0dc3b092b938a4062b1a05f3a9abde65ea93b233bca0e03f2"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:128585782e5bfa515c590ccee4b727fb76925dd04a98864182b22e89a4e6ed36"}, - {file = "pydantic_core-2.23.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:68665f4c17edcceecc112dfed5dbe6f92261fb9d6054b47d01bf6371a6196126"}, - {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:20152074317d9bed6b7a95ade3b7d6054845d70584216160860425f4fbd5ee9e"}, - {file = "pydantic_core-2.23.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:9261d3ce84fa1d38ed649c3638feefeae23d32ba9182963e465d58d62203bd24"}, - {file = "pydantic_core-2.23.4-cp312-none-win32.whl", hash = "sha256:4ba762ed58e8d68657fc1281e9bb72e1c3e79cc5d464be146e260c541ec12d84"}, - {file = "pydantic_core-2.23.4-cp312-none-win_amd64.whl", hash = "sha256:97df63000f4fea395b2824da80e169731088656d1818a11b95f3b173747b6cd9"}, - {file = "pydantic_core-2.23.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:7530e201d10d7d14abce4fb54cfe5b94a0aefc87da539d0346a484ead376c3cc"}, - {file = "pydantic_core-2.23.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:df933278128ea1cd77772673c73954e53a1c95a4fdf41eef97c2b779271bd0bd"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cb3da3fd1b6a5d0279a01877713dbda118a2a4fc6f0d821a57da2e464793f05"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:42c6dcb030aefb668a2b7009c85b27f90e51e6a3b4d5c9bc4c57631292015b0d"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:696dd8d674d6ce621ab9d45b205df149399e4bb9aa34102c970b721554828510"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2971bb5ffe72cc0f555c13e19b23c85b654dd2a8f7ab493c262071377bfce9f6"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8394d940e5d400d04cad4f75c0598665cbb81aecefaca82ca85bd28264af7f9b"}, - {file = "pydantic_core-2.23.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0dff76e0602ca7d4cdaacc1ac4c005e0ce0dcfe095d5b5259163a80d3a10d327"}, - {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:7d32706badfe136888bdea71c0def994644e09fff0bfe47441deaed8e96fdbc6"}, - {file = "pydantic_core-2.23.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ed541d70698978a20eb63d8c5d72f2cc6d7079d9d90f6b50bad07826f1320f5f"}, - {file = "pydantic_core-2.23.4-cp313-none-win32.whl", hash = "sha256:3d5639516376dce1940ea36edf408c554475369f5da2abd45d44621cb616f769"}, - {file = "pydantic_core-2.23.4-cp313-none-win_amd64.whl", hash = "sha256:5a1504ad17ba4210df3a045132a7baeeba5a200e930f57512ee02909fc5c4cb5"}, - {file = "pydantic_core-2.23.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:d4488a93b071c04dc20f5cecc3631fc78b9789dd72483ba15d423b5b3689b555"}, - {file = "pydantic_core-2.23.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:81965a16b675b35e1d09dd14df53f190f9129c0202356ed44ab2728b1c905658"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4ffa2ebd4c8530079140dd2d7f794a9d9a73cbb8e9d59ffe24c63436efa8f271"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:61817945f2fe7d166e75fbfb28004034b48e44878177fc54d81688e7b85a3665"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:29d2c342c4bc01b88402d60189f3df065fb0dda3654744d5a165a5288a657368"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5e11661ce0fd30a6790e8bcdf263b9ec5988e95e63cf901972107efc49218b13"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d18368b137c6295db49ce7218b1a9ba15c5bc254c96d7c9f9e924a9bc7825ad"}, - {file = "pydantic_core-2.23.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ec4e55f79b1c4ffb2eecd8a0cfba9955a2588497d96851f4c8f99aa4a1d39b12"}, - {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:374a5e5049eda9e0a44c696c7ade3ff355f06b1fe0bb945ea3cac2bc336478a2"}, - {file = "pydantic_core-2.23.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5c364564d17da23db1106787675fc7af45f2f7b58b4173bfdd105564e132e6fb"}, - {file = "pydantic_core-2.23.4-cp38-none-win32.whl", hash = "sha256:d7a80d21d613eec45e3d41eb22f8f94ddc758a6c4720842dc74c0581f54993d6"}, - {file = "pydantic_core-2.23.4-cp38-none-win_amd64.whl", hash = "sha256:5f5ff8d839f4566a474a969508fe1c5e59c31c80d9e140566f9a37bba7b8d556"}, - {file = "pydantic_core-2.23.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:a4fa4fc04dff799089689f4fd502ce7d59de529fc2f40a2c8836886c03e0175a"}, - {file = "pydantic_core-2.23.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0a7df63886be5e270da67e0966cf4afbae86069501d35c8c1b3b6c168f42cb36"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcedcd19a557e182628afa1d553c3895a9f825b936415d0dbd3cd0bbcfd29b4b"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f54b118ce5de9ac21c363d9b3caa6c800341e8c47a508787e5868c6b79c9323"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:86d2f57d3e1379a9525c5ab067b27dbb8a0642fb5d454e17a9ac434f9ce523e3"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:de6d1d1b9e5101508cb37ab0d972357cac5235f5c6533d1071964c47139257df"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1278e0d324f6908e872730c9102b0112477a7f7cf88b308e4fc36ce1bdb6d58c"}, - {file = "pydantic_core-2.23.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a6b5099eeec78827553827f4c6b8615978bb4b6a88e5d9b93eddf8bb6790f55"}, - {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:e55541f756f9b3ee346b840103f32779c695a19826a4c442b7954550a0972040"}, - {file = "pydantic_core-2.23.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a5c7ba8ffb6d6f8f2ab08743be203654bb1aaa8c9dcb09f82ddd34eadb695605"}, - {file = "pydantic_core-2.23.4-cp39-none-win32.whl", hash = "sha256:37b0fe330e4a58d3c58b24d91d1eb102aeec675a3db4c292ec3928ecd892a9a6"}, - {file = "pydantic_core-2.23.4-cp39-none-win_amd64.whl", hash = "sha256:1498bec4c05c9c787bde9125cfdcc63a41004ff167f495063191b863399b1a29"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f455ee30a9d61d3e1a15abd5068827773d6e4dc513e795f380cdd59932c782d5"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1e90d2e3bd2c3863d48525d297cd143fe541be8bbf6f579504b9712cb6b643ec"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e203fdf807ac7e12ab59ca2bfcabb38c7cf0b33c41efeb00f8e5da1d86af480"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e08277a400de01bc72436a0ccd02bdf596631411f592ad985dcee21445bd0068"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f220b0eea5965dec25480b6333c788fb72ce5f9129e8759ef876a1d805d00801"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:d06b0c8da4f16d1d1e352134427cb194a0a6e19ad5db9161bf32b2113409e728"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ba1a0996f6c2773bd83e63f18914c1de3c9dd26d55f4ac302a7efe93fb8e7433"}, - {file = "pydantic_core-2.23.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:9a5bce9d23aac8f0cf0836ecfc033896aa8443b501c58d0602dbfd5bd5b37753"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:78ddaaa81421a29574a682b3179d4cf9e6d405a09b99d93ddcf7e5239c742e21"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:883a91b5dd7d26492ff2f04f40fbb652de40fcc0afe07e8129e8ae779c2110eb"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88ad334a15b32a791ea935af224b9de1bf99bcd62fabf745d5f3442199d86d59"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:233710f069d251feb12a56da21e14cca67994eab08362207785cf8c598e74577"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:19442362866a753485ba5e4be408964644dd6a09123d9416c54cd49171f50744"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:624e278a7d29b6445e4e813af92af37820fafb6dcc55c012c834f9e26f9aaaef"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:f5ef8f42bec47f21d07668a043f077d507e5bf4e668d5c6dfe6aaba89de1a5b8"}, - {file = "pydantic_core-2.23.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:aea443fffa9fbe3af1a9ba721a87f926fe548d32cab71d188a6ede77d0ff244e"}, - {file = "pydantic_core-2.23.4.tar.gz", hash = "sha256:2584f7cf844ac4d970fba483a717dbe10c1c1c96a969bf65d61ffe94df1b2863"}, + {file = "pydantic_core-2.33.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:3077cfdb6125cc8dab61b155fdd714663e401f0e6883f9632118ec12cf42df26"}, + {file = "pydantic_core-2.33.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8ffab8b2908d152e74862d276cf5017c81a2f3719f14e8e3e8d6b83fda863927"}, + {file = "pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5183e4f6a2d468787243ebcd70cf4098c247e60d73fb7d68d5bc1e1beaa0c4db"}, + {file = "pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:398a38d323f37714023be1e0285765f0a27243a8b1506b7b7de87b647b517e48"}, + {file = "pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:87d3776f0001b43acebfa86f8c64019c043b55cc5a6a2e313d728b5c95b46969"}, + {file = "pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c566dd9c5f63d22226409553531f89de0cac55397f2ab8d97d6f06cfce6d947e"}, + {file = "pydantic_core-2.33.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0d5f3acc81452c56895e90643a625302bd6be351e7010664151cc55b7b97f89"}, + {file = "pydantic_core-2.33.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d3a07fadec2a13274a8d861d3d37c61e97a816beae717efccaa4b36dfcaadcde"}, + {file = "pydantic_core-2.33.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:f99aeda58dce827f76963ee87a0ebe75e648c72ff9ba1174a253f6744f518f65"}, + {file = "pydantic_core-2.33.1-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:902dbc832141aa0ec374f4310f1e4e7febeebc3256f00dc359a9ac3f264a45dc"}, + {file = "pydantic_core-2.33.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fe44d56aa0b00d66640aa84a3cbe80b7a3ccdc6f0b1ca71090696a6d4777c091"}, + {file = "pydantic_core-2.33.1-cp310-cp310-win32.whl", hash = "sha256:ed3eb16d51257c763539bde21e011092f127a2202692afaeaccb50db55a31383"}, + {file = "pydantic_core-2.33.1-cp310-cp310-win_amd64.whl", hash = "sha256:694ad99a7f6718c1a498dc170ca430687a39894a60327f548e02a9c7ee4b6504"}, + {file = "pydantic_core-2.33.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:6e966fc3caaf9f1d96b349b0341c70c8d6573bf1bac7261f7b0ba88f96c56c24"}, + {file = "pydantic_core-2.33.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bfd0adeee563d59c598ceabddf2c92eec77abcb3f4a391b19aa7366170bd9e30"}, + {file = "pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:91815221101ad3c6b507804178a7bb5cb7b2ead9ecd600041669c8d805ebd595"}, + {file = "pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9fea9c1869bb4742d174a57b4700c6dadea951df8b06de40c2fedb4f02931c2e"}, + {file = "pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d20eb4861329bb2484c021b9d9a977566ab16d84000a57e28061151c62b349a"}, + {file = "pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fb935c5591573ae3201640579f30128ccc10739b45663f93c06796854405505"}, + {file = "pydantic_core-2.33.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c964fd24e6166420d18fb53996d8c9fd6eac9bf5ae3ec3d03015be4414ce497f"}, + {file = "pydantic_core-2.33.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:681d65e9011f7392db5aa002b7423cc442d6a673c635668c227c6c8d0e5a4f77"}, + {file = "pydantic_core-2.33.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e100c52f7355a48413e2999bfb4e139d2977a904495441b374f3d4fb4a170961"}, + {file = "pydantic_core-2.33.1-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:048831bd363490be79acdd3232f74a0e9951b11b2b4cc058aeb72b22fdc3abe1"}, + {file = "pydantic_core-2.33.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:bdc84017d28459c00db6f918a7272a5190bec3090058334e43a76afb279eac7c"}, + {file = "pydantic_core-2.33.1-cp311-cp311-win32.whl", hash = "sha256:32cd11c5914d1179df70406427097c7dcde19fddf1418c787540f4b730289896"}, + {file = "pydantic_core-2.33.1-cp311-cp311-win_amd64.whl", hash = "sha256:2ea62419ba8c397e7da28a9170a16219d310d2cf4970dbc65c32faf20d828c83"}, + {file = "pydantic_core-2.33.1-cp311-cp311-win_arm64.whl", hash = "sha256:fc903512177361e868bc1f5b80ac8c8a6e05fcdd574a5fb5ffeac5a9982b9e89"}, + {file = "pydantic_core-2.33.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:1293d7febb995e9d3ec3ea09caf1a26214eec45b0f29f6074abb004723fc1de8"}, + {file = "pydantic_core-2.33.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:99b56acd433386c8f20be5c4000786d1e7ca0523c8eefc995d14d79c7a081498"}, + {file = "pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35a5ec3fa8c2fe6c53e1b2ccc2454398f95d5393ab398478f53e1afbbeb4d939"}, + {file = "pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b172f7b9d2f3abc0efd12e3386f7e48b576ef309544ac3a63e5e9cdd2e24585d"}, + {file = "pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9097b9f17f91eea659b9ec58148c0747ec354a42f7389b9d50701610d86f812e"}, + {file = "pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cc77ec5b7e2118b152b0d886c7514a4653bcb58c6b1d760134a9fab915f777b3"}, + {file = "pydantic_core-2.33.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d5e3d15245b08fa4a84cefc6c9222e6f37c98111c8679fbd94aa145f9a0ae23d"}, + {file = "pydantic_core-2.33.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ef99779001d7ac2e2461d8ab55d3373fe7315caefdbecd8ced75304ae5a6fc6b"}, + {file = "pydantic_core-2.33.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:fc6bf8869e193855e8d91d91f6bf59699a5cdfaa47a404e278e776dd7f168b39"}, + {file = "pydantic_core-2.33.1-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:b1caa0bc2741b043db7823843e1bde8aaa58a55a58fda06083b0569f8b45693a"}, + {file = "pydantic_core-2.33.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ec259f62538e8bf364903a7d0d0239447059f9434b284f5536e8402b7dd198db"}, + {file = "pydantic_core-2.33.1-cp312-cp312-win32.whl", hash = "sha256:e14f369c98a7c15772b9da98987f58e2b509a93235582838bd0d1d8c08b68fda"}, + {file = "pydantic_core-2.33.1-cp312-cp312-win_amd64.whl", hash = "sha256:1c607801d85e2e123357b3893f82c97a42856192997b95b4d8325deb1cd0c5f4"}, + {file = "pydantic_core-2.33.1-cp312-cp312-win_arm64.whl", hash = "sha256:8d13f0276806ee722e70a1c93da19748594f19ac4299c7e41237fc791d1861ea"}, + {file = "pydantic_core-2.33.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:70af6a21237b53d1fe7b9325b20e65cbf2f0a848cf77bed492b029139701e66a"}, + {file = "pydantic_core-2.33.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:282b3fe1bbbe5ae35224a0dbd05aed9ccabccd241e8e6b60370484234b456266"}, + {file = "pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b315e596282bbb5822d0c7ee9d255595bd7506d1cb20c2911a4da0b970187d3"}, + {file = "pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1dfae24cf9921875ca0ca6a8ecb4bb2f13c855794ed0d468d6abbec6e6dcd44a"}, + {file = "pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6dd8ecfde08d8bfadaea669e83c63939af76f4cf5538a72597016edfa3fad516"}, + {file = "pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2f593494876eae852dc98c43c6f260f45abdbfeec9e4324e31a481d948214764"}, + {file = "pydantic_core-2.33.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:948b73114f47fd7016088e5186d13faf5e1b2fe83f5e320e371f035557fd264d"}, + {file = "pydantic_core-2.33.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e11f3864eb516af21b01e25fac915a82e9ddad3bb0fb9e95a246067398b435a4"}, + {file = "pydantic_core-2.33.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:549150be302428b56fdad0c23c2741dcdb5572413776826c965619a25d9c6bde"}, + {file = "pydantic_core-2.33.1-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:495bc156026efafd9ef2d82372bd38afce78ddd82bf28ef5276c469e57c0c83e"}, + {file = "pydantic_core-2.33.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:ec79de2a8680b1a67a07490bddf9636d5c2fab609ba8c57597e855fa5fa4dacd"}, + {file = "pydantic_core-2.33.1-cp313-cp313-win32.whl", hash = "sha256:ee12a7be1742f81b8a65b36c6921022301d466b82d80315d215c4c691724986f"}, + {file = "pydantic_core-2.33.1-cp313-cp313-win_amd64.whl", hash = "sha256:ede9b407e39949d2afc46385ce6bd6e11588660c26f80576c11c958e6647bc40"}, + {file = "pydantic_core-2.33.1-cp313-cp313-win_arm64.whl", hash = "sha256:aa687a23d4b7871a00e03ca96a09cad0f28f443690d300500603bd0adba4b523"}, + {file = "pydantic_core-2.33.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:401d7b76e1000d0dd5538e6381d28febdcacb097c8d340dde7d7fc6e13e9f95d"}, + {file = "pydantic_core-2.33.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7aeb055a42d734c0255c9e489ac67e75397d59c6fbe60d155851e9782f276a9c"}, + {file = "pydantic_core-2.33.1-cp313-cp313t-win_amd64.whl", hash = "sha256:338ea9b73e6e109f15ab439e62cb3b78aa752c7fd9536794112e14bee02c8d18"}, + {file = "pydantic_core-2.33.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:5ab77f45d33d264de66e1884fca158bc920cb5e27fd0764a72f72f5756ae8bdb"}, + {file = "pydantic_core-2.33.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e7aaba1b4b03aaea7bb59e1b5856d734be011d3e6d98f5bcaa98cb30f375f2ad"}, + {file = "pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7fb66263e9ba8fea2aa85e1e5578980d127fb37d7f2e292773e7bc3a38fb0c7b"}, + {file = "pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3f2648b9262607a7fb41d782cc263b48032ff7a03a835581abbf7a3bec62bcf5"}, + {file = "pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:723c5630c4259400818b4ad096735a829074601805d07f8cafc366d95786d331"}, + {file = "pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d100e3ae783d2167782391e0c1c7a20a31f55f8015f3293647544df3f9c67824"}, + {file = "pydantic_core-2.33.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:177d50460bc976a0369920b6c744d927b0ecb8606fb56858ff542560251b19e5"}, + {file = "pydantic_core-2.33.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a3edde68d1a1f9af1273b2fe798997b33f90308fb6d44d8550c89fc6a3647cf6"}, + {file = "pydantic_core-2.33.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a62c3c3ef6a7e2c45f7853b10b5bc4ddefd6ee3cd31024754a1a5842da7d598d"}, + {file = "pydantic_core-2.33.1-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:c91dbb0ab683fa0cd64a6e81907c8ff41d6497c346890e26b23de7ee55353f96"}, + {file = "pydantic_core-2.33.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9f466e8bf0a62dc43e068c12166281c2eca72121dd2adc1040f3aa1e21ef8599"}, + {file = "pydantic_core-2.33.1-cp39-cp39-win32.whl", hash = "sha256:ab0277cedb698749caada82e5d099dc9fed3f906a30d4c382d1a21725777a1e5"}, + {file = "pydantic_core-2.33.1-cp39-cp39-win_amd64.whl", hash = "sha256:5773da0ee2d17136b1f1c6fbde543398d452a6ad2a7b54ea1033e2daa739b8d2"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5c834f54f8f4640fd7e4b193f80eb25a0602bba9e19b3cd2fc7ffe8199f5ae02"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:049e0de24cf23766f12cc5cc71d8abc07d4a9deb9061b334b62093dedc7cb068"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1a28239037b3d6f16916a4c831a5a0eadf856bdd6d2e92c10a0da3a59eadcf3e"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9d3da303ab5f378a268fa7d45f37d7d85c3ec19769f28d2cc0c61826a8de21fe"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:25626fb37b3c543818c14821afe0fd3830bc327a43953bc88db924b68c5723f1"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3ab2d36e20fbfcce8f02d73c33a8a7362980cff717926bbae030b93ae46b56c7"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2f9284e11c751b003fd4215ad92d325d92c9cb19ee6729ebd87e3250072cdcde"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:048c01eee07d37cbd066fc512b9d8b5ea88ceeb4e629ab94b3e56965ad655add"}, + {file = "pydantic_core-2.33.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:5ccd429694cf26af7997595d627dd2637e7932214486f55b8a357edaac9dae8c"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3a371dc00282c4b84246509a5ddc808e61b9864aa1eae9ecc92bb1268b82db4a"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:f59295ecc75a1788af8ba92f2e8c6eeaa5a94c22fc4d151e8d9638814f85c8fc"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08530b8ac922003033f399128505f513e30ca770527cc8bbacf75a84fcc2c74b"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bae370459da6a5466978c0eacf90690cb57ec9d533f8e63e564ef3822bfa04fe"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e3de2777e3b9f4d603112f78006f4ae0acb936e95f06da6cb1a45fbad6bdb4b5"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:3a64e81e8cba118e108d7126362ea30e021291b7805d47e4896e52c791be2761"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:52928d8c1b6bda03cc6d811e8923dffc87a2d3c8b3bfd2ce16471c7147a24850"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:1b30d92c9412beb5ac6b10a3eb7ef92ccb14e3f2a8d7732e2d739f58b3aa7544"}, + {file = "pydantic_core-2.33.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:f995719707e0e29f0f41a8aa3bcea6e761a36c9136104d3189eafb83f5cec5e5"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7edbc454a29fc6aeae1e1eecba4f07b63b8d76e76a748532233c4c167b4cb9ea"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:ad05b683963f69a1d5d2c2bdab1274a31221ca737dbbceaa32bcb67359453cdd"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df6a94bf9452c6da9b5d76ed229a5683d0306ccb91cca8e1eea883189780d568"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7965c13b3967909a09ecc91f21d09cfc4576bf78140b988904e94f130f188396"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3f1fdb790440a34f6ecf7679e1863b825cb5ffde858a9197f851168ed08371e5"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:5277aec8d879f8d05168fdd17ae811dd313b8ff894aeeaf7cd34ad28b4d77e33"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:8ab581d3530611897d863d1a649fb0644b860286b4718db919bfd51ece41f10b"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:0483847fa9ad5e3412265c1bd72aad35235512d9ce9d27d81a56d935ef489672"}, + {file = "pydantic_core-2.33.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:de9e06abe3cc5ec6a2d5f75bc99b0bdca4f5c719a5b34026f8c57efbdecd2ee3"}, + {file = "pydantic_core-2.33.1.tar.gz", hash = "sha256:bcc9c6fdb0ced789245b02b7d6603e17d1563064ddcfc36f046b61c0c05dd9df"}, ] [package.dependencies] @@ -426,6 +431,7 @@ version = "3.2.3" description = "python code static checker" optional = false python-versions = ">=3.8.0" +groups = ["dev"] files = [ {file = "pylint-3.2.3-py3-none-any.whl", hash = "sha256:b3d7d2708a3e04b4679e02d99e72329a8b7ee8afb8d04110682278781f889fa8"}, {file = "pylint-3.2.3.tar.gz", hash = "sha256:02f6c562b215582386068d52a30f520d84fdbcf2a95fc7e855b816060d048b60"}, @@ -437,7 +443,7 @@ colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, + {version = ">=0.3.6", markers = "python_version == \"3.11\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -450,37 +456,13 @@ typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\"" spelling = ["pyenchant (>=3.2,<4.0)"] testutils = ["gitpython (>3)"] -[[package]] -name = "python-dateutil" -version = "2.8.2" -description = "Extensions to the standard Python datetime module" -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" -files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, -] - -[package.dependencies] -six = ">=1.5" - -[[package]] -name = "six" -version = "1.16.0" -description = "Python 2 and 3 compatibility utilities" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -files = [ - {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, - {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, -] - [[package]] name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" optional = false python-versions = ">=3.7" +groups = ["main"] files = [ {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"}, {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"}, @@ -492,6 +474,8 @@ version = "2.0.1" description = "A lil' TOML parser" optional = false python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" files = [ {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, @@ -503,49 +487,40 @@ version = "0.13.2" description = "Style preserving TOML library" optional = false python-versions = ">=3.8" +groups = ["dev"] files = [ {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, ] -[[package]] -name = "types-python-dateutil" -version = "2.9.0.20240906" -description = "Typing stubs for python-dateutil" -optional = false -python-versions = ">=3.8" -files = [ - {file = "types-python-dateutil-2.9.0.20240906.tar.gz", hash = "sha256:9706c3b68284c25adffc47319ecc7947e5bb86b3773f843c73906fd598bc176e"}, - {file = "types_python_dateutil-2.9.0.20240906-py3-none-any.whl", hash = "sha256:27c8cc2d058ccb14946eebcaaa503088f4f6dbc4fb6093d3d456a49aef2753f6"}, -] - [[package]] name = "typing-extensions" version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" +groups = ["main", "dev"] files = [ {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] -name = "typing-inspect" -version = "0.9.0" -description = "Runtime inspection utilities for typing module." +name = "typing-inspection" +version = "0.4.0" +description = "Runtime typing introspection tools" optional = false -python-versions = "*" +python-versions = ">=3.9" +groups = ["main"] files = [ - {file = "typing_inspect-0.9.0-py3-none-any.whl", hash = "sha256:9ee6fc59062311ef8547596ab6b955e1b8aa46242d854bfc78f4f6b0eff35f9f"}, - {file = "typing_inspect-0.9.0.tar.gz", hash = "sha256:b23fc42ff6f6ef6954e4852c1fb512cdd18dbea03134f91f856a95ccc9461f78"}, + {file = "typing_inspection-0.4.0-py3-none-any.whl", hash = "sha256:50e72559fcd2a6367a19f7a7e610e6afcb9fac940c650290eed893d61386832f"}, + {file = "typing_inspection-0.4.0.tar.gz", hash = "sha256:9765c87de36671694a67904bf2c96e395be9c6439bb6c87b5142569dcdd65122"}, ] [package.dependencies] -mypy-extensions = ">=0.3.0" -typing-extensions = ">=3.7.4" +typing-extensions = ">=4.12.0" [metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "6bb5f77afb8fcbe7327ccd1fcc33f5c279c6a2582d43be73b69c2a94b836b85d" +lock-version = "2.1" +python-versions = ">=3.9" +content-hash = "6354f0f1856076ab30608ac13a9b2c92427e32d83253a3a3801e1919bb853282" diff --git a/pylintrc b/pylintrc index 711acc7..97d749d 100644 --- a/pylintrc +++ b/pylintrc @@ -89,7 +89,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.8 +py-version=3.9 # Discover python modules and packages in the file system subtree. recursive=no @@ -189,8 +189,8 @@ good-names=i, _, e, id, - to, - os + os, + to # Good variable names regexes, separated by a comma. If names match any regex, # they will always be accepted @@ -456,7 +456,11 @@ disable=raw-checker-failed, bare-except, broad-exception-caught, fixme, - relative-beyond-top-level + relative-beyond-top-level, + consider-using-with, + wildcard-import, + unused-wildcard-import, + too-many-return-statements # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -657,4 +661,4 @@ init-import=no # List of qualified module names which can have objects that can redefine # builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0c2e12b..55af195 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,16 @@ -[tool.poetry] +[project] name = "livepeer" -version = "0.3.0" +version = "0.4.0" description = "Python Client SDK for Livepeer Studio" -authors = ["Speakeasy",] +authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" +requires-python = ">=3.9" +dependencies = [ + "httpx >=0.28.1", + "pydantic >=2.11.2", +] + +[tool.poetry] repository = "https://github.com/livepeer/livepeer-python.git" packages = [ { include = "livepeer", from = "src" } @@ -16,25 +23,16 @@ include = ["py.typed", "src/livepeer/py.typed"] [virtualenvs] in-project = true -[tool.poetry.dependencies] -python = "^3.8" -eval-type-backport = "^0.2.0" -httpx = "^0.27.0" -jsonpath-python = "^1.0.6" -pydantic = "~2.9.0" -python-dateutil = "2.8.2" -typing-inspect = "^0.9.0" - [tool.poetry.group.dev.dependencies] -mypy = "==1.10.1" +mypy = "==1.15.0" pylint = "==3.2.3" -types-python-dateutil = "^2.9.0.20240316" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] +asyncio_default_fixture_loop_scope = "function" pythonpath = ["src"] [tool.mypy] diff --git a/scripts/compile.sh b/scripts/compile.sh deleted file mode 100755 index fafe635..0000000 --- a/scripts/compile.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash - -set -o pipefail # Ensure pipeline failures are propagated - -# Use temporary files to store outputs and exit statuses -declare -A output_files -declare -A status_files - -# Function to run a command with temporary output and status files -run_command() { - local cmd="$1" - local key="$2" - local output_file="$3" - local status_file="$4" - - # Run the command and store output and exit status - { - eval "$cmd" - echo $? > "$status_file" - } &> "$output_file" & -} - -poetry run python scripts/prepare-readme.py - -# Create temporary files for outputs and statuses -for cmd in compileall pylint mypy pyright; do - output_files[$cmd]=$(mktemp) - status_files[$cmd]=$(mktemp) -done - -# Collect PIDs for background processes -declare -a pids - -# Run commands in parallel using temporary files -echo "Running python -m compileall" -run_command 'poetry run python -m compileall -q . && echo "Success"' 'compileall' "${output_files[compileall]}" "${status_files[compileall]}" -pids+=($!) - -echo "Running pylint" -run_command 'poetry run pylint src' 'pylint' "${output_files[pylint]}" "${status_files[pylint]}" -pids+=($!) - -echo "Running mypy" -run_command 'poetry run mypy src' 'mypy' "${output_files[mypy]}" "${status_files[mypy]}" -pids+=($!) - -echo "Running pyright (optional)" -run_command 'if command -v pyright > /dev/null 2>&1; then pyright src; else echo "pyright not found, skipping"; fi' 'pyright' "${output_files[pyright]}" "${status_files[pyright]}" -pids+=($!) - -# Wait for all processes to complete -echo "Waiting for processes to complete" -for pid in "${pids[@]}"; do - wait "$pid" -done - -# Print output sequentially and check for failures -failed=false -for key in "${!output_files[@]}"; do - echo "--- Output from Command: $key ---" - echo - cat "${output_files[$key]}" - echo # Empty line for separation - echo "--- End of Output from Command: $key ---" - echo - - exit_status=$(cat "${status_files[$key]}") - if [ "$exit_status" -ne 0 ]; then - echo "Command $key failed with exit status $exit_status" >&2 - failed=true - fi -done - -# Clean up temporary files -for tmp_file in "${output_files[@]}" "${status_files[@]}"; do - rm -f "$tmp_file" -done - -if $failed; then - echo "One or more commands failed." >&2 - exit 1 -else - echo "All commands completed successfully." - exit 0 -fi diff --git a/scripts/prepare-readme.py b/scripts/prepare_readme.py similarity index 84% rename from scripts/prepare-readme.py rename to scripts/prepare_readme.py index 3a5b6f4..cfd1261 100644 --- a/scripts/prepare-readme.py +++ b/scripts/prepare_readme.py @@ -4,7 +4,7 @@ import shutil try: - with open("README.md", "r") as rh: + with open("README.md", "r", encoding="utf-8") as rh: readme_contents = rh.read() GITHUB_URL = "https://github.com/livepeer/livepeer-python.git" GITHUB_URL = ( @@ -21,13 +21,13 @@ readme_contents, ) - with open("README-PYPI.md", "w") as wh: + with open("README-PYPI.md", "w", encoding="utf-8") as wh: wh.write(readme_contents) except Exception as e: try: print("Failed to rewrite README.md to README-PYPI.md, copying original instead") print(e) shutil.copyfile("README.md", "README-PYPI.md") - except Exception as e: + except Exception as ie: print("Failed to copy README.md to README-PYPI.md") - print(e) + print(ie) diff --git a/scripts/publish.sh b/scripts/publish.sh index ab45b1f..f2f2cf2 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -2,6 +2,6 @@ export POETRY_PYPI_TOKEN_PYPI=${PYPI_TOKEN} -poetry run python scripts/prepare-readme.py +poetry run python scripts/prepare_readme.py poetry publish --build --skip-existing diff --git a/src/livepeer/__init__.py b/src/livepeer/__init__.py index d8d60c4..833c68c 100644 --- a/src/livepeer/__init__.py +++ b/src/livepeer/__init__.py @@ -1,4 +1,17 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" +from ._version import ( + __title__, + __version__, + __openapi_doc_version__, + __gen_version__, + __user_agent__, +) from .sdk import * from .sdkconfiguration import * + + +VERSION: str = __version__ +OPENAPI_DOC_VERSION = __openapi_doc_version__ +SPEAKEASY_GENERATOR_VERSION = __gen_version__ +USER_AGENT = __user_agent__ diff --git a/src/livepeer/_hooks/types.py b/src/livepeer/_hooks/types.py index ea7dc0f..70e312f 100644 --- a/src/livepeer/_hooks/types.py +++ b/src/livepeer/_hooks/types.py @@ -7,16 +7,19 @@ class HookContext: + base_url: str operation_id: str oauth2_scopes: Optional[List[str]] = None security_source: Optional[Union[Any, Callable[[], Any]]] = None def __init__( self, + base_url: str, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]], ): + self.base_url = base_url self.operation_id = operation_id self.oauth2_scopes = oauth2_scopes self.security_source = security_source @@ -25,21 +28,30 @@ def __init__( class BeforeRequestContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) class AfterSuccessContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) class AfterErrorContext(HookContext): def __init__(self, hook_ctx: HookContext): super().__init__( - hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source + hook_ctx.base_url, + hook_ctx.operation_id, + hook_ctx.oauth2_scopes, + hook_ctx.security_source, ) diff --git a/src/livepeer/_version.py b/src/livepeer/_version.py new file mode 100644 index 0000000..2a28747 --- /dev/null +++ b/src/livepeer/_version.py @@ -0,0 +1,15 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import importlib.metadata + +__title__: str = "livepeer" +__version__: str = "0.4.0" +__openapi_doc_version__: str = "1.0.0" +__gen_version__: str = "2.593.3" +__user_agent__: str = "speakeasy-sdk/python 0.4.0 2.593.3 1.0.0 livepeer" + +try: + if __package__ is not None: + __version__ = importlib.metadata.version(__package__) +except importlib.metadata.PackageNotFoundError: + pass diff --git a/src/livepeer/accesscontrol.py b/src/livepeer/accesscontrol.py index 1a1c360..d055edc 100644 --- a/src/livepeer/accesscontrol.py +++ b/src/livepeer/accesscontrol.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import OptionalNullable, UNSET -from typing import List, Optional, Union +from typing import List, Mapping, Optional, Union class AccessControl(BaseSDK): @@ -17,6 +17,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateSigningKeyResponse: r"""Create a signing key @@ -27,6 +28,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -35,7 +37,9 @@ def create( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="POST", path="/access-control/signing-key", base_url=base_url, @@ -46,6 +50,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -60,6 +65,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -76,21 +82,28 @@ def create( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -100,6 +113,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateSigningKeyResponse: r"""Create a signing key @@ -110,6 +124,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -118,7 +133,9 @@ async def create_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="POST", path="/access-control/signing-key", base_url=base_url, @@ -129,6 +146,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -143,6 +161,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -159,21 +178,28 @@ async def create_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -183,12 +209,14 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSigningKeysResponse: r"""Retrieves signing keys :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -197,7 +225,9 @@ def get_all( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="GET", path="/access-control/signing-key", base_url=base_url, @@ -208,6 +238,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -222,6 +253,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSigningKeys", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -238,21 +270,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSigningKeysResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -262,12 +301,14 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSigningKeysResponse: r"""Retrieves signing keys :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -276,7 +317,9 @@ async def get_all_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="GET", path="/access-control/signing-key", base_url=base_url, @@ -287,6 +330,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -301,6 +345,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSigningKeys", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -317,21 +362,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSigningKeysResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -342,6 +394,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteSigningKeyResponse: r"""Delete Signing Key @@ -349,6 +402,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -357,12 +411,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteSigningKeyRequest( key_id=key_id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/access-control/signing-key/{keyId}", base_url=base_url, @@ -373,6 +429,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -387,6 +444,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -400,21 +458,28 @@ def delete( return operations.DeleteSigningKeyResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -425,6 +490,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteSigningKeyResponse: r"""Delete Signing Key @@ -432,6 +498,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -440,12 +507,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteSigningKeyRequest( key_id=key_id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/access-control/signing-key/{keyId}", base_url=base_url, @@ -456,6 +525,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -470,6 +540,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -483,21 +554,28 @@ async def delete_async( return operations.DeleteSigningKeyResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -508,6 +586,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSigningKeyResponse: r"""Retrieves a signing key @@ -515,6 +594,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -523,12 +603,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetSigningKeyRequest( key_id=key_id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/access-control/signing-key/{keyId}", base_url=base_url, @@ -539,6 +621,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -553,6 +636,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -569,21 +653,28 @@ def get( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -594,6 +685,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSigningKeyResponse: r"""Retrieves a signing key @@ -601,6 +693,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -609,12 +702,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetSigningKeyRequest( key_id=key_id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/access-control/signing-key/{keyId}", base_url=base_url, @@ -625,6 +720,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -639,6 +735,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -655,21 +752,28 @@ async def get_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -684,6 +788,7 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateSigningKeyResponse: r"""Update a signing key @@ -692,6 +797,7 @@ def update( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -700,6 +806,8 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateSigningKeyRequest( key_id=key_id, @@ -708,7 +816,7 @@ def update( ), ) - req = self.build_request( + req = self._build_request( method="PATCH", path="/access-control/signing-key/{keyId}", base_url=base_url, @@ -719,6 +827,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -740,6 +849,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -753,21 +863,28 @@ def update( return operations.UpdateSigningKeyResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -782,6 +899,7 @@ async def update_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateSigningKeyResponse: r"""Update a signing key @@ -790,6 +908,7 @@ async def update_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -798,6 +917,8 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateSigningKeyRequest( key_id=key_id, @@ -806,7 +927,7 @@ async def update_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="PATCH", path="/access-control/signing-key/{keyId}", base_url=base_url, @@ -817,6 +938,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.request_body, @@ -838,6 +960,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateSigningKey", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -851,20 +974,27 @@ async def update_async( return operations.UpdateSigningKeyResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateSigningKeyResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/asset.py b/src/livepeer/asset.py index 540cbd0..0c9dd2e 100644 --- a/src/livepeer/asset.py +++ b/src/livepeer/asset.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import List, Optional, Union, cast +from typing import List, Mapping, Optional, Union, cast class Asset(BaseSDK): @@ -17,12 +17,14 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetAssetsResponse: r"""Retrieve assets :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -31,7 +33,9 @@ def get_all( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="GET", path="/asset", base_url=base_url, @@ -42,6 +46,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -56,6 +61,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getAssets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -72,21 +78,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetAssetsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -96,12 +109,14 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetAssetsResponse: r"""Retrieve assets :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -110,7 +125,9 @@ async def get_all_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="GET", path="/asset", base_url=base_url, @@ -121,6 +138,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -135,6 +153,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getAssets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -151,21 +170,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetAssetsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -176,6 +202,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.RequestUploadResponse: r"""Upload an asset @@ -256,6 +283,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -264,12 +292,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.NewAssetPayload) request = cast(components.NewAssetPayload, request) - req = self.build_request( + req = self._build_request( method="POST", path="/asset/request-upload", base_url=base_url, @@ -280,6 +310,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.NewAssetPayload @@ -297,6 +328,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="requestUpload", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -313,21 +345,28 @@ def create( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.RequestUploadResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -338,6 +377,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.RequestUploadResponse: r"""Upload an asset @@ -418,6 +458,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -426,12 +467,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.NewAssetPayload) request = cast(components.NewAssetPayload, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/asset/request-upload", base_url=base_url, @@ -442,6 +485,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.NewAssetPayload @@ -459,6 +503,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="requestUpload", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -475,21 +520,28 @@ async def create_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.RequestUploadResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -503,6 +555,7 @@ def create_via_url( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UploadAssetResponse: r"""Upload asset via URL @@ -510,6 +563,7 @@ def create_via_url( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -518,12 +572,14 @@ def create_via_url( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.NewAssetFromURLPayload) request = cast(components.NewAssetFromURLPayload, request) - req = self.build_request( + req = self._build_request( method="POST", path="/asset/upload/url", base_url=base_url, @@ -534,6 +590,7 @@ def create_via_url( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.NewAssetFromURLPayload @@ -551,6 +608,7 @@ def create_via_url( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="uploadAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -574,21 +632,28 @@ def create_via_url( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UploadAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -602,6 +667,7 @@ async def create_via_url_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UploadAssetResponse: r"""Upload asset via URL @@ -609,6 +675,7 @@ async def create_via_url_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -617,12 +684,14 @@ async def create_via_url_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.NewAssetFromURLPayload) request = cast(components.NewAssetFromURLPayload, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/asset/upload/url", base_url=base_url, @@ -633,6 +702,7 @@ async def create_via_url_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.NewAssetFromURLPayload @@ -650,6 +720,7 @@ async def create_via_url_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="uploadAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -673,21 +744,28 @@ async def create_via_url_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UploadAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -698,6 +776,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetAssetResponse: r"""Retrieves an asset @@ -705,6 +784,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -713,12 +793,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetAssetRequest( asset_id=asset_id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/asset/{assetId}", base_url=base_url, @@ -729,6 +811,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -743,6 +826,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -757,21 +841,28 @@ def get( asset=utils.unmarshal_json(http_res.text, Optional[components.Asset]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -782,6 +873,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetAssetResponse: r"""Retrieves an asset @@ -789,6 +881,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -797,12 +890,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetAssetRequest( asset_id=asset_id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/asset/{assetId}", base_url=base_url, @@ -813,6 +908,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -827,6 +923,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -841,21 +938,28 @@ async def get_async( asset=utils.unmarshal_json(http_res.text, Optional[components.Asset]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -869,6 +973,7 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateAssetResponse: r"""Patch an asset @@ -877,6 +982,7 @@ def update( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -885,6 +991,8 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateAssetRequest( asset_id=asset_id, @@ -893,7 +1001,7 @@ def update( ), ) - req = self.build_request( + req = self._build_request( method="PATCH", path="/asset/{assetId}", base_url=base_url, @@ -904,6 +1012,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.asset_patch_payload, @@ -925,6 +1034,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -939,21 +1049,28 @@ def update( asset=utils.unmarshal_json(http_res.text, Optional[components.Asset]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -967,6 +1084,7 @@ async def update_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateAssetResponse: r"""Patch an asset @@ -975,6 +1093,7 @@ async def update_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -983,6 +1102,8 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateAssetRequest( asset_id=asset_id, @@ -991,7 +1112,7 @@ async def update_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="PATCH", path="/asset/{assetId}", base_url=base_url, @@ -1002,6 +1123,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.asset_patch_payload, @@ -1023,6 +1145,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1037,21 +1160,28 @@ async def update_async( asset=utils.unmarshal_json(http_res.text, Optional[components.Asset]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1062,6 +1192,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteAssetResponse: r"""Delete an asset @@ -1069,6 +1200,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1077,12 +1209,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteAssetRequest( asset_id=asset_id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/asset/{assetId}", base_url=base_url, @@ -1093,6 +1227,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1107,6 +1242,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1120,21 +1256,28 @@ def delete( return operations.DeleteAssetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1145,6 +1288,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteAssetResponse: r"""Delete an asset @@ -1152,6 +1296,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1160,12 +1305,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteAssetRequest( asset_id=asset_id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/asset/{assetId}", base_url=base_url, @@ -1176,6 +1323,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1190,6 +1338,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteAsset", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1203,20 +1352,27 @@ async def delete_async( return operations.DeleteAssetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteAssetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/basesdk.py b/src/livepeer/basesdk.py index b5cc177..836ee00 100644 --- a/src/livepeer/basesdk.py +++ b/src/livepeer/basesdk.py @@ -6,7 +6,8 @@ from livepeer._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext from livepeer.models import errors from livepeer.utils import RetryConfig, SerializedRequestBody, get_body_content -from typing import Callable, List, Optional, Tuple +from typing import Callable, List, Mapping, Optional, Tuple +from urllib.parse import parse_qs, urlparse class BaseSDK: @@ -15,7 +16,7 @@ class BaseSDK: def __init__(self, sdk_config: SDKConfiguration) -> None: self.sdk_configuration = sdk_config - def get_url(self, base_url, url_variables): + def _get_url(self, base_url, url_variables): sdk_url, sdk_variables = self.sdk_configuration.get_server_details() if base_url is None: @@ -26,7 +27,7 @@ def get_url(self, base_url, url_variables): return utils.template_url(base_url, url_variables) - def build_request_async( + def _build_request_async( self, method, path, @@ -45,9 +46,10 @@ def build_request_async( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: client = self.sdk_configuration.async_client - return self.build_request_with_client( + return self._build_request_with_client( client, method, path, @@ -64,9 +66,10 @@ def build_request_async( timeout_ms, get_serialized_body, url_override, + http_headers, ) - def build_request( + def _build_request( self, method, path, @@ -85,9 +88,10 @@ def build_request( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: client = self.sdk_configuration.client - return self.build_request_with_client( + return self._build_request_with_client( client, method, path, @@ -104,9 +108,10 @@ def build_request( timeout_ms, get_serialized_body, url_override, + http_headers, ) - def build_request_with_client( + def _build_request_with_client( self, client, method, @@ -126,13 +131,14 @@ def build_request_with_client( Callable[[], Optional[SerializedRequestBody]] ] = None, url_override: Optional[str] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> httpx.Request: query_params = {} url = url_override if url is None: url = utils.generate_url( - self.get_url(base_url, url_variables), + self._get_url(base_url, url_variables), path, request if request_has_path_params else None, _globals if request_has_path_params else None, @@ -142,6 +148,12 @@ def build_request_with_client( request if request_has_query_params else None, _globals if request_has_query_params else None, ) + else: + # Pick up the query parameter from the override so they can be + # preserved when building the request later on (necessary as of + # httpx 0.28). + parsed_override = urlparse(str(url_override)) + query_params = parse_qs(parsed_override.query, keep_blank_values=True) headers = utils.get_headers(request, _globals) headers["Accept"] = accept_header_value @@ -156,7 +168,7 @@ def build_request_with_client( headers = {**headers, **security_headers} query_params = {**query_params, **security_query_params} - serialized_request_body = SerializedRequestBody("application/octet-stream") + serialized_request_body = SerializedRequestBody() if get_serialized_body is not None: rb = get_serialized_body() if request_body_required and rb is None: @@ -175,6 +187,10 @@ def build_request_with_client( ): headers["content-type"] = serialized_request_body.media_type + if http_headers is not None: + for header, value in http_headers.items(): + headers[header] = value + timeout = timeout_ms / 1000 if timeout_ms is not None else None return client.build_request( @@ -212,6 +228,10 @@ def do(): req.headers, get_body_content(req), ) + + if client is None: + raise ValueError("client is required") + http_res = client.send(req, stream=stream) except Exception as e: _, e = self.sdk_configuration.get_hooks().after_error( @@ -284,6 +304,10 @@ async def do(): req.headers, get_body_content(req), ) + + if client is None: + raise ValueError("client is required") + http_res = await client.send(req, stream=stream) except Exception as e: _, e = self.sdk_configuration.get_hooks().after_error( diff --git a/src/livepeer/generate.py b/src/livepeer/generate.py index 425b7fa..15e4728 100644 --- a/src/livepeer/generate.py +++ b/src/livepeer/generate.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import Any, Optional, Union, cast +from typing import Any, Mapping, Optional, Union, cast class Generate(BaseSDK): @@ -20,6 +20,7 @@ def text_to_image( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenTextToImageResponse: r"""Text To Image @@ -29,6 +30,7 @@ def text_to_image( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -37,14 +39,16 @@ def text_to_image( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.TextToImageParams) request = cast(components.TextToImageParams, request) - req = self.build_request( + req = self._build_request( method="POST", - path="/api/beta/generate/text-to-image", + path="/api/generate/text-to-image", base_url=base_url, url_variables=url_variables, request=request, @@ -53,6 +57,7 @@ def text_to_image( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.TextToImageParams @@ -70,6 +75,7 @@ def text_to_image( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genTextToImage", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -79,7 +85,7 @@ def text_to_image( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenTextToImageResponse( image_response=utils.unmarshal_json( @@ -88,46 +94,63 @@ def text_to_image( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageGenerateResponse500ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenTextToImageResponse( studio_api_error=utils.unmarshal_json( - http_res.text, Optional[errors.StudioAPIError] + http_res.text, Optional[components.StudioAPIError] ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -140,6 +163,7 @@ async def text_to_image_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenTextToImageResponse: r"""Text To Image @@ -149,6 +173,7 @@ async def text_to_image_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -157,14 +182,16 @@ async def text_to_image_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.TextToImageParams) request = cast(components.TextToImageParams, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", - path="/api/beta/generate/text-to-image", + path="/api/generate/text-to-image", base_url=base_url, url_variables=url_variables, request=request, @@ -173,6 +200,7 @@ async def text_to_image_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.TextToImageParams @@ -190,6 +218,7 @@ async def text_to_image_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genTextToImage", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -199,7 +228,7 @@ async def text_to_image_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenTextToImageResponse( image_response=utils.unmarshal_json( @@ -208,46 +237,63 @@ async def text_to_image_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenTextToImageGenerateResponse500ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenTextToImageGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenTextToImageGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenTextToImageResponse( studio_api_error=utils.unmarshal_json( - http_res.text, Optional[errors.StudioAPIError] + http_res.text, Optional[components.StudioAPIError] ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -260,6 +306,7 @@ def image_to_image( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenImageToImageResponse: r"""Image To Image @@ -269,6 +316,7 @@ def image_to_image( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -277,14 +325,16 @@ def image_to_image( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenImageToImage) request = cast(components.BodyGenImageToImage, request) - req = self.build_request( + req = self._build_request( method="POST", - path="/api/beta/generate/image-to-image", + path="/api/generate/image-to-image", base_url=base_url, url_variables=url_variables, request=request, @@ -293,6 +343,7 @@ def image_to_image( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenImageToImage @@ -310,6 +361,7 @@ def image_to_image( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genImageToImage", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -319,7 +371,7 @@ def image_to_image( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenImageToImageResponse( image_response=utils.unmarshal_json( @@ -328,33 +380,49 @@ def image_to_image( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageGenerateResponse500ResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenImageToImageResponse( @@ -365,10 +433,11 @@ def image_to_image( ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -381,6 +450,7 @@ async def image_to_image_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenImageToImageResponse: r"""Image To Image @@ -390,6 +460,7 @@ async def image_to_image_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -398,14 +469,16 @@ async def image_to_image_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenImageToImage) request = cast(components.BodyGenImageToImage, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", - path="/api/beta/generate/image-to-image", + path="/api/generate/image-to-image", base_url=base_url, url_variables=url_variables, request=request, @@ -414,6 +487,7 @@ async def image_to_image_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenImageToImage @@ -431,6 +505,7 @@ async def image_to_image_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genImageToImage", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -440,7 +515,7 @@ async def image_to_image_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenImageToImageResponse( image_response=utils.unmarshal_json( @@ -449,33 +524,49 @@ async def image_to_image_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToImageGenerateResponse500ResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToImageGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToImageGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenImageToImageResponse( @@ -486,10 +577,11 @@ async def image_to_image_async( ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -502,6 +594,7 @@ def image_to_video( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenImageToVideoResponse: r"""Image To Video @@ -511,6 +604,7 @@ def image_to_video( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -519,14 +613,16 @@ def image_to_video( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenImageToVideo) request = cast(components.BodyGenImageToVideo, request) - req = self.build_request( + req = self._build_request( method="POST", - path="/api/beta/generate/image-to-video", + path="/api/generate/image-to-video", base_url=base_url, url_variables=url_variables, request=request, @@ -535,6 +631,7 @@ def image_to_video( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenImageToVideo @@ -552,6 +649,7 @@ def image_to_video( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genImageToVideo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -561,7 +659,7 @@ def image_to_video( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenImageToVideoResponse( video_response=utils.unmarshal_json( @@ -570,33 +668,49 @@ def image_to_video( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoGenerateResponse500ResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenImageToVideoResponse( @@ -607,10 +721,11 @@ def image_to_video( ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -623,6 +738,7 @@ async def image_to_video_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenImageToVideoResponse: r"""Image To Video @@ -632,6 +748,7 @@ async def image_to_video_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -640,14 +757,16 @@ async def image_to_video_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenImageToVideo) request = cast(components.BodyGenImageToVideo, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", - path="/api/beta/generate/image-to-video", + path="/api/generate/image-to-video", base_url=base_url, url_variables=url_variables, request=request, @@ -656,6 +775,7 @@ async def image_to_video_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenImageToVideo @@ -673,6 +793,7 @@ async def image_to_video_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genImageToVideo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -682,7 +803,7 @@ async def image_to_video_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenImageToVideoResponse( video_response=utils.unmarshal_json( @@ -691,33 +812,49 @@ async def image_to_video_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenImageToVideoGenerateResponse500ResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenImageToVideoGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenImageToVideoGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenImageToVideoResponse( @@ -728,10 +865,11 @@ async def image_to_video_async( ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -742,6 +880,7 @@ def upscale( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenUpscaleResponse: r"""Upscale @@ -751,6 +890,7 @@ def upscale( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -759,14 +899,16 @@ def upscale( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenUpscale) request = cast(components.BodyGenUpscale, request) - req = self.build_request( + req = self._build_request( method="POST", - path="/api/beta/generate/upscale", + path="/api/generate/upscale", base_url=base_url, url_variables=url_variables, request=request, @@ -775,6 +917,7 @@ def upscale( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenUpscale @@ -792,6 +935,7 @@ def upscale( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genUpscale", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -801,7 +945,7 @@ def upscale( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenUpscaleResponse( image_response=utils.unmarshal_json( @@ -810,32 +954,46 @@ def upscale( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleGenerateResponse500ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleGenerateResponse500ResponseBody(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenUpscaleResponse( @@ -846,10 +1004,11 @@ def upscale( ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -860,6 +1019,7 @@ async def upscale_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenUpscaleResponse: r"""Upscale @@ -869,6 +1029,7 @@ async def upscale_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -877,14 +1038,16 @@ async def upscale_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenUpscale) request = cast(components.BodyGenUpscale, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", - path="/api/beta/generate/upscale", + path="/api/generate/upscale", base_url=base_url, url_variables=url_variables, request=request, @@ -893,6 +1056,7 @@ async def upscale_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenUpscale @@ -910,6 +1074,7 @@ async def upscale_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genUpscale", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -919,7 +1084,7 @@ async def upscale_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenUpscaleResponse( image_response=utils.unmarshal_json( @@ -928,32 +1093,46 @@ async def upscale_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleGenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleGenerateResponseResponseBody(data=response_data) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenUpscaleGenerateResponse500ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenUpscaleGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenUpscaleGenerateResponse500ResponseBody(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenUpscaleResponse( @@ -964,10 +1143,11 @@ async def upscale_async( ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -980,6 +1160,7 @@ def audio_to_text( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenAudioToTextResponse: r"""Audio To Text @@ -989,6 +1170,7 @@ def audio_to_text( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -997,14 +1179,16 @@ def audio_to_text( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenAudioToText) request = cast(components.BodyGenAudioToText, request) - req = self.build_request( + req = self._build_request( method="POST", - path="/api/beta/generate/audio-to-text", + path="/api/generate/audio-to-text", base_url=base_url, url_variables=url_variables, request=request, @@ -1013,6 +1197,7 @@ def audio_to_text( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenAudioToText @@ -1030,16 +1215,17 @@ def audio_to_text( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genAudioToText", oauth2_scopes=[], security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "401", "413", "422", "4XX", "500", "5XX"], + error_status_codes=["400", "401", "413", "415", "422", "4XX", "500", "5XX"], retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenAudioToTextResponse( text_response=utils.unmarshal_json( @@ -1048,38 +1234,68 @@ def audio_to_text( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponseBody(data=response_data) if utils.match_response(http_res, "413", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponseResponseBody(data=response_data) + if utils.match_response(http_res, "415", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenAudioToTextGenerateResponse415ResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponse415ResponseBody( + data=response_data + ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponse422ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponse422ResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponse422ResponseBody( + data=response_data + ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponse500ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenAudioToTextResponse( @@ -1090,10 +1306,11 @@ def audio_to_text( ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1106,6 +1323,7 @@ async def audio_to_text_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenAudioToTextResponse: r"""Audio To Text @@ -1115,6 +1333,7 @@ async def audio_to_text_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1123,14 +1342,16 @@ async def audio_to_text_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenAudioToText) request = cast(components.BodyGenAudioToText, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", - path="/api/beta/generate/audio-to-text", + path="/api/generate/audio-to-text", base_url=base_url, url_variables=url_variables, request=request, @@ -1139,6 +1360,7 @@ async def audio_to_text_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenAudioToText @@ -1156,16 +1378,17 @@ async def audio_to_text_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genAudioToText", oauth2_scopes=[], security_source=self.sdk_configuration.security, ), request=req, - error_status_codes=["400", "401", "413", "422", "4XX", "500", "5XX"], + error_status_codes=["400", "401", "413", "415", "422", "4XX", "500", "5XX"], retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenAudioToTextResponse( text_response=utils.unmarshal_json( @@ -1174,38 +1397,68 @@ async def audio_to_text_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponseBody(data=response_data) if utils.match_response(http_res, "413", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponseResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponseResponseBody(data=response_data) + if utils.match_response(http_res, "415", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenAudioToTextGenerateResponse415ResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponse415ResponseBody( + data=response_data + ) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponse422ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponse422ResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponse422ResponseBody( + data=response_data + ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenAudioToTextGenerateResponse500ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenAudioToTextGenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenAudioToTextGenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenAudioToTextResponse( @@ -1216,10 +1469,11 @@ async def audio_to_text_async( ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1233,6 +1487,7 @@ def segment_anything2( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenSegmentAnything2Response: r"""Segment Anything 2 @@ -1242,6 +1497,7 @@ def segment_anything2( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1250,14 +1506,16 @@ def segment_anything2( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenSegmentAnything2) request = cast(components.BodyGenSegmentAnything2, request) - req = self.build_request( + req = self._build_request( method="POST", - path="/api/beta/generate/segment-anything-2", + path="/api/generate/segment-anything-2", base_url=base_url, url_variables=url_variables, request=request, @@ -1266,6 +1524,7 @@ def segment_anything2( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenSegmentAnything2 @@ -1283,6 +1542,7 @@ def segment_anything2( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genSegmentAnything2", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1292,7 +1552,7 @@ def segment_anything2( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenSegmentAnything2Response( masks_response=utils.unmarshal_json( @@ -1301,34 +1561,52 @@ def segment_anything2( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2ResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2ResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2GenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2GenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2GenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2GenerateResponseResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2GenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2GenerateResponseResponseBody( + data=response_data + ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2GenerateResponse500ResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2GenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2GenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenSegmentAnything2Response( @@ -1339,10 +1617,11 @@ def segment_anything2( ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1356,6 +1635,7 @@ async def segment_anything2_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GenSegmentAnything2Response: r"""Segment Anything 2 @@ -1365,6 +1645,7 @@ async def segment_anything2_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1373,14 +1654,16 @@ async def segment_anything2_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.BodyGenSegmentAnything2) request = cast(components.BodyGenSegmentAnything2, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", - path="/api/beta/generate/segment-anything-2", + path="/api/generate/segment-anything-2", base_url=base_url, url_variables=url_variables, request=request, @@ -1389,6 +1672,7 @@ async def segment_anything2_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "multipart", components.BodyGenSegmentAnything2 @@ -1406,6 +1690,7 @@ async def segment_anything2_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="genSegmentAnything2", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1415,7 +1700,7 @@ async def segment_anything2_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GenSegmentAnything2Response( masks_response=utils.unmarshal_json( @@ -1424,34 +1709,52 @@ async def segment_anything2_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "400", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2ResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2ResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2ResponseBody(data=response_data) if utils.match_response(http_res, "401", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2GenerateResponseBodyUnion ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2GenerateResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2GenerateResponseBody(data=response_data) if utils.match_response(http_res, "422", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2GenerateResponseResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2GenerateResponseResponseBody(data=data) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2GenerateResponseResponseBody( + data=response_data + ) if utils.match_response(http_res, "500", "application/json"): - data = utils.unmarshal_json( + response_data = utils.unmarshal_json( http_res.text, errors.GenSegmentAnything2GenerateResponse500ResponseBodyUnion, ) - data.http_meta = components.HTTPMetadata(request=req, response=http_res) - raise errors.GenSegmentAnything2GenerateResponse500ResponseBody(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenSegmentAnything2GenerateResponse500ResponseBody( + data=response_data + ) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GenSegmentAnything2Response( @@ -1462,9 +1765,288 @@ async def segment_anything2_async( ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def llm( + self, + *, + request: Union[components.BodyGenLLM, components.BodyGenLLMTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GenLLMResponse: + r"""LLM + + Generate text using a language model. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, components.BodyGenLLM) + request = cast(components.BodyGenLLM, request) + + req = self._build_request( + method="POST", + path="/api/generate/llm", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "form", components.BodyGenLLM + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="genLLM", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "422", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GenLLMResponse( + llm_response=utils.unmarshal_json( + http_res.text, Optional[components.LLMResponse] + ), + http_meta=components.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMResponseBody(data=response_data) + if utils.match_response(http_res, "401", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMGenerateResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMGenerateResponseBody(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMGenerateResponseResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMGenerateResponseResponseBody(data=response_data) + if utils.match_response(http_res, "500", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMGenerateResponse500ResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMGenerateResponse500ResponseBody(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "default", "application/json"): + return operations.GenLLMResponse( + studio_api_error=utils.unmarshal_json( + http_res.text, Optional[errors.StudioAPIError] + ), + http_meta=components.HTTPMetadata(request=req, response=http_res), + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def llm_async( + self, + *, + request: Union[components.BodyGenLLM, components.BodyGenLLMTypedDict], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> operations.GenLLMResponse: + r"""LLM + + Generate text using a language model. + + :param request: The request object to send. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + if not isinstance(request, BaseModel): + request = utils.unmarshal(request, components.BodyGenLLM) + request = cast(components.BodyGenLLM, request) + + req = self._build_request_async( + method="POST", + path="/api/generate/llm", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=False, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request, False, False, "form", components.BodyGenLLM + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="genLLM", + oauth2_scopes=[], + security_source=self.sdk_configuration.security, + ), + request=req, + error_status_codes=["400", "401", "422", "4XX", "500", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return operations.GenLLMResponse( + llm_response=utils.unmarshal_json( + http_res.text, Optional[components.LLMResponse] + ), + http_meta=components.HTTPMetadata(request=req, response=http_res), + ) + if utils.match_response(http_res, "400", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMResponseBody(data=response_data) + if utils.match_response(http_res, "401", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMGenerateResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMGenerateResponseBody(data=response_data) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMGenerateResponseResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMGenerateResponseResponseBody(data=response_data) + if utils.match_response(http_res, "500", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, errors.GenLLMGenerateResponse500ResponseBodyUnion + ) + response_data.http_meta = components.HTTPMetadata( + request=req, response=http_res + ) + raise errors.GenLLMGenerateResponse500ResponseBody(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "default", "application/json"): + return operations.GenLLMResponse( + studio_api_error=utils.unmarshal_json( + http_res.text, Optional[errors.StudioAPIError] + ), + http_meta=components.HTTPMetadata(request=req, response=http_res), + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/httpclient.py b/src/livepeer/httpclient.py index 36b642a..1e42635 100644 --- a/src/livepeer/httpclient.py +++ b/src/livepeer/httpclient.py @@ -1,6 +1,8 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" # pyright: reportReturnType = false +import asyncio +from concurrent.futures import ThreadPoolExecutor from typing_extensions import Protocol, runtime_checkable import httpx from typing import Any, Optional, Union @@ -41,6 +43,9 @@ def build_request( ) -> httpx.Request: pass + def close(self) -> None: + pass + @runtime_checkable class AsyncHttpClient(Protocol): @@ -76,3 +81,56 @@ def build_request( extensions: Optional[httpx._types.RequestExtensions] = None, ) -> httpx.Request: pass + + async def aclose(self) -> None: + pass + + +class ClientOwner(Protocol): + client: Union[HttpClient, None] + async_client: Union[AsyncHttpClient, None] + + +def close_clients( + owner: ClientOwner, + sync_client: Union[HttpClient, None], + sync_client_supplied: bool, + async_client: Union[AsyncHttpClient, None], + async_client_supplied: bool, +) -> None: + """ + A finalizer function that is meant to be used with weakref.finalize to close + httpx clients used by an SDK so that underlying resources can be garbage + collected. + """ + + # Unset the client/async_client properties so there are no more references + # to them from the owning SDK instance and they can be reaped. + owner.client = None + owner.async_client = None + + if sync_client is not None and not sync_client_supplied: + try: + sync_client.close() + except Exception: + pass + + if async_client is not None and not async_client_supplied: + is_async = False + try: + asyncio.get_running_loop() + is_async = True + except RuntimeError: + pass + + try: + # If this function is called in an async loop then start another + # loop in a separate thread to close the async http client. + if is_async: + with ThreadPoolExecutor(max_workers=1) as executor: + future = executor.submit(asyncio.run, async_client.aclose()) + future.result() + else: + asyncio.run(async_client.aclose()) + except Exception: + pass diff --git a/src/livepeer/metrics.py b/src/livepeer/metrics.py index ec356e9..fd5bd43 100644 --- a/src/livepeer/metrics.py +++ b/src/livepeer/metrics.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import List, Optional, Union, cast +from typing import List, Mapping, Optional, Union, cast class Metrics(BaseSDK): @@ -20,6 +20,7 @@ def get_realtime_viewership( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRealtimeViewershipNowResponse: r"""Query realtime viewership @@ -32,6 +33,7 @@ def get_realtime_viewership( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -40,6 +42,8 @@ def get_realtime_viewership( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRealtimeViewershipNowRequest( playback_id=playback_id, @@ -47,7 +51,7 @@ def get_realtime_viewership( breakdown_by=breakdown_by, ) - req = self.build_request( + req = self._build_request( method="GET", path="/data/views/now", base_url=base_url, @@ -58,6 +62,7 @@ def get_realtime_viewership( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -72,6 +77,7 @@ def get_realtime_viewership( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRealtimeViewershipNow", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -88,21 +94,28 @@ def get_realtime_viewership( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRealtimeViewershipNowResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -115,6 +128,7 @@ async def get_realtime_viewership_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRealtimeViewershipNowResponse: r"""Query realtime viewership @@ -127,6 +141,7 @@ async def get_realtime_viewership_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -135,6 +150,8 @@ async def get_realtime_viewership_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRealtimeViewershipNowRequest( playback_id=playback_id, @@ -142,7 +159,7 @@ async def get_realtime_viewership_async( breakdown_by=breakdown_by, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/data/views/now", base_url=base_url, @@ -153,6 +170,7 @@ async def get_realtime_viewership_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -167,6 +185,7 @@ async def get_realtime_viewership_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRealtimeViewershipNow", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -183,21 +202,28 @@ async def get_realtime_viewership_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRealtimeViewershipNowResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -211,6 +237,7 @@ def get_viewership( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetViewershipMetricsResponse: r"""Query viewership metrics @@ -221,6 +248,7 @@ def get_viewership( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -229,12 +257,14 @@ def get_viewership( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetViewershipMetricsRequest) request = cast(operations.GetViewershipMetricsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/data/views/query", base_url=base_url, @@ -245,6 +275,7 @@ def get_viewership( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -259,6 +290,7 @@ def get_viewership( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getViewershipMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -275,21 +307,28 @@ def get_viewership( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetViewershipMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -303,6 +342,7 @@ async def get_viewership_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetViewershipMetricsResponse: r"""Query viewership metrics @@ -313,6 +353,7 @@ async def get_viewership_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -321,12 +362,14 @@ async def get_viewership_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetViewershipMetricsRequest) request = cast(operations.GetViewershipMetricsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/data/views/query", base_url=base_url, @@ -337,6 +380,7 @@ async def get_viewership_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -351,6 +395,7 @@ async def get_viewership_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getViewershipMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -367,21 +412,28 @@ async def get_viewership_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetViewershipMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -395,6 +447,7 @@ def get_creator_viewership( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCreatorViewershipMetricsResponse: r"""Query creator viewership metrics @@ -405,6 +458,7 @@ def get_creator_viewership( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -413,6 +467,8 @@ def get_creator_viewership( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -420,7 +476,7 @@ def get_creator_viewership( ) request = cast(operations.GetCreatorViewershipMetricsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/data/views/query/creator", base_url=base_url, @@ -431,6 +487,7 @@ def get_creator_viewership( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -445,6 +502,7 @@ def get_creator_viewership( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getCreatorViewershipMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -461,21 +519,28 @@ def get_creator_viewership( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetCreatorViewershipMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -489,6 +554,7 @@ async def get_creator_viewership_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetCreatorViewershipMetricsResponse: r"""Query creator viewership metrics @@ -499,6 +565,7 @@ async def get_creator_viewership_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -507,6 +574,8 @@ async def get_creator_viewership_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal( @@ -514,7 +583,7 @@ async def get_creator_viewership_async( ) request = cast(operations.GetCreatorViewershipMetricsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/data/views/query/creator", base_url=base_url, @@ -525,6 +594,7 @@ async def get_creator_viewership_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -539,6 +609,7 @@ async def get_creator_viewership_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getCreatorViewershipMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -555,21 +626,28 @@ async def get_creator_viewership_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetCreatorViewershipMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -580,6 +658,7 @@ def get_public_viewership( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetPublicViewershipMetricsResponse: r"""Query public total views metrics @@ -592,6 +671,7 @@ def get_public_viewership( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -600,12 +680,14 @@ def get_public_viewership( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetPublicViewershipMetricsRequest( playback_id=playback_id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/data/views/query/total/{playbackId}", base_url=base_url, @@ -616,6 +698,7 @@ def get_public_viewership( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -630,6 +713,7 @@ def get_public_viewership( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getPublicViewershipMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -646,21 +730,28 @@ def get_public_viewership( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetPublicViewershipMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -671,6 +762,7 @@ async def get_public_viewership_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetPublicViewershipMetricsResponse: r"""Query public total views metrics @@ -683,6 +775,7 @@ async def get_public_viewership_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -691,12 +784,14 @@ async def get_public_viewership_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetPublicViewershipMetricsRequest( playback_id=playback_id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/data/views/query/total/{playbackId}", base_url=base_url, @@ -707,6 +802,7 @@ async def get_public_viewership_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -721,6 +817,7 @@ async def get_public_viewership_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getPublicViewershipMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -737,21 +834,28 @@ async def get_public_viewership_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetPublicViewershipMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -765,6 +869,7 @@ def get_usage( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetUsageMetricsResponse: r"""Query usage metrics @@ -772,6 +877,7 @@ def get_usage( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -780,12 +886,14 @@ def get_usage( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetUsageMetricsRequest) request = cast(operations.GetUsageMetricsRequest, request) - req = self.build_request( + req = self._build_request( method="GET", path="/data/usage/query", base_url=base_url, @@ -796,6 +904,7 @@ def get_usage( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -810,6 +919,7 @@ def get_usage( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getUsageMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -826,21 +936,28 @@ def get_usage( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetUsageMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -854,6 +971,7 @@ async def get_usage_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetUsageMetricsResponse: r"""Query usage metrics @@ -861,6 +979,7 @@ async def get_usage_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -869,12 +988,14 @@ async def get_usage_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, operations.GetUsageMetricsRequest) request = cast(operations.GetUsageMetricsRequest, request) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/data/usage/query", base_url=base_url, @@ -885,6 +1006,7 @@ async def get_usage_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -899,6 +1021,7 @@ async def get_usage_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getUsageMetrics", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -915,20 +1038,27 @@ async def get_usage_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetUsageMetricsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/models/__init__.py b/src/livepeer/models/__init__.py new file mode 100644 index 0000000..cc53976 --- /dev/null +++ b/src/livepeer/models/__init__.py @@ -0,0 +1,4 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +# package + diff --git a/src/livepeer/models/components/__init__.py b/src/livepeer/models/components/__init__.py index dac556e..8cb5f55 100644 --- a/src/livepeer/models/components/__init__.py +++ b/src/livepeer/models/components/__init__.py @@ -73,6 +73,7 @@ BodyGenImageToVideoImageTypedDict, BodyGenImageToVideoTypedDict, ) +from .body_genllm import BodyGenLLM, BodyGenLLMTypedDict from .body_gensegmentanything2 import ( BodyGenSegmentAnything2, BodyGenSegmentAnything2Image, @@ -97,6 +98,7 @@ ) from .encryption import Encryption, EncryptionTypedDict from .encryption_output import EncryptionOutput, EncryptionOutputTypedDict +from .error import Error, ErrorTypedDict from .export_task_params import ( Custom, CustomTypedDict, @@ -129,6 +131,7 @@ PinataTypedDict, ) from .ipfs_file_info import IpfsFileInfo, IpfsFileInfoTypedDict +from .llmresponse import LLMResponse, LLMResponseTypedDict from .masksresponse import MasksResponse, MasksResponseTypedDict from .media import Media, MediaTypedDict from .multistream import Multistream, MultistreamTypedDict @@ -137,10 +140,6 @@ MultistreamTargetInput, MultistreamTargetInputTypedDict, ) -from .multistream_target_patch_payload import ( - MultistreamTargetPatchPayload, - MultistreamTargetPatchPayloadTypedDict, -) from .new_asset_from_url_payload import ( NewAssetFromURLPayload, NewAssetFromURLPayloadTypedDict, @@ -249,6 +248,7 @@ ThreeTypedDict, ) from .stream_patch_payload import StreamPatchPayload, StreamPatchPayloadTypedDict +from .studio_api_error import StudioAPIError, StudioAPIErrorTypedDict from .target import Target, TargetSpec, TargetSpecTypedDict, TargetTypedDict from .target_add_payload import ( TargetAddPayload, @@ -373,6 +373,7 @@ WebhookLogTypedDict, ) + __all__ = [ "APIError", "APIErrorTypedDict", @@ -414,6 +415,8 @@ "BodyGenImageToVideoImage", "BodyGenImageToVideoImageTypedDict", "BodyGenImageToVideoTypedDict", + "BodyGenLLM", + "BodyGenLLMTypedDict", "BodyGenSegmentAnything2", "BodyGenSegmentAnything2Image", "BodyGenSegmentAnything2ImageTypedDict", @@ -453,6 +456,8 @@ "EncryptionOutput", "EncryptionOutputTypedDict", "EncryptionTypedDict", + "Error", + "ErrorTypedDict", "Events", "Export", "ExportData", @@ -504,6 +509,8 @@ "IsMobile", "IsMobile1", "IsMobileTypedDict", + "LLMResponse", + "LLMResponseTypedDict", "LastFailure", "LastFailureTypedDict", "Live", @@ -525,8 +532,6 @@ "MultistreamTarget", "MultistreamTargetInput", "MultistreamTargetInputTypedDict", - "MultistreamTargetPatchPayload", - "MultistreamTargetPatchPayloadTypedDict", "MultistreamTargetTypedDict", "MultistreamTypedDict", "Name", @@ -645,6 +650,8 @@ "StreamTypedDict", "StreamUserTags", "StreamUserTagsTypedDict", + "StudioAPIError", + "StudioAPIErrorTypedDict", "Target", "TargetAddPayload", "TargetAddPayloadSpec", diff --git a/src/livepeer/models/components/apierror.py b/src/livepeer/models/components/apierror.py index dbf12f7..309edce 100644 --- a/src/livepeer/models/components/apierror.py +++ b/src/livepeer/models/components/apierror.py @@ -2,7 +2,7 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import TypedDict +from typing_extensions import TypedDict class APIErrorTypedDict(TypedDict): diff --git a/src/livepeer/models/components/asset.py b/src/livepeer/models/components/asset.py index 02ab84d..2c001c4 100644 --- a/src/livepeer/models/components/asset.py +++ b/src/livepeer/models/components/asset.py @@ -11,8 +11,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import Any, List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import Any, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict class AssetType(str, Enum): @@ -105,10 +105,12 @@ class Source1(BaseModel): encryption: Optional[EncryptionOutput] = None -SourceTypedDict = Union[TwoTypedDict, Source1TypedDict, Source3TypedDict] +SourceTypedDict = TypeAliasType( + "SourceTypedDict", Union[TwoTypedDict, Source1TypedDict, Source3TypedDict] +) -Source = Union[Two, Source1, Source3] +Source = TypeAliasType("Source", Union[Two, Source1, Source3]) class AssetNftMetadataTemplate(str, Enum): @@ -348,7 +350,7 @@ class Tracks(BaseModel): class VideoSpecTypedDict(TypedDict): r"""Video metadata""" - format: NotRequired[str] + format_: NotRequired[str] r"""Format of the asset""" duration: NotRequired[float] r"""Duration of the asset in seconds (float)""" @@ -364,7 +366,7 @@ class VideoSpecTypedDict(TypedDict): class VideoSpec(BaseModel): r"""Video metadata""" - format: Optional[str] = None + format_: Annotated[Optional[str], pydantic.Field(alias="format")] = None r"""Format of the asset""" duration: Optional[float] = None @@ -522,7 +524,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/asset_patch_payload.py b/src/livepeer/models/components/asset_patch_payload.py index 775db0d..4b1a14a 100644 --- a/src/livepeer/models/components/asset_patch_payload.py +++ b/src/livepeer/models/components/asset_patch_payload.py @@ -7,8 +7,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class AssetPatchPayloadTypedDict(TypedDict): @@ -49,7 +49,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/attestation.py b/src/livepeer/models/components/attestation.py index bdae319..7d30c40 100644 --- a/src/livepeer/models/components/attestation.py +++ b/src/livepeer/models/components/attestation.py @@ -5,8 +5,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Any, List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Any, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class PrimaryType(str, Enum): diff --git a/src/livepeer/models/components/body_genaudiototext.py b/src/livepeer/models/components/body_genaudiototext.py index 3859ca4..2afaab9 100644 --- a/src/livepeer/models/components/body_genaudiototext.py +++ b/src/livepeer/models/components/body_genaudiototext.py @@ -5,8 +5,8 @@ from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, MultipartFormMetadata import pydantic -from typing import IO, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict class AudioTypedDict(TypedDict): @@ -17,7 +17,7 @@ class AudioTypedDict(TypedDict): class Audio(BaseModel): file_name: Annotated[ - str, pydantic.Field(alias="audio"), FieldMetadata(multipart=True) + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) ] content: Annotated[ @@ -38,17 +38,18 @@ class BodyGenAudioToTextTypedDict(TypedDict): r"""Uploaded audio file to be transcribed.""" model_id: NotRequired[str] r"""Hugging Face model ID used for transcription.""" + return_timestamps: NotRequired[str] + r"""Return timestamps for the transcribed text. Supported values: 'sentence', 'word', or a string boolean ('true' or 'false'). Default is 'true' ('sentence'). 'false' means no timestamps. 'word' means word-based timestamps.""" class BodyGenAudioToText(BaseModel): - audio: Annotated[ - Audio, - pydantic.Field(alias=""), - FieldMetadata(multipart=MultipartFormMetadata(file=True)), - ] + audio: Annotated[Audio, FieldMetadata(multipart=MultipartFormMetadata(file=True))] r"""Uploaded audio file to be transcribed.""" model_id: Annotated[Optional[str], FieldMetadata(multipart=True)] = ( "openai/whisper-large-v3" ) r"""Hugging Face model ID used for transcription.""" + + return_timestamps: Annotated[Optional[str], FieldMetadata(multipart=True)] = "true" + r"""Return timestamps for the transcribed text. Supported values: 'sentence', 'word', or a string boolean ('true' or 'false'). Default is 'true' ('sentence'). 'false' means no timestamps. 'word' means word-based timestamps.""" diff --git a/src/livepeer/models/components/body_genimagetoimage.py b/src/livepeer/models/components/body_genimagetoimage.py index 425f2bf..99fc4b9 100644 --- a/src/livepeer/models/components/body_genimagetoimage.py +++ b/src/livepeer/models/components/body_genimagetoimage.py @@ -5,8 +5,8 @@ from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, MultipartFormMetadata import pydantic -from typing import IO, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict class ImageTypedDict(TypedDict): @@ -17,7 +17,7 @@ class ImageTypedDict(TypedDict): class Image(BaseModel): file_name: Annotated[ - str, pydantic.Field(alias="image"), FieldMetadata(multipart=True) + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) ] content: Annotated[ @@ -40,6 +40,8 @@ class BodyGenImageToImageTypedDict(TypedDict): r"""Uploaded image to modify with the pipeline.""" model_id: NotRequired[str] r"""Hugging Face model ID used for image generation.""" + loras: NotRequired[str] + r"""A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { \"latent-consistency/lcm-lora-sdxl\": 1.0, \"nerijs/pixel-art-xl\": 1.2}.""" strength: NotRequired[float] r"""Degree of transformation applied to the reference image (0 to 1).""" guidance_scale: NotRequired[float] @@ -62,11 +64,7 @@ class BodyGenImageToImage(BaseModel): prompt: Annotated[str, FieldMetadata(multipart=True)] r"""Text prompt(s) to guide image generation.""" - image: Annotated[ - Image, - pydantic.Field(alias=""), - FieldMetadata(multipart=MultipartFormMetadata(file=True)), - ] + image: Annotated[Image, FieldMetadata(multipart=MultipartFormMetadata(file=True))] r"""Uploaded image to modify with the pipeline.""" model_id: Annotated[Optional[str], FieldMetadata(multipart=True)] = ( @@ -74,6 +72,9 @@ class BodyGenImageToImage(BaseModel): ) r"""Hugging Face model ID used for image generation.""" + loras: Annotated[Optional[str], FieldMetadata(multipart=True)] = "" + r"""A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { \"latent-consistency/lcm-lora-sdxl\": 1.0, \"nerijs/pixel-art-xl\": 1.2}.""" + strength: Annotated[Optional[float], FieldMetadata(multipart=True)] = 0.8 r"""Degree of transformation applied to the reference image (0 to 1).""" diff --git a/src/livepeer/models/components/body_genimagetovideo.py b/src/livepeer/models/components/body_genimagetovideo.py index 73a0a47..9232bbc 100644 --- a/src/livepeer/models/components/body_genimagetovideo.py +++ b/src/livepeer/models/components/body_genimagetovideo.py @@ -5,8 +5,8 @@ from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, MultipartFormMetadata import pydantic -from typing import IO, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict class BodyGenImageToVideoImageTypedDict(TypedDict): @@ -17,7 +17,7 @@ class BodyGenImageToVideoImageTypedDict(TypedDict): class BodyGenImageToVideoImage(BaseModel): file_name: Annotated[ - str, pydantic.Field(alias="image"), FieldMetadata(multipart=True) + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) ] content: Annotated[ @@ -59,7 +59,6 @@ class BodyGenImageToVideoTypedDict(TypedDict): class BodyGenImageToVideo(BaseModel): image: Annotated[ BodyGenImageToVideoImage, - pydantic.Field(alias=""), FieldMetadata(multipart=MultipartFormMetadata(file=True)), ] r"""Uploaded image to generate a video from.""" diff --git a/src/livepeer/models/components/body_genllm.py b/src/livepeer/models/components/body_genllm.py new file mode 100644 index 0000000..f740e0d --- /dev/null +++ b/src/livepeer/models/components/body_genllm.py @@ -0,0 +1,35 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from livepeer.types import BaseModel +from livepeer.utils import FieldMetadata +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class BodyGenLLMTypedDict(TypedDict): + prompt: str + model_id: NotRequired[str] + system_msg: NotRequired[str] + temperature: NotRequired[float] + max_tokens: NotRequired[int] + history: NotRequired[str] + stream: NotRequired[bool] + + +class BodyGenLLM(BaseModel): + prompt: Annotated[str, FieldMetadata(form=True)] + + model_id: Annotated[Optional[str], FieldMetadata(form=True)] = ( + "meta-llama/Meta-Llama-3.1-8B-Instruct" + ) + + system_msg: Annotated[Optional[str], FieldMetadata(form=True)] = "" + + temperature: Annotated[Optional[float], FieldMetadata(form=True)] = 0.7 + + max_tokens: Annotated[Optional[int], FieldMetadata(form=True)] = 256 + + history: Annotated[Optional[str], FieldMetadata(form=True)] = "[]" + + stream: Annotated[Optional[bool], FieldMetadata(form=True)] = False diff --git a/src/livepeer/models/components/body_gensegmentanything2.py b/src/livepeer/models/components/body_gensegmentanything2.py index 077d36f..a786059 100644 --- a/src/livepeer/models/components/body_gensegmentanything2.py +++ b/src/livepeer/models/components/body_gensegmentanything2.py @@ -5,8 +5,8 @@ from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, MultipartFormMetadata import pydantic -from typing import IO, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict class BodyGenSegmentAnything2ImageTypedDict(TypedDict): @@ -17,7 +17,7 @@ class BodyGenSegmentAnything2ImageTypedDict(TypedDict): class BodyGenSegmentAnything2Image(BaseModel): file_name: Annotated[ - str, pydantic.Field(alias="image"), FieldMetadata(multipart=True) + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) ] content: Annotated[ @@ -57,13 +57,12 @@ class BodyGenSegmentAnything2TypedDict(TypedDict): class BodyGenSegmentAnything2(BaseModel): image: Annotated[ BodyGenSegmentAnything2Image, - pydantic.Field(alias=""), FieldMetadata(multipart=MultipartFormMetadata(file=True)), ] r"""Image to segment.""" model_id: Annotated[Optional[str], FieldMetadata(multipart=True)] = ( - "facebook/sam2-hiera-large:" + "facebook/sam2-hiera-large" ) r"""Hugging Face model ID used for image generation.""" diff --git a/src/livepeer/models/components/body_genupscale.py b/src/livepeer/models/components/body_genupscale.py index cded583..95a242a 100644 --- a/src/livepeer/models/components/body_genupscale.py +++ b/src/livepeer/models/components/body_genupscale.py @@ -5,8 +5,8 @@ from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, MultipartFormMetadata import pydantic -from typing import IO, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import IO, Optional, Union +from typing_extensions import Annotated, NotRequired, TypedDict class BodyGenUpscaleImageTypedDict(TypedDict): @@ -17,7 +17,7 @@ class BodyGenUpscaleImageTypedDict(TypedDict): class BodyGenUpscaleImage(BaseModel): file_name: Annotated[ - str, pydantic.Field(alias="image"), FieldMetadata(multipart=True) + str, pydantic.Field(alias="fileName"), FieldMetadata(multipart=True) ] content: Annotated[ @@ -53,9 +53,7 @@ class BodyGenUpscale(BaseModel): r"""Text prompt(s) to guide upscaled image generation.""" image: Annotated[ - BodyGenUpscaleImage, - pydantic.Field(alias=""), - FieldMetadata(multipart=MultipartFormMetadata(file=True)), + BodyGenUpscaleImage, FieldMetadata(multipart=MultipartFormMetadata(file=True)) ] r"""Uploaded image to modify with the pipeline.""" diff --git a/src/livepeer/models/components/chunk.py b/src/livepeer/models/components/chunk.py index a450067..6d3a0bd 100644 --- a/src/livepeer/models/components/chunk.py +++ b/src/livepeer/models/components/chunk.py @@ -2,7 +2,8 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import Any, List, TypedDict +from typing import Any, List +from typing_extensions import TypedDict class ChunkTypedDict(TypedDict): diff --git a/src/livepeer/models/components/clip_payload.py b/src/livepeer/models/components/clip_payload.py index 43aa718..f27ed40 100644 --- a/src/livepeer/models/components/clip_payload.py +++ b/src/livepeer/models/components/clip_payload.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class ClipPayloadTypedDict(TypedDict): diff --git a/src/livepeer/models/components/create_room_response.py b/src/livepeer/models/components/create_room_response.py index daec7f1..20f8b48 100644 --- a/src/livepeer/models/components/create_room_response.py +++ b/src/livepeer/models/components/create_room_response.py @@ -2,8 +2,8 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import Optional, TypedDict -from typing_extensions import NotRequired +from typing import Optional +from typing_extensions import NotRequired, TypedDict class CreateRoomResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/creator_id.py b/src/livepeer/models/components/creator_id.py index 960ea49..2660125 100644 --- a/src/livepeer/models/components/creator_id.py +++ b/src/livepeer/models/components/creator_id.py @@ -3,7 +3,7 @@ from __future__ import annotations from enum import Enum from livepeer.types import BaseModel -from typing import TypedDict +from typing_extensions import TypedDict class CreatorIDType(str, Enum): diff --git a/src/livepeer/models/components/encryption.py b/src/livepeer/models/components/encryption.py index 002b979..a518c48 100644 --- a/src/livepeer/models/components/encryption.py +++ b/src/livepeer/models/components/encryption.py @@ -3,8 +3,7 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import TypedDict -from typing_extensions import Annotated +from typing_extensions import Annotated, TypedDict class EncryptionTypedDict(TypedDict): diff --git a/src/livepeer/models/components/encryption_output.py b/src/livepeer/models/components/encryption_output.py index c73b2ea..90a2648 100644 --- a/src/livepeer/models/components/encryption_output.py +++ b/src/livepeer/models/components/encryption_output.py @@ -2,7 +2,7 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import TypedDict +from typing_extensions import TypedDict class EncryptionOutputTypedDict(TypedDict): diff --git a/src/livepeer/models/components/error.py b/src/livepeer/models/components/error.py new file mode 100644 index 0000000..e18b793 --- /dev/null +++ b/src/livepeer/models/components/error.py @@ -0,0 +1,14 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from livepeer.types import BaseModel +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict + + +class ErrorTypedDict(TypedDict): + errors: NotRequired[List[str]] + + +class Error(BaseModel): + errors: Optional[List[str]] = None diff --git a/src/livepeer/models/components/export_task_params.py b/src/livepeer/models/components/export_task_params.py index aacfb40..86265d2 100644 --- a/src/livepeer/models/components/export_task_params.py +++ b/src/livepeer/models/components/export_task_params.py @@ -3,8 +3,8 @@ from __future__ import annotations from .ipfs_export_params import IpfsExportParams, IpfsExportParamsTypedDict from livepeer.types import BaseModel -from typing import Dict, Optional, TypedDict, Union -from typing_extensions import NotRequired +from typing import Dict, Optional, Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict class ExportTaskParams2TypedDict(TypedDict): @@ -49,11 +49,14 @@ class ExportTaskParams1(BaseModel): r"""custom URL parameters for the export task""" -ExportTaskParamsTypedDict = Union[ - ExportTaskParams1TypedDict, ExportTaskParams2TypedDict -] +ExportTaskParamsTypedDict = TypeAliasType( + "ExportTaskParamsTypedDict", + Union[ExportTaskParams1TypedDict, ExportTaskParams2TypedDict], +) r"""Parameters for the export task""" -ExportTaskParams = Union[ExportTaskParams1, ExportTaskParams2] +ExportTaskParams = TypeAliasType( + "ExportTaskParams", Union[ExportTaskParams1, ExportTaskParams2] +) r"""Parameters for the export task""" diff --git a/src/livepeer/models/components/ffmpeg_profile.py b/src/livepeer/models/components/ffmpeg_profile.py index 68abd4d..18b1385 100644 --- a/src/livepeer/models/components/ffmpeg_profile.py +++ b/src/livepeer/models/components/ffmpeg_profile.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class Profile(str, Enum): diff --git a/src/livepeer/models/components/get_room_user_response.py b/src/livepeer/models/components/get_room_user_response.py index bb8f1a0..08f3c24 100644 --- a/src/livepeer/models/components/get_room_user_response.py +++ b/src/livepeer/models/components/get_room_user_response.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetRoomUserResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/httpmetadata.py b/src/livepeer/models/components/httpmetadata.py index 35a6a40..4b5d154 100644 --- a/src/livepeer/models/components/httpmetadata.py +++ b/src/livepeer/models/components/httpmetadata.py @@ -4,8 +4,8 @@ import httpx from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated +from typing import Optional +from typing_extensions import Annotated, TypedDict class HTTPMetadataTypedDict(TypedDict): diff --git a/src/livepeer/models/components/imageresponse.py b/src/livepeer/models/components/imageresponse.py index 1e32456..256c65e 100644 --- a/src/livepeer/models/components/imageresponse.py +++ b/src/livepeer/models/components/imageresponse.py @@ -3,7 +3,8 @@ from __future__ import annotations from .media import Media, MediaTypedDict from livepeer.types import BaseModel -from typing import List, TypedDict +from typing import List +from typing_extensions import TypedDict class ImageResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/input_creator_id.py b/src/livepeer/models/components/input_creator_id.py index 6f3e7bc..1d63efc 100644 --- a/src/livepeer/models/components/input_creator_id.py +++ b/src/livepeer/models/components/input_creator_id.py @@ -3,7 +3,8 @@ from __future__ import annotations from enum import Enum from livepeer.types import BaseModel -from typing import TypedDict, Union +from typing import Union +from typing_extensions import TypeAliasType, TypedDict class InputCreatorIDType(str, Enum): @@ -21,7 +22,9 @@ class InputCreatorID1(BaseModel): value: str -InputCreatorIDTypedDict = Union[InputCreatorID1TypedDict, str] +InputCreatorIDTypedDict = TypeAliasType( + "InputCreatorIDTypedDict", Union[InputCreatorID1TypedDict, str] +) -InputCreatorID = Union[InputCreatorID1, str] +InputCreatorID = TypeAliasType("InputCreatorID", Union[InputCreatorID1, str]) diff --git a/src/livepeer/models/components/ipfs_export_params.py b/src/livepeer/models/components/ipfs_export_params.py index e041a5f..a7a1625 100644 --- a/src/livepeer/models/components/ipfs_export_params.py +++ b/src/livepeer/models/components/ipfs_export_params.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Any, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import Any, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict class Pinata2TypedDict(TypedDict): @@ -25,14 +25,16 @@ class Pinata1(BaseModel): pass -PinataTypedDict = Union[Pinata1TypedDict, Pinata2TypedDict] +PinataTypedDict = TypeAliasType( + "PinataTypedDict", Union[Pinata1TypedDict, Pinata2TypedDict] +) r"""Custom credentials for the Piñata service. Must have either a JWT or an API key and an API secret. """ -Pinata = Union[Pinata1, Pinata2] +Pinata = TypeAliasType("Pinata", Union[Pinata1, Pinata2]) r"""Custom credentials for the Piñata service. Must have either a JWT or an API key and an API secret. diff --git a/src/livepeer/models/components/ipfs_file_info.py b/src/livepeer/models/components/ipfs_file_info.py index a2b9363..6006713 100644 --- a/src/livepeer/models/components/ipfs_file_info.py +++ b/src/livepeer/models/components/ipfs_file_info.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class IpfsFileInfoTypedDict(TypedDict): diff --git a/src/livepeer/models/components/llmresponse.py b/src/livepeer/models/components/llmresponse.py new file mode 100644 index 0000000..17bd39d --- /dev/null +++ b/src/livepeer/models/components/llmresponse.py @@ -0,0 +1,16 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from livepeer.types import BaseModel +from typing_extensions import TypedDict + + +class LLMResponseTypedDict(TypedDict): + response: str + tokens_used: int + + +class LLMResponse(BaseModel): + response: str + + tokens_used: int diff --git a/src/livepeer/models/components/masksresponse.py b/src/livepeer/models/components/masksresponse.py index 148d6ac..89b9b7d 100644 --- a/src/livepeer/models/components/masksresponse.py +++ b/src/livepeer/models/components/masksresponse.py @@ -2,7 +2,7 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import TypedDict +from typing_extensions import TypedDict class MasksResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/media.py b/src/livepeer/models/components/media.py index f2c9164..b883b23 100644 --- a/src/livepeer/models/components/media.py +++ b/src/livepeer/models/components/media.py @@ -2,7 +2,7 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import TypedDict +from typing_extensions import TypedDict class MediaTypedDict(TypedDict): diff --git a/src/livepeer/models/components/multistream.py b/src/livepeer/models/components/multistream.py index 59005ff..9a43a04 100644 --- a/src/livepeer/models/components/multistream.py +++ b/src/livepeer/models/components/multistream.py @@ -3,8 +3,8 @@ from __future__ import annotations from .target import Target, TargetTypedDict from livepeer.types import BaseModel -from typing import List, Optional, TypedDict -from typing_extensions import NotRequired +from typing import List, Optional +from typing_extensions import NotRequired, TypedDict class MultistreamTypedDict(TypedDict): diff --git a/src/livepeer/models/components/multistream_target.py b/src/livepeer/models/components/multistream_target.py index b616abb..530d3bb 100644 --- a/src/livepeer/models/components/multistream_target.py +++ b/src/livepeer/models/components/multistream_target.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class MultistreamTargetTypedDict(TypedDict): diff --git a/src/livepeer/models/components/multistream_target_input.py b/src/livepeer/models/components/multistream_target_input.py index 8b0db2a..50d3a7f 100644 --- a/src/livepeer/models/components/multistream_target_input.py +++ b/src/livepeer/models/components/multistream_target_input.py @@ -2,8 +2,8 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import Optional, TypedDict -from typing_extensions import NotRequired +from typing import Optional +from typing_extensions import NotRequired, TypedDict class MultistreamTargetInputTypedDict(TypedDict): diff --git a/src/livepeer/models/components/multistream_target_patch_payload.py b/src/livepeer/models/components/multistream_target_patch_payload.py deleted file mode 100644 index 624711b..0000000 --- a/src/livepeer/models/components/multistream_target_patch_payload.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" - -from __future__ import annotations -from livepeer.types import BaseModel -from typing import Optional, TypedDict -from typing_extensions import NotRequired - - -class MultistreamTargetPatchPayloadTypedDict(TypedDict): - url: str - r"""Livepeer-compatible multistream target URL (RTMP(S) or SRT)""" - name: NotRequired[str] - disabled: NotRequired[bool] - r"""If true then this multistream target will not be used for pushing - even if it is configured in a stream object. - - """ - - -class MultistreamTargetPatchPayload(BaseModel): - url: str - r"""Livepeer-compatible multistream target URL (RTMP(S) or SRT)""" - - name: Optional[str] = None - - disabled: Optional[bool] = None - r"""If true then this multistream target will not be used for pushing - even if it is configured in a stream object. - - """ diff --git a/src/livepeer/models/components/new_asset_from_url_payload.py b/src/livepeer/models/components/new_asset_from_url_payload.py index 50441c7..5993a03 100644 --- a/src/livepeer/models/components/new_asset_from_url_payload.py +++ b/src/livepeer/models/components/new_asset_from_url_payload.py @@ -9,8 +9,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class NewAssetFromURLPayloadTypedDict(TypedDict): @@ -96,7 +96,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/new_asset_payload.py b/src/livepeer/models/components/new_asset_payload.py index e063378..530cad5 100644 --- a/src/livepeer/models/components/new_asset_payload.py +++ b/src/livepeer/models/components/new_asset_payload.py @@ -8,8 +8,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict class NewAssetPayloadIpfs1TypedDict(TypedDict): @@ -29,7 +29,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) @@ -50,7 +50,9 @@ def serialize_model(self, handler): return m -NewAssetPayloadIpfsTypedDict = Union[NewAssetPayloadIpfs1TypedDict, bool] +NewAssetPayloadIpfsTypedDict = TypeAliasType( + "NewAssetPayloadIpfsTypedDict", Union[NewAssetPayloadIpfs1TypedDict, bool] +) r"""Set to true to make default export to IPFS. To customize the pinned files, specify an object with a spec field. False or null means to unpin from IPFS, but it's unsupported right now. @@ -58,7 +60,9 @@ def serialize_model(self, handler): """ -NewAssetPayloadIpfs = Union[NewAssetPayloadIpfs1, bool] +NewAssetPayloadIpfs = TypeAliasType( + "NewAssetPayloadIpfs", Union[NewAssetPayloadIpfs1, bool] +) r"""Set to true to make default export to IPFS. To customize the pinned files, specify an object with a spec field. False or null means to unpin from IPFS, but it's unsupported right now. @@ -93,7 +97,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) @@ -194,7 +198,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/new_stream_payload.py b/src/livepeer/models/components/new_stream_payload.py index 497165a..98f5bff 100644 --- a/src/livepeer/models/components/new_stream_payload.py +++ b/src/livepeer/models/components/new_stream_payload.py @@ -11,8 +11,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import Dict, List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class NewStreamPayloadRecordingSpecTypedDict(TypedDict): @@ -32,7 +32,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) @@ -131,7 +131,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/playback_info.py b/src/livepeer/models/components/playback_info.py index ccc599d..8570232 100644 --- a/src/livepeer/models/components/playback_info.py +++ b/src/livepeer/models/components/playback_info.py @@ -7,8 +7,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class PlaybackInfoType(str, Enum): @@ -132,7 +132,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/playback_policy.py b/src/livepeer/models/components/playback_policy.py index 2935e0f..87bb143 100644 --- a/src/livepeer/models/components/playback_policy.py +++ b/src/livepeer/models/components/playback_policy.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Any, Dict, List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class Type(str, Enum): diff --git a/src/livepeer/models/components/pull.py b/src/livepeer/models/components/pull.py index 8ff8877..dc0172f 100644 --- a/src/livepeer/models/components/pull.py +++ b/src/livepeer/models/components/pull.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Dict, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import Dict, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict class One(int, Enum): @@ -16,11 +16,11 @@ class One(int, Enum): TWO = 2 -IsMobileTypedDict = Union[One, bool] +IsMobileTypedDict = TypeAliasType("IsMobileTypedDict", Union[One, bool]) r"""Indicates whether the stream will be pulled from a mobile source.""" -IsMobile = Union[One, bool] +IsMobile = TypeAliasType("IsMobile", Union[One, bool]) r"""Indicates whether the stream will be pulled from a mobile source.""" diff --git a/src/livepeer/models/components/realtime_viewership_metric.py b/src/livepeer/models/components/realtime_viewership_metric.py index 27a0372..2c95a05 100644 --- a/src/livepeer/models/components/realtime_viewership_metric.py +++ b/src/livepeer/models/components/realtime_viewership_metric.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RealtimeViewershipMetricTypedDict(TypedDict): diff --git a/src/livepeer/models/components/recordingspec.py b/src/livepeer/models/components/recordingspec.py index 39a7cb8..f5bdc66 100644 --- a/src/livepeer/models/components/recordingspec.py +++ b/src/livepeer/models/components/recordingspec.py @@ -4,8 +4,8 @@ from .transcode_profile import TranscodeProfile, TranscodeProfileTypedDict from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer -from typing import List, TypedDict -from typing_extensions import NotRequired +from typing import List +from typing_extensions import NotRequired, TypedDict class RecordingSpecTypedDict(TypedDict): @@ -25,7 +25,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/room.py b/src/livepeer/models/components/room.py index c4b09bc..f85251a 100644 --- a/src/livepeer/models/components/room.py +++ b/src/livepeer/models/components/room.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Dict, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class ParticipantsTypedDict(TypedDict): diff --git a/src/livepeer/models/components/room_egress_payload.py b/src/livepeer/models/components/room_egress_payload.py index d9fcf79..72adce3 100644 --- a/src/livepeer/models/components/room_egress_payload.py +++ b/src/livepeer/models/components/room_egress_payload.py @@ -3,8 +3,7 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import TypedDict -from typing_extensions import Annotated +from typing_extensions import Annotated, TypedDict class RoomEgressPayloadTypedDict(TypedDict): diff --git a/src/livepeer/models/components/room_user_payload.py b/src/livepeer/models/components/room_user_payload.py index 62f7111..4cdee7c 100644 --- a/src/livepeer/models/components/room_user_payload.py +++ b/src/livepeer/models/components/room_user_payload.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RoomUserPayloadTypedDict(TypedDict): diff --git a/src/livepeer/models/components/room_user_response.py b/src/livepeer/models/components/room_user_response.py index 37d3109..138e050 100644 --- a/src/livepeer/models/components/room_user_response.py +++ b/src/livepeer/models/components/room_user_response.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RoomUserResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/room_user_update_payload.py b/src/livepeer/models/components/room_user_update_payload.py index 13b0e1d..396a89e 100644 --- a/src/livepeer/models/components/room_user_update_payload.py +++ b/src/livepeer/models/components/room_user_update_payload.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RoomUserUpdatePayloadTypedDict(TypedDict): diff --git a/src/livepeer/models/components/security.py b/src/livepeer/models/components/security.py index 690666d..8c8cb8c 100644 --- a/src/livepeer/models/components/security.py +++ b/src/livepeer/models/components/security.py @@ -3,8 +3,7 @@ from __future__ import annotations from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, SecurityMetadata -from typing import TypedDict -from typing_extensions import Annotated +from typing_extensions import Annotated, TypedDict class SecurityTypedDict(TypedDict): diff --git a/src/livepeer/models/components/session.py b/src/livepeer/models/components/session.py index 100346f..9471cd4 100644 --- a/src/livepeer/models/components/session.py +++ b/src/livepeer/models/components/session.py @@ -7,8 +7,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RecordingStatus(str, Enum): @@ -214,7 +214,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/signing_key.py b/src/livepeer/models/components/signing_key.py index 2e2609c..3f7eef0 100644 --- a/src/livepeer/models/components/signing_key.py +++ b/src/livepeer/models/components/signing_key.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class SigningKeyTypedDict(TypedDict): diff --git a/src/livepeer/models/components/spec.py b/src/livepeer/models/components/spec.py index 69cede9..27a3dd2 100644 --- a/src/livepeer/models/components/spec.py +++ b/src/livepeer/models/components/spec.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class NftMetadataTemplate(str, Enum): diff --git a/src/livepeer/models/components/storage.py b/src/livepeer/models/components/storage.py index 227f688..f90fe6e 100644 --- a/src/livepeer/models/components/storage.py +++ b/src/livepeer/models/components/storage.py @@ -4,8 +4,8 @@ from .spec import Spec, SpecTypedDict from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL from pydantic import model_serializer -from typing import TypedDict, Union -from typing_extensions import NotRequired +from typing import Union +from typing_extensions import NotRequired, TypeAliasType, TypedDict class Ipfs1TypedDict(TypedDict): @@ -25,7 +25,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) @@ -46,7 +46,7 @@ def serialize_model(self, handler): return m -IpfsTypedDict = Union[Ipfs1TypedDict, bool] +IpfsTypedDict = TypeAliasType("IpfsTypedDict", Union[Ipfs1TypedDict, bool]) r"""Set to true to make default export to IPFS. To customize the pinned files, specify an object with a spec field. False or null means to unpin from IPFS, but it's unsupported right now. @@ -54,7 +54,7 @@ def serialize_model(self, handler): """ -Ipfs = Union[Ipfs1, bool] +Ipfs = TypeAliasType("Ipfs", Union[Ipfs1, bool]) r"""Set to true to make default export to IPFS. To customize the pinned files, specify an object with a spec field. False or null means to unpin from IPFS, but it's unsupported right now. @@ -89,7 +89,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/storage_status.py b/src/livepeer/models/components/storage_status.py index 467d281..a26274e 100644 --- a/src/livepeer/models/components/storage_status.py +++ b/src/livepeer/models/components/storage_status.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class Phase(str, Enum): diff --git a/src/livepeer/models/components/stream.py b/src/livepeer/models/components/stream.py index d369cf5..796154f 100644 --- a/src/livepeer/models/components/stream.py +++ b/src/livepeer/models/components/stream.py @@ -10,20 +10,22 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import Dict, List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import Dict, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -ThreeTypedDict = Union[str, float] +ThreeTypedDict = TypeAliasType("ThreeTypedDict", Union[str, float]) -Three = Union[str, float] +Three = TypeAliasType("Three", Union[str, float]) -StreamUserTagsTypedDict = Union[str, float, List[ThreeTypedDict]] +StreamUserTagsTypedDict = TypeAliasType( + "StreamUserTagsTypedDict", Union[str, float, List[ThreeTypedDict]] +) -StreamUserTags = Union[str, float, List[Three]] +StreamUserTags = TypeAliasType("StreamUserTags", Union[str, float, List[Three]]) class IsMobile1(int, Enum): @@ -34,11 +36,13 @@ class IsMobile1(int, Enum): TWO = 2 -StreamIsMobileTypedDict = Union[IsMobile1, bool] +StreamIsMobileTypedDict = TypeAliasType( + "StreamIsMobileTypedDict", Union[IsMobile1, bool] +) r"""Indicates whether the stream will be pulled from a mobile source.""" -StreamIsMobile = Union[IsMobile1, bool] +StreamIsMobile = TypeAliasType("StreamIsMobile", Union[IsMobile1, bool]) r"""Indicates whether the stream will be pulled from a mobile source.""" @@ -415,7 +419,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/stream_patch_payload.py b/src/livepeer/models/components/stream_patch_payload.py index 47669d9..a10e6ec 100644 --- a/src/livepeer/models/components/stream_patch_payload.py +++ b/src/livepeer/models/components/stream_patch_payload.py @@ -10,8 +10,8 @@ from livepeer.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL import pydantic from pydantic import model_serializer -from typing import Dict, List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class StreamPatchPayloadTypedDict(TypedDict): @@ -30,6 +30,7 @@ class StreamPatchPayloadTypedDict(TypedDict): recording_spec: NotRequired[RecordingSpecTypedDict] user_tags: NotRequired[Dict[str, UserTagsTypedDict]] r"""User input tags associated with the stream""" + name: NotRequired[str] class StreamPatchPayload(BaseModel): @@ -64,6 +65,8 @@ class StreamPatchPayload(BaseModel): ] = None r"""User input tags associated with the stream""" + name: Optional[str] = None + @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = [ @@ -75,6 +78,7 @@ def serialize_model(self, handler): "profiles", "recordingSpec", "userTags", + "name", ] nullable_fields = ["playbackPolicy", "profiles"] null_default_fields = [] @@ -83,7 +87,7 @@ def serialize_model(self, handler): m = {} - for n, f in self.model_fields.items(): + for n, f in type(self).model_fields.items(): k = f.alias or n val = serialized.get(k) serialized.pop(k, None) diff --git a/src/livepeer/models/components/studio_api_error.py b/src/livepeer/models/components/studio_api_error.py new file mode 100644 index 0000000..d66f809 --- /dev/null +++ b/src/livepeer/models/components/studio_api_error.py @@ -0,0 +1,19 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .httpmetadata import HTTPMetadata, HTTPMetadataTypedDict +from livepeer.types import BaseModel +import pydantic +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class StudioAPIErrorTypedDict(TypedDict): + http_meta: HTTPMetadataTypedDict + errors: NotRequired[List[str]] + + +class StudioAPIError(BaseModel): + http_meta: Annotated[Optional[HTTPMetadata], pydantic.Field(exclude=True)] = None + + errors: Optional[List[str]] = None diff --git a/src/livepeer/models/components/target.py b/src/livepeer/models/components/target.py index 1352b96..0a9f2da 100644 --- a/src/livepeer/models/components/target.py +++ b/src/livepeer/models/components/target.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TargetSpecTypedDict(TypedDict): diff --git a/src/livepeer/models/components/target_add_payload.py b/src/livepeer/models/components/target_add_payload.py index e07460d..8c0b7e2 100644 --- a/src/livepeer/models/components/target_add_payload.py +++ b/src/livepeer/models/components/target_add_payload.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TargetAddPayloadSpecTypedDict(TypedDict): diff --git a/src/livepeer/models/components/target_output.py b/src/livepeer/models/components/target_output.py index dc2d0c3..6f0ac3b 100644 --- a/src/livepeer/models/components/target_output.py +++ b/src/livepeer/models/components/target_output.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TargetOutputTypedDict(TypedDict): diff --git a/src/livepeer/models/components/task.py b/src/livepeer/models/components/task.py index 7b4b8e0..e8361d3 100644 --- a/src/livepeer/models/components/task.py +++ b/src/livepeer/models/components/task.py @@ -11,8 +11,8 @@ from livepeer.types import BaseModel import pydantic from pydantic import ConfigDict -from typing import Any, Dict, List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Any, Dict, List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TaskType(str, Enum): diff --git a/src/livepeer/models/components/textresponse.py b/src/livepeer/models/components/textresponse.py index a7e2636..5842e20 100644 --- a/src/livepeer/models/components/textresponse.py +++ b/src/livepeer/models/components/textresponse.py @@ -3,7 +3,8 @@ from __future__ import annotations from .chunk import Chunk, ChunkTypedDict from livepeer.types import BaseModel -from typing import List, TypedDict +from typing import List +from typing_extensions import TypedDict class TextResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/texttoimageparams.py b/src/livepeer/models/components/texttoimageparams.py index fe0ef94..6da9554 100644 --- a/src/livepeer/models/components/texttoimageparams.py +++ b/src/livepeer/models/components/texttoimageparams.py @@ -2,8 +2,8 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import Optional, TypedDict -from typing_extensions import NotRequired +from typing import Optional +from typing_extensions import NotRequired, TypedDict class TextToImageParamsTypedDict(TypedDict): @@ -11,6 +11,8 @@ class TextToImageParamsTypedDict(TypedDict): r"""Text prompt(s) to guide image generation. Separate multiple prompts with '|' if supported by the model.""" model_id: NotRequired[str] r"""Hugging Face model ID used for image generation.""" + loras: NotRequired[str] + r"""A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { \"latent-consistency/lcm-lora-sdxl\": 1.0, \"nerijs/pixel-art-xl\": 1.2}.""" height: NotRequired[int] r"""The height in pixels of the generated image.""" width: NotRequired[int] @@ -36,6 +38,9 @@ class TextToImageParams(BaseModel): model_id: Optional[str] = "SG161222/RealVisXL_V4.0_Lightning" r"""Hugging Face model ID used for image generation.""" + loras: Optional[str] = "" + r"""A LoRA (Low-Rank Adaptation) model and its corresponding weight for image generation. Example: { \"latent-consistency/lcm-lora-sdxl\": 1.0, \"nerijs/pixel-art-xl\": 1.2}.""" + height: Optional[int] = 576 r"""The height in pixels of the generated image.""" diff --git a/src/livepeer/models/components/transcode_payload.py b/src/livepeer/models/components/transcode_payload.py index c9e91a0..3f33016 100644 --- a/src/livepeer/models/components/transcode_payload.py +++ b/src/livepeer/models/components/transcode_payload.py @@ -6,8 +6,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict class InputType(str, Enum): @@ -92,10 +92,12 @@ class Input1(BaseModel): r"""URL of the video to transcode""" -InputTypedDict = Union[Input1TypedDict, Input2TypedDict] +InputTypedDict = TypeAliasType( + "InputTypedDict", Union[Input1TypedDict, Input2TypedDict] +) -Input = Union[Input1, Input2] +Input = TypeAliasType("Input", Union[Input1, Input2]) class TranscodePayloadStorageType(str, Enum): @@ -203,10 +205,14 @@ class Storage1(BaseModel): r"""Credentials for the output video storage""" -TranscodePayloadStorageTypedDict = Union[Storage2TypedDict, Storage1TypedDict] +TranscodePayloadStorageTypedDict = TypeAliasType( + "TranscodePayloadStorageTypedDict", Union[Storage2TypedDict, Storage1TypedDict] +) -TranscodePayloadStorage = Union[Storage2, Storage1] +TranscodePayloadStorage = TypeAliasType( + "TranscodePayloadStorage", Union[Storage2, Storage1] +) class HlsTypedDict(TypedDict): diff --git a/src/livepeer/models/components/transcode_profile.py b/src/livepeer/models/components/transcode_profile.py index 9ac5785..7e70089 100644 --- a/src/livepeer/models/components/transcode_profile.py +++ b/src/livepeer/models/components/transcode_profile.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TranscodeProfileProfile(str, Enum): diff --git a/src/livepeer/models/components/usage_metric.py b/src/livepeer/models/components/usage_metric.py index 36e37ce..581c2a2 100644 --- a/src/livepeer/models/components/usage_metric.py +++ b/src/livepeer/models/components/usage_metric.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UsageMetricTypedDict(TypedDict): diff --git a/src/livepeer/models/components/usertags.py b/src/livepeer/models/components/usertags.py index 0235cf4..596608f 100644 --- a/src/livepeer/models/components/usertags.py +++ b/src/livepeer/models/components/usertags.py @@ -2,15 +2,18 @@ from __future__ import annotations from typing import List, Union +from typing_extensions import TypeAliasType -UserTags3TypedDict = Union[str, float] +UserTags3TypedDict = TypeAliasType("UserTags3TypedDict", Union[str, float]) -UserTags3 = Union[str, float] +UserTags3 = TypeAliasType("UserTags3", Union[str, float]) -UserTagsTypedDict = Union[str, float, List[UserTags3TypedDict]] +UserTagsTypedDict = TypeAliasType( + "UserTagsTypedDict", Union[str, float, List[UserTags3TypedDict]] +) -UserTags = Union[str, float, List[UserTags3]] +UserTags = TypeAliasType("UserTags", Union[str, float, List[UserTags3]]) diff --git a/src/livepeer/models/components/validationerror.py b/src/livepeer/models/components/validationerror.py index 2ebec25..baa0c5e 100644 --- a/src/livepeer/models/components/validationerror.py +++ b/src/livepeer/models/components/validationerror.py @@ -2,13 +2,14 @@ from __future__ import annotations from livepeer.types import BaseModel -from typing import List, TypedDict, Union +from typing import List, Union +from typing_extensions import TypeAliasType, TypedDict -LocTypedDict = Union[str, int] +LocTypedDict = TypeAliasType("LocTypedDict", Union[str, int]) -Loc = Union[str, int] +Loc = TypeAliasType("Loc", Union[str, int]) class ValidationErrorTypedDict(TypedDict): diff --git a/src/livepeer/models/components/videoresponse.py b/src/livepeer/models/components/videoresponse.py index 354a073..d463eb4 100644 --- a/src/livepeer/models/components/videoresponse.py +++ b/src/livepeer/models/components/videoresponse.py @@ -3,7 +3,8 @@ from __future__ import annotations from .media import Media, MediaTypedDict from livepeer.types import BaseModel -from typing import List, TypedDict +from typing import List +from typing_extensions import TypedDict class VideoResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/components/viewership_metric.py b/src/livepeer/models/components/viewership_metric.py index 6016ac4..c3435be 100644 --- a/src/livepeer/models/components/viewership_metric.py +++ b/src/livepeer/models/components/viewership_metric.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class ViewershipMetricTypedDict(TypedDict): diff --git a/src/livepeer/models/components/webhook.py b/src/livepeer/models/components/webhook.py index 23d198d..55cb1b3 100644 --- a/src/livepeer/models/components/webhook.py +++ b/src/livepeer/models/components/webhook.py @@ -4,8 +4,8 @@ from enum import Enum from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class Events(str, Enum): diff --git a/src/livepeer/models/components/webhook_log.py b/src/livepeer/models/components/webhook_log.py index e7f744a..1f023b3 100644 --- a/src/livepeer/models/components/webhook_log.py +++ b/src/livepeer/models/components/webhook_log.py @@ -3,8 +3,8 @@ from __future__ import annotations from livepeer.types import BaseModel import pydantic -from typing import Dict, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Dict, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RequestTypedDict(TypedDict): diff --git a/src/livepeer/models/errors/__init__.py b/src/livepeer/models/errors/__init__.py index 152cd5f..5e59a70 100644 --- a/src/livepeer/models/errors/__init__.py +++ b/src/livepeer/models/errors/__init__.py @@ -2,6 +2,8 @@ from .error import Error, ErrorData from .genaudiototext import ( + GenAudioToTextGenerateResponse415ResponseBody, + GenAudioToTextGenerateResponse415ResponseBodyUnion, GenAudioToTextGenerateResponse422ResponseBody, GenAudioToTextGenerateResponse422ResponseBodyUnion, GenAudioToTextGenerateResponse500ResponseBody, @@ -33,6 +35,16 @@ GenImageToVideoResponseBody, GenImageToVideoResponseBodyUnion, ) +from .genllm import ( + GenLLMGenerateResponse500ResponseBody, + GenLLMGenerateResponse500ResponseBodyUnion, + GenLLMGenerateResponseBody, + GenLLMGenerateResponseBodyUnion, + GenLLMGenerateResponseResponseBody, + GenLLMGenerateResponseResponseBodyUnion, + GenLLMResponseBody, + GenLLMResponseBodyUnion, +) from .gensegmentanything2 import ( GenSegmentAnything2GenerateResponse500ResponseBody, GenSegmentAnything2GenerateResponse500ResponseBodyUnion, @@ -68,9 +80,12 @@ from .sdkerror import SDKError from .studio_api_error import StudioAPIError, StudioAPIErrorData + __all__ = [ "Error", "ErrorData", + "GenAudioToTextGenerateResponse415ResponseBody", + "GenAudioToTextGenerateResponse415ResponseBodyUnion", "GenAudioToTextGenerateResponse422ResponseBody", "GenAudioToTextGenerateResponse422ResponseBodyUnion", "GenAudioToTextGenerateResponse500ResponseBody", @@ -97,6 +112,14 @@ "GenImageToVideoGenerateResponseResponseBodyUnion", "GenImageToVideoResponseBody", "GenImageToVideoResponseBodyUnion", + "GenLLMGenerateResponse500ResponseBody", + "GenLLMGenerateResponse500ResponseBodyUnion", + "GenLLMGenerateResponseBody", + "GenLLMGenerateResponseBodyUnion", + "GenLLMGenerateResponseResponseBody", + "GenLLMGenerateResponseResponseBodyUnion", + "GenLLMResponseBody", + "GenLLMResponseBodyUnion", "GenSegmentAnything2GenerateResponse500ResponseBody", "GenSegmentAnything2GenerateResponse500ResponseBodyUnion", "GenSegmentAnything2GenerateResponseBody", diff --git a/src/livepeer/models/errors/genaudiototext.py b/src/livepeer/models/errors/genaudiototext.py index 0e158e9..71e9750 100644 --- a/src/livepeer/models/errors/genaudiototext.py +++ b/src/livepeer/models/errors/genaudiototext.py @@ -6,11 +6,13 @@ from .studio_api_error import StudioAPIErrorData from livepeer import utils from typing import Union +from typing_extensions import TypeAliasType -GenAudioToTextGenerateResponse500ResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenAudioToTextGenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenAudioToTextGenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Internal Server Error""" @@ -28,9 +30,10 @@ def __str__(self) -> str: ) -GenAudioToTextGenerateResponse422ResponseBodyUnion = Union[ - HTTPValidationErrorData, StudioAPIErrorData -] +GenAudioToTextGenerateResponse422ResponseBodyUnion = TypeAliasType( + "GenAudioToTextGenerateResponse422ResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) r"""Validation Error""" @@ -48,9 +51,31 @@ def __str__(self) -> str: ) -GenAudioToTextGenerateResponseResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenAudioToTextGenerateResponse415ResponseBodyUnion = TypeAliasType( + "GenAudioToTextGenerateResponse415ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) +r"""Unsupported Media Type""" + + +class GenAudioToTextGenerateResponse415ResponseBody(Exception): + r"""Unsupported Media Type""" + + data: GenAudioToTextGenerateResponse415ResponseBodyUnion + + def __init__(self, data: GenAudioToTextGenerateResponse415ResponseBodyUnion): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json( + self.data, GenAudioToTextGenerateResponse415ResponseBodyUnion + ) + + +GenAudioToTextGenerateResponseResponseBodyUnion = TypeAliasType( + "GenAudioToTextGenerateResponseResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Request Entity Too Large""" @@ -68,7 +93,9 @@ def __str__(self) -> str: ) -GenAudioToTextGenerateResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenAudioToTextGenerateResponseBodyUnion = TypeAliasType( + "GenAudioToTextGenerateResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Unauthorized""" @@ -84,7 +111,9 @@ def __str__(self) -> str: return utils.marshal_json(self.data, GenAudioToTextGenerateResponseBodyUnion) -GenAudioToTextResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenAudioToTextResponseBodyUnion = TypeAliasType( + "GenAudioToTextResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Bad Request""" diff --git a/src/livepeer/models/errors/genimagetoimage.py b/src/livepeer/models/errors/genimagetoimage.py index f32552f..7523ec8 100644 --- a/src/livepeer/models/errors/genimagetoimage.py +++ b/src/livepeer/models/errors/genimagetoimage.py @@ -6,11 +6,13 @@ from .studio_api_error import StudioAPIErrorData from livepeer import utils from typing import Union +from typing_extensions import TypeAliasType -GenImageToImageGenerateResponse500ResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenImageToImageGenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenImageToImageGenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Internal Server Error""" @@ -28,9 +30,10 @@ def __str__(self) -> str: ) -GenImageToImageGenerateResponseResponseBodyUnion = Union[ - HTTPValidationErrorData, StudioAPIErrorData -] +GenImageToImageGenerateResponseResponseBodyUnion = TypeAliasType( + "GenImageToImageGenerateResponseResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) r"""Validation Error""" @@ -48,7 +51,9 @@ def __str__(self) -> str: ) -GenImageToImageGenerateResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenImageToImageGenerateResponseBodyUnion = TypeAliasType( + "GenImageToImageGenerateResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Unauthorized""" @@ -64,7 +69,9 @@ def __str__(self) -> str: return utils.marshal_json(self.data, GenImageToImageGenerateResponseBodyUnion) -GenImageToImageResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenImageToImageResponseBodyUnion = TypeAliasType( + "GenImageToImageResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Bad Request""" diff --git a/src/livepeer/models/errors/genimagetovideo.py b/src/livepeer/models/errors/genimagetovideo.py index b376258..7274c44 100644 --- a/src/livepeer/models/errors/genimagetovideo.py +++ b/src/livepeer/models/errors/genimagetovideo.py @@ -6,11 +6,13 @@ from .studio_api_error import StudioAPIErrorData from livepeer import utils from typing import Union +from typing_extensions import TypeAliasType -GenImageToVideoGenerateResponse500ResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenImageToVideoGenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenImageToVideoGenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Internal Server Error""" @@ -28,9 +30,10 @@ def __str__(self) -> str: ) -GenImageToVideoGenerateResponseResponseBodyUnion = Union[ - HTTPValidationErrorData, StudioAPIErrorData -] +GenImageToVideoGenerateResponseResponseBodyUnion = TypeAliasType( + "GenImageToVideoGenerateResponseResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) r"""Validation Error""" @@ -48,7 +51,9 @@ def __str__(self) -> str: ) -GenImageToVideoGenerateResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenImageToVideoGenerateResponseBodyUnion = TypeAliasType( + "GenImageToVideoGenerateResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Unauthorized""" @@ -64,7 +69,9 @@ def __str__(self) -> str: return utils.marshal_json(self.data, GenImageToVideoGenerateResponseBodyUnion) -GenImageToVideoResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenImageToVideoResponseBodyUnion = TypeAliasType( + "GenImageToVideoResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Bad Request""" diff --git a/src/livepeer/models/errors/genllm.py b/src/livepeer/models/errors/genllm.py new file mode 100644 index 0000000..3296bf2 --- /dev/null +++ b/src/livepeer/models/errors/genllm.py @@ -0,0 +1,83 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .httperror import HTTPErrorData +from .httpvalidationerror import HTTPValidationErrorData +from .studio_api_error import StudioAPIErrorData +from livepeer import utils +from typing import Union +from typing_extensions import TypeAliasType + + +GenLLMGenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenLLMGenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) +r"""Internal Server Error""" + + +class GenLLMGenerateResponse500ResponseBody(Exception): + r"""Internal Server Error""" + + data: GenLLMGenerateResponse500ResponseBodyUnion + + def __init__(self, data: GenLLMGenerateResponse500ResponseBodyUnion): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GenLLMGenerateResponse500ResponseBodyUnion) + + +GenLLMGenerateResponseResponseBodyUnion = TypeAliasType( + "GenLLMGenerateResponseResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) +r"""Validation Error""" + + +class GenLLMGenerateResponseResponseBody(Exception): + r"""Validation Error""" + + data: GenLLMGenerateResponseResponseBodyUnion + + def __init__(self, data: GenLLMGenerateResponseResponseBodyUnion): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GenLLMGenerateResponseResponseBodyUnion) + + +GenLLMGenerateResponseBodyUnion = TypeAliasType( + "GenLLMGenerateResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) +r"""Unauthorized""" + + +class GenLLMGenerateResponseBody(Exception): + r"""Unauthorized""" + + data: GenLLMGenerateResponseBodyUnion + + def __init__(self, data: GenLLMGenerateResponseBodyUnion): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GenLLMGenerateResponseBodyUnion) + + +GenLLMResponseBodyUnion = TypeAliasType( + "GenLLMResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) +r"""Bad Request""" + + +class GenLLMResponseBody(Exception): + r"""Bad Request""" + + data: GenLLMResponseBodyUnion + + def __init__(self, data: GenLLMResponseBodyUnion): + self.data = data + + def __str__(self) -> str: + return utils.marshal_json(self.data, GenLLMResponseBodyUnion) diff --git a/src/livepeer/models/errors/gensegmentanything2.py b/src/livepeer/models/errors/gensegmentanything2.py index b11392b..a42ad7b 100644 --- a/src/livepeer/models/errors/gensegmentanything2.py +++ b/src/livepeer/models/errors/gensegmentanything2.py @@ -6,11 +6,13 @@ from .studio_api_error import StudioAPIErrorData from livepeer import utils from typing import Union +from typing_extensions import TypeAliasType -GenSegmentAnything2GenerateResponse500ResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenSegmentAnything2GenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenSegmentAnything2GenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Internal Server Error""" @@ -28,9 +30,10 @@ def __str__(self) -> str: ) -GenSegmentAnything2GenerateResponseResponseBodyUnion = Union[ - HTTPValidationErrorData, StudioAPIErrorData -] +GenSegmentAnything2GenerateResponseResponseBodyUnion = TypeAliasType( + "GenSegmentAnything2GenerateResponseResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) r"""Validation Error""" @@ -48,7 +51,10 @@ def __str__(self) -> str: ) -GenSegmentAnything2GenerateResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenSegmentAnything2GenerateResponseBodyUnion = TypeAliasType( + "GenSegmentAnything2GenerateResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Unauthorized""" @@ -66,7 +72,9 @@ def __str__(self) -> str: ) -GenSegmentAnything2ResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenSegmentAnything2ResponseBodyUnion = TypeAliasType( + "GenSegmentAnything2ResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Bad Request""" diff --git a/src/livepeer/models/errors/gentexttoimage.py b/src/livepeer/models/errors/gentexttoimage.py index c3d005b..3ce036b 100644 --- a/src/livepeer/models/errors/gentexttoimage.py +++ b/src/livepeer/models/errors/gentexttoimage.py @@ -6,11 +6,13 @@ from .studio_api_error import StudioAPIErrorData from livepeer import utils from typing import Union +from typing_extensions import TypeAliasType -GenTextToImageGenerateResponse500ResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenTextToImageGenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenTextToImageGenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Internal Server Error""" @@ -28,9 +30,10 @@ def __str__(self) -> str: ) -GenTextToImageGenerateResponseResponseBodyUnion = Union[ - HTTPValidationErrorData, StudioAPIErrorData -] +GenTextToImageGenerateResponseResponseBodyUnion = TypeAliasType( + "GenTextToImageGenerateResponseResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) r"""Validation Error""" @@ -48,7 +51,9 @@ def __str__(self) -> str: ) -GenTextToImageGenerateResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenTextToImageGenerateResponseBodyUnion = TypeAliasType( + "GenTextToImageGenerateResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Unauthorized""" @@ -64,7 +69,9 @@ def __str__(self) -> str: return utils.marshal_json(self.data, GenTextToImageGenerateResponseBodyUnion) -GenTextToImageResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenTextToImageResponseBodyUnion = TypeAliasType( + "GenTextToImageResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Bad Request""" diff --git a/src/livepeer/models/errors/genupscale.py b/src/livepeer/models/errors/genupscale.py index 0686b0f..4c09f5c 100644 --- a/src/livepeer/models/errors/genupscale.py +++ b/src/livepeer/models/errors/genupscale.py @@ -6,11 +6,13 @@ from .studio_api_error import StudioAPIErrorData from livepeer import utils from typing import Union +from typing_extensions import TypeAliasType -GenUpscaleGenerateResponse500ResponseBodyUnion = Union[ - HTTPErrorData, StudioAPIErrorData -] +GenUpscaleGenerateResponse500ResponseBodyUnion = TypeAliasType( + "GenUpscaleGenerateResponse500ResponseBodyUnion", + Union[HTTPErrorData, StudioAPIErrorData], +) r"""Internal Server Error""" @@ -28,9 +30,10 @@ def __str__(self) -> str: ) -GenUpscaleGenerateResponseResponseBodyUnion = Union[ - HTTPValidationErrorData, StudioAPIErrorData -] +GenUpscaleGenerateResponseResponseBodyUnion = TypeAliasType( + "GenUpscaleGenerateResponseResponseBodyUnion", + Union[HTTPValidationErrorData, StudioAPIErrorData], +) r"""Validation Error""" @@ -48,7 +51,9 @@ def __str__(self) -> str: ) -GenUpscaleGenerateResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenUpscaleGenerateResponseBodyUnion = TypeAliasType( + "GenUpscaleGenerateResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Unauthorized""" @@ -64,7 +69,9 @@ def __str__(self) -> str: return utils.marshal_json(self.data, GenUpscaleGenerateResponseBodyUnion) -GenUpscaleResponseBodyUnion = Union[HTTPErrorData, StudioAPIErrorData] +GenUpscaleResponseBodyUnion = TypeAliasType( + "GenUpscaleResponseBodyUnion", Union[HTTPErrorData, StudioAPIErrorData] +) r"""Bad Request""" diff --git a/src/livepeer/models/errors/httperror.py b/src/livepeer/models/errors/httperror.py index 4b5b3d4..9e61525 100644 --- a/src/livepeer/models/errors/httperror.py +++ b/src/livepeer/models/errors/httperror.py @@ -20,78 +20,6 @@ class HTTPErrorData(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - http_meta1: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta2: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta3: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta4: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta5: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta6: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta7: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta8: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta9: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta10: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta11: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta12: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta13: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta14: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta15: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta16: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta17: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta18: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - class HTTPError(Exception): r"""HTTP error response model.""" diff --git a/src/livepeer/models/errors/httpvalidationerror.py b/src/livepeer/models/errors/httpvalidationerror.py index 9be3435..941be9f 100644 --- a/src/livepeer/models/errors/httpvalidationerror.py +++ b/src/livepeer/models/errors/httpvalidationerror.py @@ -17,26 +17,6 @@ class HTTPValidationErrorData(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - http_meta1: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta2: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta3: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta4: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta5: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - detail: Optional[List[components_validationerror.ValidationError]] = None diff --git a/src/livepeer/models/errors/studio_api_error.py b/src/livepeer/models/errors/studio_api_error.py index 598efaa..4d47a8f 100644 --- a/src/livepeer/models/errors/studio_api_error.py +++ b/src/livepeer/models/errors/studio_api_error.py @@ -14,108 +14,10 @@ class StudioAPIErrorData(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - http_meta1: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta2: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta3: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta4: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta5: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta6: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta7: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta8: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta9: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta10: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta11: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta12: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta13: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta14: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta15: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta16: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta17: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta18: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta19: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta20: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta21: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta22: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta23: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - - http_meta24: Annotated[ - Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) - ] = None - errors: Optional[List[str]] = None class StudioAPIError(Exception): - r"""Error""" - data: StudioAPIErrorData def __init__(self, data: StudioAPIErrorData): diff --git a/src/livepeer/models/operations/__init__.py b/src/livepeer/models/operations/__init__.py index 6a7c8da..5e5bcf0 100644 --- a/src/livepeer/models/operations/__init__.py +++ b/src/livepeer/models/operations/__init__.py @@ -76,6 +76,7 @@ from .genaudiototext import GenAudioToTextResponse, GenAudioToTextResponseTypedDict from .genimagetoimage import GenImageToImageResponse, GenImageToImageResponseTypedDict from .genimagetovideo import GenImageToVideoResponse, GenImageToVideoResponseTypedDict +from .genllm import GenLLMResponse, GenLLMResponseTypedDict from .gensegmentanything2 import ( GenSegmentAnything2Response, GenSegmentAnything2ResponseTypedDict, @@ -332,6 +333,7 @@ UploadAssetTaskTypedDict, ) + __all__ = [ "AddMultistreamTargetRequest", "AddMultistreamTargetRequestTypedDict", @@ -394,6 +396,8 @@ "GenImageToImageResponseTypedDict", "GenImageToVideoResponse", "GenImageToVideoResponseTypedDict", + "GenLLMResponse", + "GenLLMResponseTypedDict", "GenSegmentAnything2Response", "GenSegmentAnything2ResponseTypedDict", "GenTextToImageResponse", diff --git a/src/livepeer/models/operations/addmultistreamtarget.py b/src/livepeer/models/operations/addmultistreamtarget.py index fc35651..124480e 100644 --- a/src/livepeer/models/operations/addmultistreamtarget.py +++ b/src/livepeer/models/operations/addmultistreamtarget.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, target_add_payload as components_target_add_payload, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class AddMultistreamTargetRequestTypedDict(TypedDict): @@ -33,7 +33,7 @@ class AddMultistreamTargetRequest(BaseModel): class AddMultistreamTargetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -42,5 +42,5 @@ class AddMultistreamTargetResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createclip.py b/src/livepeer/models/operations/createclip.py index 8989800..95ffe2a 100644 --- a/src/livepeer/models/operations/createclip.py +++ b/src/livepeer/models/operations/createclip.py @@ -3,13 +3,13 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateClipTaskTypedDict(TypedDict): @@ -39,7 +39,7 @@ class CreateClipResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[CreateClipDataTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -51,5 +51,5 @@ class CreateClipResponse(BaseModel): data: Optional[CreateClipData] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createmultistreamtarget.py b/src/livepeer/models/operations/createmultistreamtarget.py index 2a0be18..8f8e5f6 100644 --- a/src/livepeer/models/operations/createmultistreamtarget.py +++ b/src/livepeer/models/operations/createmultistreamtarget.py @@ -2,14 +2,14 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, multistream_target as components_multistream_target, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateMultistreamTargetResponseTypedDict(TypedDict): @@ -18,7 +18,7 @@ class CreateMultistreamTargetResponseTypedDict(TypedDict): components_multistream_target.MultistreamTargetTypedDict ] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -30,5 +30,5 @@ class CreateMultistreamTargetResponse(BaseModel): multistream_target: Optional[components_multistream_target.MultistreamTarget] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createroom.py b/src/livepeer/models/operations/createroom.py index 5c7e595..c60619f 100644 --- a/src/livepeer/models/operations/createroom.py +++ b/src/livepeer/models/operations/createroom.py @@ -3,13 +3,13 @@ from __future__ import annotations from livepeer.models.components import ( create_room_response as components_create_room_response, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateRoomResponseTypedDict(TypedDict): @@ -18,7 +18,7 @@ class CreateRoomResponseTypedDict(TypedDict): components_create_room_response.CreateRoomResponseTypedDict ] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -32,5 +32,5 @@ class CreateRoomResponse(BaseModel): ] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createroomuser.py b/src/livepeer/models/operations/createroomuser.py index e38329f..47d151e 100644 --- a/src/livepeer/models/operations/createroomuser.py +++ b/src/livepeer/models/operations/createroomuser.py @@ -2,16 +2,16 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, room_user_payload as components_room_user_payload, room_user_response as components_room_user_response, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateRoomUserRequestTypedDict(TypedDict): @@ -36,7 +36,7 @@ class CreateRoomUserResponseTypedDict(TypedDict): components_room_user_response.RoomUserResponseTypedDict ] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -48,5 +48,5 @@ class CreateRoomUserResponse(BaseModel): room_user_response: Optional[components_room_user_response.RoomUserResponse] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createsigningkey.py b/src/livepeer/models/operations/createsigningkey.py index bee649a..8929cc1 100644 --- a/src/livepeer/models/operations/createsigningkey.py +++ b/src/livepeer/models/operations/createsigningkey.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, signing_key as components_signing_key, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateSigningKeyResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict signing_key: NotRequired[components_signing_key.SigningKeyTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class CreateSigningKeyResponse(BaseModel): signing_key: Optional[components_signing_key.SigningKey] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createstream.py b/src/livepeer/models/operations/createstream.py index 41cf22c..7dcc8b5 100644 --- a/src/livepeer/models/operations/createstream.py +++ b/src/livepeer/models/operations/createstream.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, stream as components_stream, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateStreamResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict stream: NotRequired[components_stream.StreamTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class CreateStreamResponse(BaseModel): stream: Optional[components_stream.Stream] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/createwebhook.py b/src/livepeer/models/operations/createwebhook.py index d6f2586..365506d 100644 --- a/src/livepeer/models/operations/createwebhook.py +++ b/src/livepeer/models/operations/createwebhook.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook as components_webhook, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class CreateWebhookResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict webhook: NotRequired[components_webhook.WebhookTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class CreateWebhookResponse(BaseModel): webhook: Optional[components_webhook.Webhook] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deleteasset.py b/src/livepeer/models/operations/deleteasset.py index c9f2480..f38c7df 100644 --- a/src/livepeer/models/operations/deleteasset.py +++ b/src/livepeer/models/operations/deleteasset.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteAssetRequestTypedDict(TypedDict): @@ -26,7 +28,7 @@ class DeleteAssetRequest(BaseModel): class DeleteAssetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -35,5 +37,5 @@ class DeleteAssetResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deletemultistreamtarget.py b/src/livepeer/models/operations/deletemultistreamtarget.py index 396b3de..0ad9977 100644 --- a/src/livepeer/models/operations/deletemultistreamtarget.py +++ b/src/livepeer/models/operations/deletemultistreamtarget.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteMultistreamTargetRequestTypedDict(TypedDict): @@ -24,7 +26,7 @@ class DeleteMultistreamTargetRequest(BaseModel): class DeleteMultistreamTargetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -33,5 +35,5 @@ class DeleteMultistreamTargetResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deleteroom.py b/src/livepeer/models/operations/deleteroom.py index 1a3134c..525fa07 100644 --- a/src/livepeer/models/operations/deleteroom.py +++ b/src/livepeer/models/operations/deleteroom.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteRoomRequestTypedDict(TypedDict): @@ -22,7 +24,7 @@ class DeleteRoomRequest(BaseModel): class DeleteRoomResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -31,5 +33,5 @@ class DeleteRoomResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deleteroomuser.py b/src/livepeer/models/operations/deleteroomuser.py index 47ddd58..e181942 100644 --- a/src/livepeer/models/operations/deleteroomuser.py +++ b/src/livepeer/models/operations/deleteroomuser.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteRoomUserRequestTypedDict(TypedDict): @@ -29,7 +31,7 @@ class DeleteRoomUserRequest(BaseModel): class DeleteRoomUserResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -38,5 +40,5 @@ class DeleteRoomUserResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deletesigningkey.py b/src/livepeer/models/operations/deletesigningkey.py index d64fb3c..25aa7cf 100644 --- a/src/livepeer/models/operations/deletesigningkey.py +++ b/src/livepeer/models/operations/deletesigningkey.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteSigningKeyRequestTypedDict(TypedDict): @@ -26,7 +28,7 @@ class DeleteSigningKeyRequest(BaseModel): class DeleteSigningKeyResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -35,5 +37,5 @@ class DeleteSigningKeyResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deletestream.py b/src/livepeer/models/operations/deletestream.py index fab2c83..cdfa5de 100644 --- a/src/livepeer/models/operations/deletestream.py +++ b/src/livepeer/models/operations/deletestream.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteStreamRequestTypedDict(TypedDict): @@ -24,7 +26,7 @@ class DeleteStreamRequest(BaseModel): class DeleteStreamResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -33,5 +35,5 @@ class DeleteStreamResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/deletewebhook.py b/src/livepeer/models/operations/deletewebhook.py index fba91e2..aadfc0d 100644 --- a/src/livepeer/models/operations/deletewebhook.py +++ b/src/livepeer/models/operations/deletewebhook.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook as components_webhook, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class DeleteWebhookRequestTypedDict(TypedDict): @@ -27,7 +27,7 @@ class DeleteWebhookResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict webhook: NotRequired[components_webhook.WebhookTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -39,5 +39,5 @@ class DeleteWebhookResponse(BaseModel): webhook: Optional[components_webhook.Webhook] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/genaudiototext.py b/src/livepeer/models/operations/genaudiototext.py index 8fbeab6..e339a3e 100644 --- a/src/livepeer/models/operations/genaudiototext.py +++ b/src/livepeer/models/operations/genaudiototext.py @@ -8,8 +8,8 @@ from livepeer.models.errors import studio_api_error as errors_studio_api_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GenAudioToTextResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/operations/genimagetoimage.py b/src/livepeer/models/operations/genimagetoimage.py index b70cc0e..c7edba5 100644 --- a/src/livepeer/models/operations/genimagetoimage.py +++ b/src/livepeer/models/operations/genimagetoimage.py @@ -8,8 +8,8 @@ from livepeer.models.errors import studio_api_error as errors_studio_api_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GenImageToImageResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/operations/genimagetovideo.py b/src/livepeer/models/operations/genimagetovideo.py index 7b3e8bd..2fb809f 100644 --- a/src/livepeer/models/operations/genimagetovideo.py +++ b/src/livepeer/models/operations/genimagetovideo.py @@ -8,8 +8,8 @@ from livepeer.models.errors import studio_api_error as errors_studio_api_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GenImageToVideoResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/operations/genllm.py b/src/livepeer/models/operations/genllm.py new file mode 100644 index 0000000..8e84dd0 --- /dev/null +++ b/src/livepeer/models/operations/genllm.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from livepeer.models.components import ( + httpmetadata as components_httpmetadata, + llmresponse as components_llmresponse, +) +from livepeer.models.errors import studio_api_error as errors_studio_api_error +from livepeer.types import BaseModel +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GenLLMResponseTypedDict(TypedDict): + http_meta: components_httpmetadata.HTTPMetadataTypedDict + llm_response: NotRequired[components_llmresponse.LLMResponseTypedDict] + r"""Successful Response""" + studio_api_error: NotRequired[errors_studio_api_error.StudioAPIError] + r"""Error""" + + +class GenLLMResponse(BaseModel): + http_meta: Annotated[ + Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) + ] = None + + llm_response: Optional[components_llmresponse.LLMResponse] = None + r"""Successful Response""" + + studio_api_error: Optional[errors_studio_api_error.StudioAPIError] = None + r"""Error""" diff --git a/src/livepeer/models/operations/gensegmentanything2.py b/src/livepeer/models/operations/gensegmentanything2.py index d2eb36d..6770784 100644 --- a/src/livepeer/models/operations/gensegmentanything2.py +++ b/src/livepeer/models/operations/gensegmentanything2.py @@ -8,8 +8,8 @@ from livepeer.models.errors import studio_api_error as errors_studio_api_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GenSegmentAnything2ResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/operations/gentexttoimage.py b/src/livepeer/models/operations/gentexttoimage.py index a9d3376..a5b1ae2 100644 --- a/src/livepeer/models/operations/gentexttoimage.py +++ b/src/livepeer/models/operations/gentexttoimage.py @@ -4,19 +4,19 @@ from livepeer.models.components import ( httpmetadata as components_httpmetadata, imageresponse as components_imageresponse, + studio_api_error as components_studio_api_error, ) -from livepeer.models.errors import studio_api_error as errors_studio_api_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GenTextToImageResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict image_response: NotRequired[components_imageresponse.ImageResponseTypedDict] r"""Successful Response""" - studio_api_error: NotRequired[errors_studio_api_error.StudioAPIError] + studio_api_error: NotRequired[components_studio_api_error.StudioAPIErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GenTextToImageResponse(BaseModel): image_response: Optional[components_imageresponse.ImageResponse] = None r"""Successful Response""" - studio_api_error: Optional[errors_studio_api_error.StudioAPIError] = None + studio_api_error: Optional[components_studio_api_error.StudioAPIError] = None r"""Error""" diff --git a/src/livepeer/models/operations/genupscale.py b/src/livepeer/models/operations/genupscale.py index 30252fd..2a68722 100644 --- a/src/livepeer/models/operations/genupscale.py +++ b/src/livepeer/models/operations/genupscale.py @@ -8,8 +8,8 @@ from livepeer.models.errors import studio_api_error as errors_studio_api_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GenUpscaleResponseTypedDict(TypedDict): diff --git a/src/livepeer/models/operations/getasset.py b/src/livepeer/models/operations/getasset.py index dcdedc7..28e3caa 100644 --- a/src/livepeer/models/operations/getasset.py +++ b/src/livepeer/models/operations/getasset.py @@ -3,14 +3,14 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetAssetRequestTypedDict(TypedDict): @@ -31,7 +31,7 @@ class GetAssetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict asset: NotRequired[components_asset.AssetTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -43,5 +43,5 @@ class GetAssetResponse(BaseModel): asset: Optional[components_asset.Asset] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getassets.py b/src/livepeer/models/operations/getassets.py index ce9be55..9f2a63b 100644 --- a/src/livepeer/models/operations/getassets.py +++ b/src/livepeer/models/operations/getassets.py @@ -3,20 +3,20 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetAssetsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_asset.AssetTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GetAssetsResponse(BaseModel): data: Optional[List[components_asset.Asset]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getclips.py b/src/livepeer/models/operations/getclips.py index cbeb34f..00697c0 100644 --- a/src/livepeer/models/operations/getclips.py +++ b/src/livepeer/models/operations/getclips.py @@ -3,14 +3,14 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetClipsRequestTypedDict(TypedDict): @@ -29,7 +29,7 @@ class GetClipsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_asset.AssetTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -41,5 +41,5 @@ class GetClipsResponse(BaseModel): data: Optional[List[components_asset.Asset]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getcreatorviewershipmetrics.py b/src/livepeer/models/operations/getcreatorviewershipmetrics.py index 4900288..a2d24db 100644 --- a/src/livepeer/models/operations/getcreatorviewershipmetrics.py +++ b/src/livepeer/models/operations/getcreatorviewershipmetrics.py @@ -4,30 +4,30 @@ from datetime import datetime from enum import Enum from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, viewership_metric as components_viewership_metric, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, QueryParamMetadata import pydantic -from typing import List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -QueryParamFromTypedDict = Union[datetime, int] +QueryParamFromTypedDict = TypeAliasType("QueryParamFromTypedDict", Union[datetime, int]) r"""Start timestamp for the query range (inclusive)""" -QueryParamFrom = Union[datetime, int] +QueryParamFrom = TypeAliasType("QueryParamFrom", Union[datetime, int]) r"""Start timestamp for the query range (inclusive)""" -QueryParamToTypedDict = Union[datetime, int] +QueryParamToTypedDict = TypeAliasType("QueryParamToTypedDict", Union[datetime, int]) r"""End timestamp for the query range (exclusive)""" -QueryParamTo = Union[datetime, int] +QueryParamTo = TypeAliasType("QueryParamTo", Union[datetime, int]) r"""End timestamp for the query range (exclusive)""" @@ -132,7 +132,7 @@ class GetCreatorViewershipMetricsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_viewership_metric.ViewershipMetricTypedDict]] r"""A list of Metric objects""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -144,5 +144,5 @@ class GetCreatorViewershipMetricsResponse(BaseModel): data: Optional[List[components_viewership_metric.ViewershipMetric]] = None r"""A list of Metric objects""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getmultistreamtarget.py b/src/livepeer/models/operations/getmultistreamtarget.py index 4e09a82..759b56f 100644 --- a/src/livepeer/models/operations/getmultistreamtarget.py +++ b/src/livepeer/models/operations/getmultistreamtarget.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, multistream_target as components_multistream_target, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetMultistreamTargetRequestTypedDict(TypedDict): @@ -31,7 +31,7 @@ class GetMultistreamTargetResponseTypedDict(TypedDict): components_multistream_target.MultistreamTargetTypedDict ] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -43,5 +43,5 @@ class GetMultistreamTargetResponse(BaseModel): multistream_target: Optional[components_multistream_target.MultistreamTarget] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getmultistreamtargets.py b/src/livepeer/models/operations/getmultistreamtargets.py index 6686848..353a40a 100644 --- a/src/livepeer/models/operations/getmultistreamtargets.py +++ b/src/livepeer/models/operations/getmultistreamtargets.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, multistream_target as components_multistream_target, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetMultistreamTargetsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_multistream_target.MultistreamTargetTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GetMultistreamTargetsResponse(BaseModel): data: Optional[List[components_multistream_target.MultistreamTarget]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getplaybackinfo.py b/src/livepeer/models/operations/getplaybackinfo.py index 357ce8b..967af0d 100644 --- a/src/livepeer/models/operations/getplaybackinfo.py +++ b/src/livepeer/models/operations/getplaybackinfo.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, playback_info as components_playback_info, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetPlaybackInfoRequestTypedDict(TypedDict): @@ -29,7 +29,7 @@ class GetPlaybackInfoResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict playback_info: NotRequired[components_playback_info.PlaybackInfoTypedDict] r"""Successful response""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Playback not found""" @@ -41,5 +41,5 @@ class GetPlaybackInfoResponse(BaseModel): playback_info: Optional[components_playback_info.PlaybackInfo] = None r"""Successful response""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Playback not found""" diff --git a/src/livepeer/models/operations/getpublicviewershipmetrics.py b/src/livepeer/models/operations/getpublicviewershipmetrics.py index fbd3975..e076a13 100644 --- a/src/livepeer/models/operations/getpublicviewershipmetrics.py +++ b/src/livepeer/models/operations/getpublicviewershipmetrics.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetPublicViewershipMetricsRequestTypedDict(TypedDict): @@ -73,7 +75,7 @@ class GetPublicViewershipMetricsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[GetPublicViewershipMetricsDataTypedDict] r"""A single Metric object with the viewCount and playtimeMins metrics.""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -85,5 +87,5 @@ class GetPublicViewershipMetricsResponse(BaseModel): data: Optional[GetPublicViewershipMetricsData] = None r"""A single Metric object with the viewCount and playtimeMins metrics.""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getrealtimeviewershipnow.py b/src/livepeer/models/operations/getrealtimeviewershipnow.py index 939d9cd..1c160b7 100644 --- a/src/livepeer/models/operations/getrealtimeviewershipnow.py +++ b/src/livepeer/models/operations/getrealtimeviewershipnow.py @@ -3,15 +3,15 @@ from __future__ import annotations from enum import Enum from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, realtime_viewership_metric as components_realtime_viewership_metric, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, QueryParamMetadata import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class BreakdownBy(str, Enum): @@ -73,7 +73,7 @@ class GetRealtimeViewershipNowResponseTypedDict(TypedDict): List[components_realtime_viewership_metric.RealtimeViewershipMetricTypedDict] ] r"""A list of Metric objects""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -87,5 +87,5 @@ class GetRealtimeViewershipNowResponse(BaseModel): ] = None r"""A list of Metric objects""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getrecordedsessions.py b/src/livepeer/models/operations/getrecordedsessions.py index 039433d..a70f355 100644 --- a/src/livepeer/models/operations/getrecordedsessions.py +++ b/src/livepeer/models/operations/getrecordedsessions.py @@ -2,25 +2,25 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, session as components_session, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata import pydantic -from typing import List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -RecordTypedDict = Union[bool, int] +RecordTypedDict = TypeAliasType("RecordTypedDict", Union[bool, int]) r"""Flag indicating if the response should only include recorded sessions """ -Record = Union[bool, int] +Record = TypeAliasType("Record", Union[bool, int]) r"""Flag indicating if the response should only include recorded sessions @@ -59,7 +59,7 @@ class GetRecordedSessionsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_session.SessionTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -71,5 +71,5 @@ class GetRecordedSessionsResponse(BaseModel): data: Optional[List[components_session.Session]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getroom.py b/src/livepeer/models/operations/getroom.py index d96d5e1..f961f97 100644 --- a/src/livepeer/models/operations/getroom.py +++ b/src/livepeer/models/operations/getroom.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, room as components_room, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetRoomRequestTypedDict(TypedDict): @@ -27,7 +27,7 @@ class GetRoomResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict room: NotRequired[components_room.RoomTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -39,5 +39,5 @@ class GetRoomResponse(BaseModel): room: Optional[components_room.Room] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getroomuser.py b/src/livepeer/models/operations/getroomuser.py index b558577..047ac0a 100644 --- a/src/livepeer/models/operations/getroomuser.py +++ b/src/livepeer/models/operations/getroomuser.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, get_room_user_response as components_get_room_user_response, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetRoomUserRequestTypedDict(TypedDict): @@ -36,7 +36,7 @@ class GetRoomUserResponseTypedDict(TypedDict): components_get_room_user_response.GetRoomUserResponseTypedDict ] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -50,5 +50,5 @@ class GetRoomUserResponse(BaseModel): ] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getsession.py b/src/livepeer/models/operations/getsession.py index 0c51649..a7256dd 100644 --- a/src/livepeer/models/operations/getsession.py +++ b/src/livepeer/models/operations/getsession.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, session as components_session, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetSessionRequestTypedDict(TypedDict): @@ -29,7 +29,7 @@ class GetSessionResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict session: NotRequired[components_session.SessionTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -41,5 +41,5 @@ class GetSessionResponse(BaseModel): session: Optional[components_session.Session] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getsessionclips.py b/src/livepeer/models/operations/getsessionclips.py index 679032d..576c51b 100644 --- a/src/livepeer/models/operations/getsessionclips.py +++ b/src/livepeer/models/operations/getsessionclips.py @@ -3,14 +3,14 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetSessionClipsRequestTypedDict(TypedDict): @@ -29,7 +29,7 @@ class GetSessionClipsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_asset.AssetTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -41,5 +41,5 @@ class GetSessionClipsResponse(BaseModel): data: Optional[List[components_asset.Asset]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getsessions.py b/src/livepeer/models/operations/getsessions.py index 43f0dca..cb9d351 100644 --- a/src/livepeer/models/operations/getsessions.py +++ b/src/livepeer/models/operations/getsessions.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, session as components_session, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetSessionsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_session.SessionTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GetSessionsResponse(BaseModel): data: Optional[List[components_session.Session]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getsigningkey.py b/src/livepeer/models/operations/getsigningkey.py index ae6fbc7..f256530 100644 --- a/src/livepeer/models/operations/getsigningkey.py +++ b/src/livepeer/models/operations/getsigningkey.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, signing_key as components_signing_key, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetSigningKeyRequestTypedDict(TypedDict): @@ -31,7 +31,7 @@ class GetSigningKeyResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict signing_key: NotRequired[components_signing_key.SigningKeyTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -43,5 +43,5 @@ class GetSigningKeyResponse(BaseModel): signing_key: Optional[components_signing_key.SigningKey] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getsigningkeys.py b/src/livepeer/models/operations/getsigningkeys.py index f1de1b1..d48bdaa 100644 --- a/src/livepeer/models/operations/getsigningkeys.py +++ b/src/livepeer/models/operations/getsigningkeys.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, signing_key as components_signing_key, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetSigningKeysResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_signing_key.SigningKeyTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GetSigningKeysResponse(BaseModel): data: Optional[List[components_signing_key.SigningKey]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getstream.py b/src/livepeer/models/operations/getstream.py index 4c54047..9cd55cf 100644 --- a/src/livepeer/models/operations/getstream.py +++ b/src/livepeer/models/operations/getstream.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, stream as components_stream, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetStreamRequestTypedDict(TypedDict): @@ -29,7 +29,7 @@ class GetStreamResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict stream: NotRequired[components_stream.StreamTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -41,5 +41,5 @@ class GetStreamResponse(BaseModel): stream: Optional[components_stream.Stream] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getstreams.py b/src/livepeer/models/operations/getstreams.py index cc811f8..05ba3a3 100644 --- a/src/livepeer/models/operations/getstreams.py +++ b/src/livepeer/models/operations/getstreams.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, stream as components_stream, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, QueryParamMetadata import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetStreamsRequestTypedDict(TypedDict): @@ -28,7 +28,7 @@ class GetStreamsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_stream.StreamTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -40,5 +40,5 @@ class GetStreamsResponse(BaseModel): data: Optional[List[components_stream.Stream]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/gettask.py b/src/livepeer/models/operations/gettask.py index 22ce115..d518f37 100644 --- a/src/livepeer/models/operations/gettask.py +++ b/src/livepeer/models/operations/gettask.py @@ -8,8 +8,8 @@ from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetTaskRequestTypedDict(TypedDict): diff --git a/src/livepeer/models/operations/gettasks.py b/src/livepeer/models/operations/gettasks.py index 61de40e..183ba9f 100644 --- a/src/livepeer/models/operations/gettasks.py +++ b/src/livepeer/models/operations/gettasks.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, task as components_task, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetTasksResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_task.TaskTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GetTasksResponse(BaseModel): data: Optional[List[components_task.Task]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getusagemetrics.py b/src/livepeer/models/operations/getusagemetrics.py index 9b7476d..4cf5b98 100644 --- a/src/livepeer/models/operations/getusagemetrics.py +++ b/src/livepeer/models/operations/getusagemetrics.py @@ -3,15 +3,15 @@ from __future__ import annotations from enum import Enum from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, usage_metric as components_usage_metric, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, QueryParamMetadata import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetUsageMetricsQueryParamTimeStep(str, Enum): @@ -100,7 +100,7 @@ class GetUsageMetricsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict usage_metric: NotRequired[components_usage_metric.UsageMetricTypedDict] r"""A Usage Metric object""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -112,5 +112,5 @@ class GetUsageMetricsResponse(BaseModel): usage_metric: Optional[components_usage_metric.UsageMetric] = None r"""A Usage Metric object""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getviewershipmetrics.py b/src/livepeer/models/operations/getviewershipmetrics.py index 1aeb84f..3571b92 100644 --- a/src/livepeer/models/operations/getviewershipmetrics.py +++ b/src/livepeer/models/operations/getviewershipmetrics.py @@ -4,30 +4,30 @@ from datetime import datetime from enum import Enum from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, viewership_metric as components_viewership_metric, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, QueryParamMetadata import pydantic -from typing import List, Optional, TypedDict, Union -from typing_extensions import Annotated, NotRequired +from typing import List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict -FromTypedDict = Union[datetime, int] +FromTypedDict = TypeAliasType("FromTypedDict", Union[datetime, int]) r"""Start timestamp for the query range (inclusive)""" -From = Union[datetime, int] +From = TypeAliasType("From", Union[datetime, int]) r"""Start timestamp for the query range (inclusive)""" -ToTypedDict = Union[datetime, int] +ToTypedDict = TypeAliasType("ToTypedDict", Union[datetime, int]) r"""End timestamp for the query range (exclusive)""" -To = Union[datetime, int] +To = TypeAliasType("To", Union[datetime, int]) r"""End timestamp for the query range (exclusive)""" @@ -152,7 +152,7 @@ class GetViewershipMetricsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_viewership_metric.ViewershipMetricTypedDict]] r"""A list of Metric objects""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -164,5 +164,5 @@ class GetViewershipMetricsResponse(BaseModel): data: Optional[List[components_viewership_metric.ViewershipMetric]] = None r"""A list of Metric objects""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getwebhook.py b/src/livepeer/models/operations/getwebhook.py index cca629d..8e263f5 100644 --- a/src/livepeer/models/operations/getwebhook.py +++ b/src/livepeer/models/operations/getwebhook.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook as components_webhook, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetWebhookRequestTypedDict(TypedDict): @@ -27,7 +27,7 @@ class GetWebhookResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict webhook: NotRequired[components_webhook.WebhookTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -39,5 +39,5 @@ class GetWebhookResponse(BaseModel): webhook: Optional[components_webhook.Webhook] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getwebhooklog.py b/src/livepeer/models/operations/getwebhooklog.py index 958866c..f83923d 100644 --- a/src/livepeer/models/operations/getwebhooklog.py +++ b/src/livepeer/models/operations/getwebhooklog.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook_log as components_webhook_log, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetWebhookLogRequestTypedDict(TypedDict): @@ -34,7 +34,7 @@ class GetWebhookLogResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict webhook_log: NotRequired[components_webhook_log.WebhookLogTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -46,5 +46,5 @@ class GetWebhookLogResponse(BaseModel): webhook_log: Optional[components_webhook_log.WebhookLog] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getwebhooklogs.py b/src/livepeer/models/operations/getwebhooklogs.py index d1bd080..3e4ee21 100644 --- a/src/livepeer/models/operations/getwebhooklogs.py +++ b/src/livepeer/models/operations/getwebhooklogs.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook_log as components_webhook_log, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetWebhookLogsRequestTypedDict(TypedDict): @@ -27,7 +27,7 @@ class GetWebhookLogsResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_webhook_log.WebhookLogTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -39,5 +39,5 @@ class GetWebhookLogsResponse(BaseModel): data: Optional[List[components_webhook_log.WebhookLog]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/getwebhooks.py b/src/livepeer/models/operations/getwebhooks.py index c321324..c2d7707 100644 --- a/src/livepeer/models/operations/getwebhooks.py +++ b/src/livepeer/models/operations/getwebhooks.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook as components_webhook, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import List, Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import List, Optional +from typing_extensions import Annotated, NotRequired, TypedDict class GetWebhooksResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[List[components_webhook.WebhookTypedDict]] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class GetWebhooksResponse(BaseModel): data: Optional[List[components_webhook.Webhook]] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/removemultistreamtarget.py b/src/livepeer/models/operations/removemultistreamtarget.py index 485af16..a4d0ed4 100644 --- a/src/livepeer/models/operations/removemultistreamtarget.py +++ b/src/livepeer/models/operations/removemultistreamtarget.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class RemoveMultistreamTargetRequestTypedDict(TypedDict): @@ -33,7 +35,7 @@ class RemoveMultistreamTargetRequest(BaseModel): class RemoveMultistreamTargetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -42,5 +44,5 @@ class RemoveMultistreamTargetResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/requestupload.py b/src/livepeer/models/operations/requestupload.py index 25ee9ba..69267c8 100644 --- a/src/livepeer/models/operations/requestupload.py +++ b/src/livepeer/models/operations/requestupload.py @@ -3,13 +3,13 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TaskTypedDict(TypedDict): @@ -49,7 +49,7 @@ class RequestUploadResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict data: NotRequired[RequestUploadDataTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -61,5 +61,5 @@ class RequestUploadResponse(BaseModel): data: Optional[RequestUploadData] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/resendwebhook.py b/src/livepeer/models/operations/resendwebhook.py index 4cd4e91..d3d4e9a 100644 --- a/src/livepeer/models/operations/resendwebhook.py +++ b/src/livepeer/models/operations/resendwebhook.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook_log as components_webhook_log, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class ResendWebhookRequestTypedDict(TypedDict): @@ -34,7 +34,7 @@ class ResendWebhookResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict webhook_log: NotRequired[components_webhook_log.WebhookLogTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -46,5 +46,5 @@ class ResendWebhookResponse(BaseModel): webhook_log: Optional[components_webhook_log.WebhookLog] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/startpullstream.py b/src/livepeer/models/operations/startpullstream.py index 530ba72..6f4d4ab 100644 --- a/src/livepeer/models/operations/startpullstream.py +++ b/src/livepeer/models/operations/startpullstream.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class StartPullStreamRequestTypedDict(TypedDict): @@ -24,7 +26,7 @@ class StartPullStreamRequest(BaseModel): class StartPullStreamResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -33,5 +35,5 @@ class StartPullStreamResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/startroomegress.py b/src/livepeer/models/operations/startroomegress.py index b8540a4..b93c7a9 100644 --- a/src/livepeer/models/operations/startroomegress.py +++ b/src/livepeer/models/operations/startroomegress.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, room_egress_payload as components_room_egress_payload, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class StartRoomEgressRequestTypedDict(TypedDict): @@ -31,7 +31,7 @@ class StartRoomEgressRequest(BaseModel): class StartRoomEgressResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -40,5 +40,5 @@ class StartRoomEgressResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/stoproomegress.py b/src/livepeer/models/operations/stoproomegress.py index cb25bc1..c7f492c 100644 --- a/src/livepeer/models/operations/stoproomegress.py +++ b/src/livepeer/models/operations/stoproomegress.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class StopRoomEgressRequestTypedDict(TypedDict): @@ -22,7 +24,7 @@ class StopRoomEgressRequest(BaseModel): class StopRoomEgressResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -31,5 +33,5 @@ class StopRoomEgressResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/terminatestream.py b/src/livepeer/models/operations/terminatestream.py index b64897e..25c65fb 100644 --- a/src/livepeer/models/operations/terminatestream.py +++ b/src/livepeer/models/operations/terminatestream.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TerminateStreamRequestTypedDict(TypedDict): @@ -24,7 +26,7 @@ class TerminateStreamRequest(BaseModel): class TerminateStreamResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -33,5 +35,5 @@ class TerminateStreamResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/transcodevideo.py b/src/livepeer/models/operations/transcodevideo.py index 12cb79f..83ff50c 100644 --- a/src/livepeer/models/operations/transcodevideo.py +++ b/src/livepeer/models/operations/transcodevideo.py @@ -2,21 +2,21 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, task as components_task, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class TranscodeVideoResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict task: NotRequired[components_task.TaskTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -28,5 +28,5 @@ class TranscodeVideoResponse(BaseModel): task: Optional[components_task.Task] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/updateasset.py b/src/livepeer/models/operations/updateasset.py index bd781e7..98e5459 100644 --- a/src/livepeer/models/operations/updateasset.py +++ b/src/livepeer/models/operations/updateasset.py @@ -4,14 +4,14 @@ from livepeer.models.components import ( asset as components_asset, asset_patch_payload as components_asset_patch_payload, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UpdateAssetRequestTypedDict(TypedDict): @@ -38,7 +38,7 @@ class UpdateAssetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict asset: NotRequired[components_asset.AssetTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -50,5 +50,5 @@ class UpdateAssetResponse(BaseModel): asset: Optional[components_asset.Asset] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/updatemultistreamtarget.py b/src/livepeer/models/operations/updatemultistreamtarget.py index f10ce78..7a71f1a 100644 --- a/src/livepeer/models/operations/updatemultistreamtarget.py +++ b/src/livepeer/models/operations/updatemultistreamtarget.py @@ -2,21 +2,23 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, - multistream_target_patch_payload as components_multistream_target_patch_payload, + multistream_target_input as components_multistream_target_input, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UpdateMultistreamTargetRequestTypedDict(TypedDict): id: str r"""ID of the multistream target""" - multistream_target_patch_payload: components_multistream_target_patch_payload.MultistreamTargetPatchPayloadTypedDict + multistream_target: ( + components_multistream_target_input.MultistreamTargetInputTypedDict + ) class UpdateMultistreamTargetRequest(BaseModel): @@ -25,15 +27,15 @@ class UpdateMultistreamTargetRequest(BaseModel): ] r"""ID of the multistream target""" - multistream_target_patch_payload: Annotated[ - components_multistream_target_patch_payload.MultistreamTargetPatchPayload, + multistream_target: Annotated[ + components_multistream_target_input.MultistreamTargetInput, FieldMetadata(request=RequestMetadata(media_type="application/json")), ] class UpdateMultistreamTargetResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -42,5 +44,5 @@ class UpdateMultistreamTargetResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/updateroomuser.py b/src/livepeer/models/operations/updateroomuser.py index 10de7d6..0492614 100644 --- a/src/livepeer/models/operations/updateroomuser.py +++ b/src/livepeer/models/operations/updateroomuser.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, room_user_update_payload as components_room_user_update_payload, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UpdateRoomUserRequestTypedDict(TypedDict): @@ -40,7 +40,7 @@ class UpdateRoomUserRequest(BaseModel): class UpdateRoomUserResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -49,5 +49,5 @@ class UpdateRoomUserResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/updatesigningkey.py b/src/livepeer/models/operations/updatesigningkey.py index 542019a..ebec5eb 100644 --- a/src/livepeer/models/operations/updatesigningkey.py +++ b/src/livepeer/models/operations/updatesigningkey.py @@ -1,13 +1,15 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from __future__ import annotations -from livepeer.models.components import httpmetadata as components_httpmetadata -from livepeer.models.errors import error as errors_error +from livepeer.models.components import ( + error as components_error, + httpmetadata as components_httpmetadata, +) from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UpdateSigningKeyRequestBodyTypedDict(TypedDict): @@ -43,7 +45,7 @@ class UpdateSigningKeyRequest(BaseModel): class UpdateSigningKeyResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -52,5 +54,5 @@ class UpdateSigningKeyResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/updatestream.py b/src/livepeer/models/operations/updatestream.py index cedfc9a..3489152 100644 --- a/src/livepeer/models/operations/updatestream.py +++ b/src/livepeer/models/operations/updatestream.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, stream_patch_payload as components_stream_patch_payload, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UpdateStreamRequestTypedDict(TypedDict): @@ -33,7 +33,7 @@ class UpdateStreamRequest(BaseModel): class UpdateStreamResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -42,5 +42,5 @@ class UpdateStreamResponse(BaseModel): Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True) ] = None - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/updatewebhook.py b/src/livepeer/models/operations/updatewebhook.py index 057f4d8..5828267 100644 --- a/src/livepeer/models/operations/updatewebhook.py +++ b/src/livepeer/models/operations/updatewebhook.py @@ -2,15 +2,15 @@ from __future__ import annotations from livepeer.models.components import ( + error as components_error, httpmetadata as components_httpmetadata, webhook as components_webhook, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel from livepeer.utils import FieldMetadata, PathParamMetadata, RequestMetadata import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UpdateWebhookRequestTypedDict(TypedDict): @@ -33,7 +33,7 @@ class UpdateWebhookResponseTypedDict(TypedDict): http_meta: components_httpmetadata.HTTPMetadataTypedDict webhook: NotRequired[components_webhook.WebhookTypedDict] r"""Success""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -45,5 +45,5 @@ class UpdateWebhookResponse(BaseModel): webhook: Optional[components_webhook.Webhook] = None r"""Success""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/models/operations/uploadasset.py b/src/livepeer/models/operations/uploadasset.py index f2ce95d..b2f5211 100644 --- a/src/livepeer/models/operations/uploadasset.py +++ b/src/livepeer/models/operations/uploadasset.py @@ -3,13 +3,13 @@ from __future__ import annotations from livepeer.models.components import ( asset as components_asset, + error as components_error, httpmetadata as components_httpmetadata, ) -from livepeer.models.errors import error as errors_error from livepeer.types import BaseModel import pydantic -from typing import Optional, TypedDict -from typing_extensions import Annotated, NotRequired +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict class UploadAssetAssetTaskTypedDict(TypedDict): @@ -66,7 +66,7 @@ class UploadAssetResponseTypedDict(TypedDict): UploadAssetDataOutputTypedDict ] r"""Upload started""" - error: NotRequired[errors_error.Error] + error: NotRequired[components_error.ErrorTypedDict] r"""Error""" @@ -81,5 +81,5 @@ class UploadAssetResponse(BaseModel): two_hundred_and_one_application_json_data: Optional[UploadAssetDataOutput] = None r"""Upload started""" - error: Optional[errors_error.Error] = None + error: Optional[components_error.Error] = None r"""Error""" diff --git a/src/livepeer/multistream.py b/src/livepeer/multistream.py index 0a14f06..9e2a136 100644 --- a/src/livepeer/multistream.py +++ b/src/livepeer/multistream.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import List, Optional, Union, cast +from typing import List, Mapping, Optional, Union, cast class Multistream(BaseSDK): @@ -17,12 +17,14 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetMultistreamTargetsResponse: r"""Retrieve Multistream Targets :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -31,7 +33,9 @@ def get_all( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="GET", path="/multistream/target", base_url=base_url, @@ -42,6 +46,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -56,6 +61,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getMultistreamTargets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -72,21 +78,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetMultistreamTargetsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -96,12 +109,14 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetMultistreamTargetsResponse: r"""Retrieve Multistream Targets :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -110,7 +125,9 @@ async def get_all_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="GET", path="/multistream/target", base_url=base_url, @@ -121,6 +138,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -135,6 +153,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getMultistreamTargets", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -151,21 +170,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetMultistreamTargetsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -179,6 +205,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateMultistreamTargetResponse: r"""Create a multistream target @@ -186,6 +213,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -194,12 +222,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.MultistreamTargetInput) request = cast(components.MultistreamTargetInput, request) - req = self.build_request( + req = self._build_request( method="POST", path="/multistream/target", base_url=base_url, @@ -210,6 +240,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.MultistreamTargetInput @@ -227,6 +258,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -243,21 +275,28 @@ def create( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -271,6 +310,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateMultistreamTargetResponse: r"""Create a multistream target @@ -278,6 +318,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -286,12 +327,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.MultistreamTargetInput) request = cast(components.MultistreamTargetInput, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/multistream/target", base_url=base_url, @@ -302,6 +345,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.MultistreamTargetInput @@ -319,6 +363,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -335,21 +380,28 @@ async def create_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -360,6 +412,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetMultistreamTargetResponse: r"""Retrieve a multistream target @@ -367,6 +420,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -375,12 +429,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetMultistreamTargetRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/multistream/target/{id}", base_url=base_url, @@ -391,6 +447,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -405,6 +462,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -421,21 +479,28 @@ def get( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -446,6 +511,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetMultistreamTargetResponse: r"""Retrieve a multistream target @@ -453,6 +519,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -461,12 +528,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetMultistreamTargetRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/multistream/target/{id}", base_url=base_url, @@ -477,6 +546,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -491,6 +561,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -507,21 +578,28 @@ async def get_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -529,21 +607,23 @@ def update( self, *, id: str, - multistream_target_patch_payload: Union[ - components.MultistreamTargetPatchPayload, - components.MultistreamTargetPatchPayloadTypedDict, + multistream_target: Union[ + components.MultistreamTargetInput, + components.MultistreamTargetInputTypedDict, ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateMultistreamTargetResponse: r"""Update Multistream Target :param id: ID of the multistream target - :param multistream_target_patch_payload: + :param multistream_target: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -552,16 +632,17 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateMultistreamTargetRequest( id=id, - multistream_target_patch_payload=utils.get_pydantic_model( - multistream_target_patch_payload, - components.MultistreamTargetPatchPayload, + multistream_target=utils.get_pydantic_model( + multistream_target, components.MultistreamTargetInput ), ) - req = self.build_request( + req = self._build_request( method="PATCH", path="/multistream/target/{id}", base_url=base_url, @@ -572,13 +653,14 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.multistream_target_patch_payload, + request.multistream_target, False, False, "json", - components.MultistreamTargetPatchPayload, + components.MultistreamTargetInput, ), timeout_ms=timeout_ms, ) @@ -593,6 +675,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -606,21 +689,28 @@ def update( return operations.UpdateMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -628,21 +718,23 @@ async def update_async( self, *, id: str, - multistream_target_patch_payload: Union[ - components.MultistreamTargetPatchPayload, - components.MultistreamTargetPatchPayloadTypedDict, + multistream_target: Union[ + components.MultistreamTargetInput, + components.MultistreamTargetInputTypedDict, ], retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateMultistreamTargetResponse: r"""Update Multistream Target :param id: ID of the multistream target - :param multistream_target_patch_payload: + :param multistream_target: :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -651,16 +743,17 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateMultistreamTargetRequest( id=id, - multistream_target_patch_payload=utils.get_pydantic_model( - multistream_target_patch_payload, - components.MultistreamTargetPatchPayload, + multistream_target=utils.get_pydantic_model( + multistream_target, components.MultistreamTargetInput ), ) - req = self.build_request_async( + req = self._build_request_async( method="PATCH", path="/multistream/target/{id}", base_url=base_url, @@ -671,13 +764,14 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( - request.multistream_target_patch_payload, + request.multistream_target, False, False, "json", - components.MultistreamTargetPatchPayload, + components.MultistreamTargetInput, ), timeout_ms=timeout_ms, ) @@ -692,6 +786,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -705,21 +800,28 @@ async def update_async( return operations.UpdateMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -730,6 +832,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteMultistreamTargetResponse: r"""Delete a multistream target @@ -741,6 +844,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -749,12 +853,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteMultistreamTargetRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/multistream/target/{id}", base_url=base_url, @@ -765,6 +871,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -779,6 +886,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -792,21 +900,28 @@ def delete( return operations.DeleteMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -817,6 +932,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteMultistreamTargetResponse: r"""Delete a multistream target @@ -828,6 +944,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -836,12 +953,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteMultistreamTargetRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/multistream/target/{id}", base_url=base_url, @@ -852,6 +971,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -866,6 +986,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -879,20 +1000,27 @@ async def delete_async( return operations.DeleteMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/playback.py b/src/livepeer/playback.py index 51f7010..535d968 100644 --- a/src/livepeer/playback.py +++ b/src/livepeer/playback.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import OptionalNullable, UNSET -from typing import Any, Optional +from typing import Any, Mapping, Optional class Playback(BaseSDK): @@ -18,6 +18,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetPlaybackInfoResponse: r"""Retrieve Playback Info @@ -25,6 +26,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -33,12 +35,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetPlaybackInfoRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/playback/{id}", base_url=base_url, @@ -49,6 +53,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -63,6 +68,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getPlaybackInfo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -72,7 +78,7 @@ def get( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaybackInfoResponse( playback_info=utils.unmarshal_json( @@ -81,23 +87,30 @@ def get( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = utils.unmarshal_json(http_res.text, errors.ErrorData) + raise errors.Error(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetPlaybackInfoResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -108,6 +121,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetPlaybackInfoResponse: r"""Retrieve Playback Info @@ -115,6 +129,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -123,12 +138,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetPlaybackInfoRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/playback/{id}", base_url=base_url, @@ -139,6 +156,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -153,6 +171,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getPlaybackInfo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -162,7 +181,7 @@ async def get_async( retry_config=retry_config, ) - data: Any = None + response_data: Any = None if utils.match_response(http_res, "200", "application/json"): return operations.GetPlaybackInfoResponse( playback_info=utils.unmarshal_json( @@ -171,22 +190,29 @@ async def get_async( http_meta=components.HTTPMetadata(request=req, response=http_res), ) if utils.match_response(http_res, "404", "application/json"): - data = utils.unmarshal_json(http_res.text, errors.ErrorData) - raise errors.Error(data=data) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + response_data = utils.unmarshal_json(http_res.text, errors.ErrorData) + raise errors.Error(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetPlaybackInfoResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/room.py b/src/livepeer/room.py index 77486bc..0454096 100644 --- a/src/livepeer/room.py +++ b/src/livepeer/room.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import OptionalNullable, UNSET -from typing import Optional, Union +from typing import Mapping, Optional, Union from typing_extensions import deprecated @@ -21,6 +21,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateRoomResponse: r"""Create a room @@ -30,6 +31,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -38,7 +40,9 @@ def create( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="POST", path="/room", base_url=base_url, @@ -49,6 +53,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -63,6 +68,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createRoom", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -79,21 +85,28 @@ def create( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateRoomResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -106,6 +119,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateRoomResponse: r"""Create a room @@ -115,6 +129,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -123,7 +138,9 @@ async def create_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="POST", path="/room", base_url=base_url, @@ -134,6 +151,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -148,6 +166,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createRoom", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -164,21 +183,28 @@ async def create_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateRoomResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -192,6 +218,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRoomResponse: r"""Retrieve a room @@ -199,6 +226,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -207,12 +235,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRoomRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/room/{id}", base_url=base_url, @@ -223,6 +253,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -237,6 +268,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRoom", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -251,21 +283,28 @@ def get( room=utils.unmarshal_json(http_res.text, Optional[components.Room]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRoomResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -279,6 +318,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRoomResponse: r"""Retrieve a room @@ -286,6 +326,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -294,12 +335,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRoomRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/room/{id}", base_url=base_url, @@ -310,6 +353,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -324,6 +368,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRoom", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -338,21 +383,28 @@ async def get_async( room=utils.unmarshal_json(http_res.text, Optional[components.Room]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRoomResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -366,6 +418,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteRoomResponse: r"""Delete a room @@ -373,6 +426,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -381,12 +435,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteRoomRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/room/{id}", base_url=base_url, @@ -397,6 +453,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -411,6 +468,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteRoom", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -424,21 +482,28 @@ def delete( return operations.DeleteRoomResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteRoomResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -452,6 +517,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteRoomResponse: r"""Delete a room @@ -459,6 +525,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -467,12 +534,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteRoomRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/room/{id}", base_url=base_url, @@ -483,6 +552,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -497,6 +567,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteRoom", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -510,21 +581,28 @@ async def delete_async( return operations.DeleteRoomResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteRoomResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -541,6 +619,7 @@ def start_egress( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.StartRoomEgressResponse: r"""Start room RTMP egress @@ -553,6 +632,7 @@ def start_egress( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -561,6 +641,8 @@ def start_egress( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.StartRoomEgressRequest( id=id, @@ -569,7 +651,7 @@ def start_egress( ), ) - req = self.build_request( + req = self._build_request( method="POST", path="/room/{id}/egress", base_url=base_url, @@ -580,6 +662,7 @@ def start_egress( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.room_egress_payload, @@ -601,6 +684,7 @@ def start_egress( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="startRoomEgress", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -614,21 +698,28 @@ def start_egress( return operations.StartRoomEgressResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.StartRoomEgressResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -645,6 +736,7 @@ async def start_egress_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.StartRoomEgressResponse: r"""Start room RTMP egress @@ -657,6 +749,7 @@ async def start_egress_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -665,6 +758,8 @@ async def start_egress_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.StartRoomEgressRequest( id=id, @@ -673,7 +768,7 @@ async def start_egress_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/room/{id}/egress", base_url=base_url, @@ -684,6 +779,7 @@ async def start_egress_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.room_egress_payload, @@ -705,6 +801,7 @@ async def start_egress_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="startRoomEgress", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -718,21 +815,28 @@ async def start_egress_async( return operations.StartRoomEgressResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.StartRoomEgressResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -746,6 +850,7 @@ def stop_egress( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.StopRoomEgressResponse: r"""Stop room RTMP egress @@ -753,6 +858,7 @@ def stop_egress( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -761,12 +867,14 @@ def stop_egress( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.StopRoomEgressRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/room/{id}/egress", base_url=base_url, @@ -777,6 +885,7 @@ def stop_egress( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -791,6 +900,7 @@ def stop_egress( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="stopRoomEgress", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -804,21 +914,28 @@ def stop_egress( return operations.StopRoomEgressResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.StopRoomEgressResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -832,6 +949,7 @@ async def stop_egress_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.StopRoomEgressResponse: r"""Stop room RTMP egress @@ -839,6 +957,7 @@ async def stop_egress_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -847,12 +966,14 @@ async def stop_egress_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.StopRoomEgressRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/room/{id}/egress", base_url=base_url, @@ -863,6 +984,7 @@ async def stop_egress_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -877,6 +999,7 @@ async def stop_egress_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="stopRoomEgress", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -890,21 +1013,28 @@ async def stop_egress_async( return operations.StopRoomEgressResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.StopRoomEgressResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -921,6 +1051,7 @@ def create_user( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateRoomUserResponse: r"""Create a room user @@ -934,6 +1065,7 @@ def create_user( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -942,6 +1074,8 @@ def create_user( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.CreateRoomUserRequest( id=id, @@ -950,7 +1084,7 @@ def create_user( ), ) - req = self.build_request( + req = self._build_request( method="POST", path="/room/{id}/user", base_url=base_url, @@ -961,6 +1095,7 @@ def create_user( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.room_user_payload, @@ -982,6 +1117,7 @@ def create_user( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -998,21 +1134,28 @@ def create_user( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1029,6 +1172,7 @@ async def create_user_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateRoomUserResponse: r"""Create a room user @@ -1042,6 +1186,7 @@ async def create_user_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1050,6 +1195,8 @@ async def create_user_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.CreateRoomUserRequest( id=id, @@ -1058,7 +1205,7 @@ async def create_user_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/room/{id}/user", base_url=base_url, @@ -1069,6 +1216,7 @@ async def create_user_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.room_user_payload, @@ -1090,6 +1238,7 @@ async def create_user_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1106,21 +1255,28 @@ async def create_user_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1135,6 +1291,7 @@ def get_user( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRoomUserResponse: r"""Get user details @@ -1143,6 +1300,7 @@ def get_user( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1151,13 +1309,15 @@ def get_user( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRoomUserRequest( id=id, user_id=user_id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/room/{id}/user/{userId}", base_url=base_url, @@ -1168,6 +1328,7 @@ def get_user( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1182,6 +1343,7 @@ def get_user( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1198,21 +1360,28 @@ def get_user( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1227,6 +1396,7 @@ async def get_user_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRoomUserResponse: r"""Get user details @@ -1235,6 +1405,7 @@ async def get_user_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1243,13 +1414,15 @@ async def get_user_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRoomUserRequest( id=id, user_id=user_id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/room/{id}/user/{userId}", base_url=base_url, @@ -1260,6 +1433,7 @@ async def get_user_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1274,6 +1448,7 @@ async def get_user_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1290,21 +1465,28 @@ async def get_user_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1322,6 +1504,7 @@ def update_user( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateRoomUserResponse: r"""Update a room user @@ -1333,6 +1516,7 @@ def update_user( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1341,6 +1525,8 @@ def update_user( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateRoomUserRequest( id=id, @@ -1350,7 +1536,7 @@ def update_user( ), ) - req = self.build_request( + req = self._build_request( method="PUT", path="/room/{id}/user/{userId}", base_url=base_url, @@ -1361,6 +1547,7 @@ def update_user( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.room_user_update_payload, @@ -1382,6 +1569,7 @@ def update_user( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1395,21 +1583,28 @@ def update_user( return operations.UpdateRoomUserResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1427,6 +1622,7 @@ async def update_user_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateRoomUserResponse: r"""Update a room user @@ -1438,6 +1634,7 @@ async def update_user_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1446,6 +1643,8 @@ async def update_user_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateRoomUserRequest( id=id, @@ -1455,7 +1654,7 @@ async def update_user_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="PUT", path="/room/{id}/user/{userId}", base_url=base_url, @@ -1466,6 +1665,7 @@ async def update_user_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.room_user_update_payload, @@ -1487,6 +1687,7 @@ async def update_user_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1500,21 +1701,28 @@ async def update_user_async( return operations.UpdateRoomUserResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1529,6 +1737,7 @@ def delete_user( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteRoomUserResponse: r"""Remove a user from the room @@ -1537,6 +1746,7 @@ def delete_user( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1545,13 +1755,15 @@ def delete_user( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteRoomUserRequest( id=id, user_id=user_id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/room/{id}/user/{userId}", base_url=base_url, @@ -1562,6 +1774,7 @@ def delete_user( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1576,6 +1789,7 @@ def delete_user( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1589,21 +1803,28 @@ def delete_user( return operations.DeleteRoomUserResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1618,6 +1839,7 @@ async def delete_user_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteRoomUserResponse: r"""Remove a user from the room @@ -1626,6 +1848,7 @@ async def delete_user_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1634,13 +1857,15 @@ async def delete_user_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteRoomUserRequest( id=id, user_id=user_id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/room/{id}/user/{userId}", base_url=base_url, @@ -1651,6 +1876,7 @@ async def delete_user_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1665,6 +1891,7 @@ async def delete_user_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteRoomUser", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1678,20 +1905,27 @@ async def delete_user_async( return operations.DeleteRoomUserResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteRoomUserResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/sdk.py b/src/livepeer/sdk.py index faf0ec6..8d3f6b9 100644 --- a/src/livepeer/sdk.py +++ b/src/livepeer/sdk.py @@ -1,7 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK -from .httpclient import AsyncHttpClient, HttpClient +from .httpclient import AsyncHttpClient, ClientOwner, HttpClient, close_clients from .sdkconfiguration import SDKConfiguration from .utils.logger import Logger, get_default_logger from .utils.retries import RetryConfig @@ -22,7 +22,8 @@ from livepeer.transcode import Transcode from livepeer.types import OptionalNullable, UNSET from livepeer.webhook import Webhook -from typing import Any, Callable, Dict, Optional, Union +from typing import Any, Callable, Dict, Optional, Union, cast +import weakref class Livepeer(BaseSDK): @@ -80,15 +81,19 @@ def __init__( :param retry_config: The retry configuration to use for all supported methods :param timeout_ms: Optional request timeout applied to each operation in milliseconds """ + client_supplied = True if client is None: client = httpx.Client() + client_supplied = False assert issubclass( type(client), HttpClient ), "The provided client must implement the HttpClient protocol." + async_client_supplied = True if async_client is None: async_client = httpx.AsyncClient() + async_client_supplied = False if debug_logger is None: debug_logger = get_default_logger() @@ -99,7 +104,8 @@ def __init__( security: Any = None if callable(api_key): - security = lambda: components.Security(api_key=api_key()) # pylint: disable=unnecessary-lambda-assignment + # pylint: disable=unnecessary-lambda-assignment + security = lambda: components.Security(api_key=api_key()) else: security = components.Security(api_key=api_key) @@ -111,7 +117,9 @@ def __init__( self, SDKConfiguration( client=client, + client_supplied=client_supplied, async_client=async_client, + async_client_supplied=async_client_supplied, security=security, server_url=server_url, server_idx=server_idx, @@ -125,7 +133,7 @@ def __init__( current_server_url, *_ = self.sdk_configuration.get_server_details() server_url, self.sdk_configuration.client = hooks.sdk_init( - current_server_url, self.sdk_configuration.client + current_server_url, client ) if current_server_url != server_url: self.sdk_configuration.server_url = server_url @@ -133,6 +141,16 @@ def __init__( # pylint: disable=protected-access self.sdk_configuration.__dict__["_hooks"] = hooks + weakref.finalize( + self, + close_clients, + cast(ClientOwner, self.sdk_configuration), + self.sdk_configuration.client, + self.sdk_configuration.client_supplied, + self.sdk_configuration.async_client, + self.sdk_configuration.async_client_supplied, + ) + self._init_sdks() def _init_sdks(self): @@ -148,3 +166,25 @@ def _init_sdks(self): self.transcode = Transcode(self.sdk_configuration) self.playback = Playback(self.sdk_configuration) self.generate = Generate(self.sdk_configuration) + + def __enter__(self): + return self + + async def __aenter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + if ( + self.sdk_configuration.client is not None + and not self.sdk_configuration.client_supplied + ): + self.sdk_configuration.client.close() + self.sdk_configuration.client = None + + async def __aexit__(self, exc_type, exc_val, exc_tb): + if ( + self.sdk_configuration.async_client is not None + and not self.sdk_configuration.async_client_supplied + ): + await self.sdk_configuration.async_client.aclose() + self.sdk_configuration.async_client = None diff --git a/src/livepeer/sdkconfiguration.py b/src/livepeer/sdkconfiguration.py index beaa6e3..b7d2e81 100644 --- a/src/livepeer/sdkconfiguration.py +++ b/src/livepeer/sdkconfiguration.py @@ -1,6 +1,12 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from ._hooks import SDKHooks +from ._version import ( + __gen_version__, + __openapi_doc_version__, + __user_agent__, + __version__, +) from .httpclient import AsyncHttpClient, HttpClient from .utils import Logger, RetryConfig, remove_suffix from dataclasses import dataclass @@ -18,8 +24,10 @@ @dataclass class SDKConfiguration: - client: HttpClient - async_client: AsyncHttpClient + client: Union[HttpClient, None] + client_supplied: bool + async_client: Union[AsyncHttpClient, None] + async_client_supplied: bool debug_logger: Logger security: Optional[ Union[components.Security, Callable[[], components.Security]] @@ -27,10 +35,10 @@ class SDKConfiguration: server_url: Optional[str] = "" server_idx: Optional[int] = 0 language: str = "python" - openapi_doc_version: str = "1.0.0" - sdk_version: str = "0.3.0" - gen_version: str = "2.415.8" - user_agent: str = "speakeasy-sdk/python 0.3.0 2.415.8 1.0.0 livepeer" + openapi_doc_version: str = __openapi_doc_version__ + sdk_version: str = __version__ + gen_version: str = __gen_version__ + user_agent: str = __user_agent__ retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET) timeout_ms: Optional[int] = None diff --git a/src/livepeer/session.py b/src/livepeer/session.py index 114b844..0898fc5 100644 --- a/src/livepeer/session.py +++ b/src/livepeer/session.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import OptionalNullable, UNSET -from typing import List, Optional, Union +from typing import List, Mapping, Optional, Union class Session(BaseSDK): @@ -18,6 +18,7 @@ def get_clips( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSessionClipsResponse: r"""Retrieve clips of a session @@ -25,6 +26,7 @@ def get_clips( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -33,12 +35,14 @@ def get_clips( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetSessionClipsRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/session/{id}/clips", base_url=base_url, @@ -49,6 +53,7 @@ def get_clips( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -63,6 +68,7 @@ def get_clips( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSessionClips", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -79,21 +85,28 @@ def get_clips( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSessionClipsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -104,6 +117,7 @@ async def get_clips_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSessionClipsResponse: r"""Retrieve clips of a session @@ -111,6 +125,7 @@ async def get_clips_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -119,12 +134,14 @@ async def get_clips_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetSessionClipsRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/session/{id}/clips", base_url=base_url, @@ -135,6 +152,7 @@ async def get_clips_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -149,6 +167,7 @@ async def get_clips_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSessionClips", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -165,21 +184,28 @@ async def get_clips_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSessionClipsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -189,12 +215,14 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSessionsResponse: r"""Retrieve sessions :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -203,7 +231,9 @@ def get_all( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="GET", path="/session", base_url=base_url, @@ -214,6 +244,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -228,6 +259,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSessions", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -244,21 +276,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSessionsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -268,12 +307,14 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSessionsResponse: r"""Retrieve sessions :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -282,7 +323,9 @@ async def get_all_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="GET", path="/session", base_url=base_url, @@ -293,6 +336,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -307,6 +351,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSessions", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -323,21 +368,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSessionsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -348,6 +400,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSessionResponse: r"""Retrieve a session @@ -355,6 +408,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -363,12 +417,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetSessionRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/session/{id}", base_url=base_url, @@ -379,6 +435,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -393,6 +450,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSession", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -409,21 +467,28 @@ def get( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSessionResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -434,6 +499,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetSessionResponse: r"""Retrieve a session @@ -441,6 +507,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -449,12 +516,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetSessionRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/session/{id}", base_url=base_url, @@ -465,6 +534,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -479,6 +549,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getSession", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -495,21 +566,28 @@ async def get_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetSessionResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -521,6 +599,7 @@ def get_recorded( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRecordedSessionsResponse: r"""Retrieve Recorded Sessions @@ -529,6 +608,7 @@ def get_recorded( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -537,13 +617,15 @@ def get_recorded( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRecordedSessionsRequest( parent_id=parent_id, record=record, ) - req = self.build_request( + req = self._build_request( method="GET", path="/stream/{parentId}/sessions", base_url=base_url, @@ -554,6 +636,7 @@ def get_recorded( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -568,6 +651,7 @@ def get_recorded( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRecordedSessions", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -584,21 +668,28 @@ def get_recorded( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRecordedSessionsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -610,6 +701,7 @@ async def get_recorded_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetRecordedSessionsResponse: r"""Retrieve Recorded Sessions @@ -618,6 +710,7 @@ async def get_recorded_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -626,13 +719,15 @@ async def get_recorded_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetRecordedSessionsRequest( parent_id=parent_id, record=record, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/stream/{parentId}/sessions", base_url=base_url, @@ -643,6 +738,7 @@ async def get_recorded_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -657,6 +753,7 @@ async def get_recorded_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getRecordedSessions", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -673,20 +770,27 @@ async def get_recorded_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetRecordedSessionsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/stream.py b/src/livepeer/stream.py index 973ca46..47cc6fd 100644 --- a/src/livepeer/stream.py +++ b/src/livepeer/stream.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import List, Optional, Union, cast +from typing import List, Mapping, Optional, Union, cast class Stream(BaseSDK): @@ -20,6 +20,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateStreamResponse: r"""Create a stream @@ -42,6 +43,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -50,12 +52,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.NewStreamPayload) request = cast(components.NewStreamPayload, request) - req = self.build_request( + req = self._build_request( method="POST", path="/stream", base_url=base_url, @@ -66,6 +70,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.NewStreamPayload @@ -83,6 +88,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -97,21 +103,28 @@ def create( stream=utils.unmarshal_json(http_res.text, Optional[components.Stream]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -124,6 +137,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateStreamResponse: r"""Create a stream @@ -146,6 +160,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -154,12 +169,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.NewStreamPayload) request = cast(components.NewStreamPayload, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/stream", base_url=base_url, @@ -170,6 +187,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.NewStreamPayload @@ -187,6 +205,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -201,21 +220,28 @@ async def create_async( stream=utils.unmarshal_json(http_res.text, Optional[components.Stream]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -226,6 +252,7 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetStreamsResponse: r"""Retrieve streams @@ -233,6 +260,7 @@ def get_all( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -241,12 +269,14 @@ def get_all( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetStreamsRequest( streamsonly=streamsonly, ) - req = self.build_request( + req = self._build_request( method="GET", path="/stream", base_url=base_url, @@ -257,6 +287,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -271,6 +302,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getStreams", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -287,21 +319,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetStreamsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -312,6 +351,7 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetStreamsResponse: r"""Retrieve streams @@ -319,6 +359,7 @@ async def get_all_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -327,12 +368,14 @@ async def get_all_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetStreamsRequest( streamsonly=streamsonly, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/stream", base_url=base_url, @@ -343,6 +386,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -357,6 +401,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getStreams", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -373,21 +418,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetStreamsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -398,6 +450,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetStreamResponse: r"""Retrieve a stream @@ -405,6 +458,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -413,12 +467,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetStreamRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/stream/{id}", base_url=base_url, @@ -429,6 +485,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -443,6 +500,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -457,21 +515,28 @@ def get( stream=utils.unmarshal_json(http_res.text, Optional[components.Stream]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -482,6 +547,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetStreamResponse: r"""Retrieve a stream @@ -489,6 +555,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -497,12 +564,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetStreamRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/stream/{id}", base_url=base_url, @@ -513,6 +582,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -527,6 +597,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -541,21 +612,28 @@ async def get_async( stream=utils.unmarshal_json(http_res.text, Optional[components.Stream]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -569,6 +647,7 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateStreamResponse: r"""Update a stream @@ -577,6 +656,7 @@ def update( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -585,6 +665,8 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateStreamRequest( id=id, @@ -593,7 +675,7 @@ def update( ), ) - req = self.build_request( + req = self._build_request( method="PATCH", path="/stream/{id}", base_url=base_url, @@ -604,6 +686,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.stream_patch_payload, @@ -625,6 +708,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -638,21 +722,28 @@ def update( return operations.UpdateStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -666,6 +757,7 @@ async def update_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateStreamResponse: r"""Update a stream @@ -674,6 +766,7 @@ async def update_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -682,6 +775,8 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateStreamRequest( id=id, @@ -690,7 +785,7 @@ async def update_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="PATCH", path="/stream/{id}", base_url=base_url, @@ -701,6 +796,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.stream_patch_payload, @@ -722,6 +818,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -735,21 +832,28 @@ async def update_async( return operations.UpdateStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -760,6 +864,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteStreamResponse: r"""Delete a stream @@ -773,6 +878,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -781,12 +887,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteStreamRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/stream/{id}", base_url=base_url, @@ -797,6 +905,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -811,6 +920,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -824,21 +934,28 @@ def delete( return operations.DeleteStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -849,6 +966,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteStreamResponse: r"""Delete a stream @@ -862,6 +980,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -870,12 +989,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteStreamRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/stream/{id}", base_url=base_url, @@ -886,6 +1007,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -900,6 +1022,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -913,21 +1036,28 @@ async def delete_async( return operations.DeleteStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -938,6 +1068,7 @@ def terminate( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.TerminateStreamResponse: r"""Terminates a live stream @@ -955,6 +1086,7 @@ def terminate( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -963,12 +1095,14 @@ def terminate( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.TerminateStreamRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/stream/{id}/terminate", base_url=base_url, @@ -979,6 +1113,7 @@ def terminate( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -993,6 +1128,7 @@ def terminate( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="terminateStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1006,21 +1142,28 @@ def terminate( return operations.TerminateStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.TerminateStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1031,6 +1174,7 @@ async def terminate_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.TerminateStreamResponse: r"""Terminates a live stream @@ -1048,6 +1192,7 @@ async def terminate_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1056,12 +1201,14 @@ async def terminate_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.TerminateStreamRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/stream/{id}/terminate", base_url=base_url, @@ -1072,6 +1219,7 @@ async def terminate_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1086,6 +1234,7 @@ async def terminate_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="terminateStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1099,21 +1248,28 @@ async def terminate_async( return operations.TerminateStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.TerminateStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1124,6 +1280,7 @@ def start_pull( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.StartPullStreamResponse: r"""Start ingest for a pull stream @@ -1140,6 +1297,7 @@ def start_pull( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1148,12 +1306,14 @@ def start_pull( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.StartPullStreamRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="POST", path="/stream/{id}/start-pull", base_url=base_url, @@ -1164,6 +1324,7 @@ def start_pull( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1178,6 +1339,7 @@ def start_pull( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="startPullStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1191,21 +1353,28 @@ def start_pull( return operations.StartPullStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.StartPullStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1216,6 +1385,7 @@ async def start_pull_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.StartPullStreamResponse: r"""Start ingest for a pull stream @@ -1232,6 +1402,7 @@ async def start_pull_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1240,12 +1411,14 @@ async def start_pull_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.StartPullStreamRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/stream/{id}/start-pull", base_url=base_url, @@ -1256,6 +1429,7 @@ async def start_pull_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1270,6 +1444,7 @@ async def start_pull_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="startPullStream", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1283,21 +1458,28 @@ async def start_pull_async( return operations.StartPullStreamResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.StartPullStreamResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1308,6 +1490,7 @@ def create_clip( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateClipResponse: r"""Create a clip @@ -1315,6 +1498,7 @@ def create_clip( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1323,12 +1507,14 @@ def create_clip( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.ClipPayload) request = cast(components.ClipPayload, request) - req = self.build_request( + req = self._build_request( method="POST", path="/clip", base_url=base_url, @@ -1339,6 +1525,7 @@ def create_clip( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.ClipPayload @@ -1356,6 +1543,7 @@ def create_clip( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createClip", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1372,21 +1560,28 @@ def create_clip( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateClipResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1397,6 +1592,7 @@ async def create_clip_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateClipResponse: r"""Create a clip @@ -1404,6 +1600,7 @@ async def create_clip_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1412,12 +1609,14 @@ async def create_clip_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.ClipPayload) request = cast(components.ClipPayload, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/clip", base_url=base_url, @@ -1428,6 +1627,7 @@ async def create_clip_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.ClipPayload @@ -1445,6 +1645,7 @@ async def create_clip_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createClip", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1461,21 +1662,28 @@ async def create_clip_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateClipResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1486,6 +1694,7 @@ def get_clips( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetClipsResponse: r"""Retrieve clips of a livestream @@ -1493,6 +1702,7 @@ def get_clips( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1501,12 +1711,14 @@ def get_clips( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetClipsRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/stream/{id}/clips", base_url=base_url, @@ -1517,6 +1729,7 @@ def get_clips( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1531,6 +1744,7 @@ def get_clips( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getClips", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1547,21 +1761,28 @@ def get_clips( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetClipsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1572,6 +1793,7 @@ async def get_clips_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetClipsResponse: r"""Retrieve clips of a livestream @@ -1579,6 +1801,7 @@ async def get_clips_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1587,12 +1810,14 @@ async def get_clips_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetClipsRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/stream/{id}/clips", base_url=base_url, @@ -1603,6 +1828,7 @@ async def get_clips_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1617,6 +1843,7 @@ async def get_clips_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getClips", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1633,21 +1860,28 @@ async def get_clips_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetClipsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1661,6 +1895,7 @@ def add_multistream_target( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.AddMultistreamTargetResponse: r"""Add a multistream target @@ -1669,6 +1904,7 @@ def add_multistream_target( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1677,6 +1913,8 @@ def add_multistream_target( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.AddMultistreamTargetRequest( id=id, @@ -1685,7 +1923,7 @@ def add_multistream_target( ), ) - req = self.build_request( + req = self._build_request( method="POST", path="/stream/{id}/create-multistream-target", base_url=base_url, @@ -1696,6 +1934,7 @@ def add_multistream_target( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.target_add_payload, @@ -1717,6 +1956,7 @@ def add_multistream_target( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="addMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1730,21 +1970,28 @@ def add_multistream_target( return operations.AddMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.AddMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1758,6 +2005,7 @@ async def add_multistream_target_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.AddMultistreamTargetResponse: r"""Add a multistream target @@ -1766,6 +2014,7 @@ async def add_multistream_target_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1774,6 +2023,8 @@ async def add_multistream_target_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.AddMultistreamTargetRequest( id=id, @@ -1782,7 +2033,7 @@ async def add_multistream_target_async( ), ) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/stream/{id}/create-multistream-target", base_url=base_url, @@ -1793,6 +2044,7 @@ async def add_multistream_target_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.target_add_payload, @@ -1814,6 +2066,7 @@ async def add_multistream_target_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="addMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1827,21 +2080,28 @@ async def add_multistream_target_async( return operations.AddMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.AddMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1853,6 +2113,7 @@ def remove_multistream_target( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.RemoveMultistreamTargetResponse: r"""Remove a multistream target @@ -1861,6 +2122,7 @@ def remove_multistream_target( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1869,13 +2131,15 @@ def remove_multistream_target( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.RemoveMultistreamTargetRequest( id=id, target_id=target_id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/stream/{id}/multistream/{targetId}", base_url=base_url, @@ -1886,6 +2150,7 @@ def remove_multistream_target( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1900,6 +2165,7 @@ def remove_multistream_target( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="removeMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1913,21 +2179,28 @@ def remove_multistream_target( return operations.RemoveMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.RemoveMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1939,6 +2212,7 @@ async def remove_multistream_target_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.RemoveMultistreamTargetResponse: r"""Remove a multistream target @@ -1947,6 +2221,7 @@ async def remove_multistream_target_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1955,13 +2230,15 @@ async def remove_multistream_target_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.RemoveMultistreamTargetRequest( id=id, target_id=target_id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/stream/{id}/multistream/{targetId}", base_url=base_url, @@ -1972,6 +2249,7 @@ async def remove_multistream_target_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1986,6 +2264,7 @@ async def remove_multistream_target_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="removeMultistreamTarget", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1999,20 +2278,27 @@ async def remove_multistream_target_async( return operations.RemoveMultistreamTargetResponse( http_meta=components.HTTPMetadata(request=req, response=http_res) ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.RemoveMultistreamTargetResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/task.py b/src/livepeer/task.py index e3f2636..c97c661 100644 --- a/src/livepeer/task.py +++ b/src/livepeer/task.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import OptionalNullable, UNSET -from typing import List, Optional +from typing import List, Mapping, Optional class Task(BaseSDK): @@ -17,12 +17,14 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetTasksResponse: r"""Retrieve Tasks :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -31,7 +33,9 @@ def get_all( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="GET", path="/task", base_url=base_url, @@ -42,6 +46,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -56,6 +61,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getTasks", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -72,21 +78,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetTasksResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -96,12 +109,14 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetTasksResponse: r"""Retrieve Tasks :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -110,7 +125,9 @@ async def get_all_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="GET", path="/task", base_url=base_url, @@ -121,6 +138,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -135,6 +153,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getTasks", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -151,21 +170,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetTasksResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -176,6 +202,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetTaskResponse: r"""Retrieve a Task @@ -183,6 +210,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -191,12 +219,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetTaskRequest( task_id=task_id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/task/{taskId}", base_url=base_url, @@ -207,6 +237,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -221,6 +252,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getTask", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -235,9 +267,15 @@ def get( task=utils.unmarshal_json(http_res.text, Optional[components.Task]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "*"): return operations.GetTaskResponse( @@ -245,10 +283,11 @@ def get( ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -259,6 +298,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetTaskResponse: r"""Retrieve a Task @@ -266,6 +306,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -274,12 +315,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetTaskRequest( task_id=task_id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/task/{taskId}", base_url=base_url, @@ -290,6 +333,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -304,6 +348,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getTask", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -318,9 +363,15 @@ async def get_async( task=utils.unmarshal_json(http_res.text, Optional[components.Task]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "*"): return operations.GetTaskResponse( @@ -328,9 +379,10 @@ async def get_async( ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/transcode.py b/src/livepeer/transcode.py index 6de7605..41fbaa7 100644 --- a/src/livepeer/transcode.py +++ b/src/livepeer/transcode.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import Optional, Union, cast +from typing import Mapping, Optional, Union, cast class Transcode(BaseSDK): @@ -20,6 +20,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.TranscodeVideoResponse: r"""Transcode a video @@ -150,6 +151,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -158,12 +160,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.TranscodePayload) request = cast(components.TranscodePayload, request) - req = self.build_request( + req = self._build_request( method="POST", path="/transcode", base_url=base_url, @@ -174,6 +178,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.TranscodePayload @@ -191,6 +196,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="transcodeVideo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -205,21 +211,28 @@ def create( task=utils.unmarshal_json(http_res.text, Optional[components.Task]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.TranscodeVideoResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -232,6 +245,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.TranscodeVideoResponse: r"""Transcode a video @@ -362,6 +376,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -370,12 +385,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.TranscodePayload) request = cast(components.TranscodePayload, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/transcode", base_url=base_url, @@ -386,6 +403,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.TranscodePayload @@ -403,6 +421,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="transcodeVideo", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -417,20 +436,27 @@ async def create_async( task=utils.unmarshal_json(http_res.text, Optional[components.Task]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.TranscodeVideoResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) diff --git a/src/livepeer/types/basemodel.py b/src/livepeer/types/basemodel.py index a6187ef..231c2e3 100644 --- a/src/livepeer/types/basemodel.py +++ b/src/livepeer/types/basemodel.py @@ -2,7 +2,7 @@ from pydantic import ConfigDict, model_serializer from pydantic import BaseModel as PydanticBaseModel -from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union, NewType +from typing import TYPE_CHECKING, Literal, Optional, TypeVar, Union from typing_extensions import TypeAliasType, TypeAlias @@ -35,5 +35,5 @@ def __bool__(self) -> Literal[False]: "OptionalNullable", Union[Optional[Nullable[T]], Unset], type_params=(T,) ) -UnrecognizedInt = NewType("UnrecognizedInt", int) -UnrecognizedStr = NewType("UnrecognizedStr", str) +UnrecognizedInt: TypeAlias = int +UnrecognizedStr: TypeAlias = str diff --git a/src/livepeer/utils/__init__.py b/src/livepeer/utils/__init__.py index 6c26aeb..f2950ee 100644 --- a/src/livepeer/utils/__init__.py +++ b/src/livepeer/utils/__init__.py @@ -1,6 +1,7 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .annotations import get_discriminator +from .datetimes import parse_datetime from .enums import OpenEnumMeta from .headers import get_headers, get_response_headers from .metadata import ( @@ -27,6 +28,10 @@ serialize_float, serialize_int, stream_to_text, + stream_to_text_async, + stream_to_bytes, + stream_to_bytes_async, + validate_const, validate_decimal, validate_float, validate_int, @@ -38,6 +43,7 @@ match_content_type, match_status_codes, match_response, + cast_partial, ) from .logger import Logger, get_body_content, get_default_logger @@ -79,11 +85,16 @@ "serialize_request_body", "SerializedRequestBody", "stream_to_text", + "stream_to_text_async", + "stream_to_bytes", + "stream_to_bytes_async", "template_url", "unmarshal", "unmarshal_json", "validate_decimal", + "validate_const", "validate_float", "validate_int", "validate_open_enum", + "cast_partial", ] diff --git a/src/livepeer/utils/annotations.py b/src/livepeer/utils/annotations.py index 0d17472..387874e 100644 --- a/src/livepeer/utils/annotations.py +++ b/src/livepeer/utils/annotations.py @@ -1,19 +1,55 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" -from typing import Any +from enum import Enum +from typing import Any, Optional def get_discriminator(model: Any, fieldname: str, key: str) -> str: - if isinstance(model, dict): - try: - return f'{model.get(key)}' - except AttributeError as e: - raise ValueError(f'Could not find discriminator key {key} in {model}') from e - - if hasattr(model, fieldname): - return f'{getattr(model, fieldname)}' - - fieldname = fieldname.upper() - if hasattr(model, fieldname): - return f'{getattr(model, fieldname)}' + """ + Recursively search for the discriminator attribute in a model. + + Args: + model (Any): The model to search within. + fieldname (str): The name of the field to search for. + key (str): The key to search for in dictionaries. + + Returns: + str: The name of the discriminator attribute. + + Raises: + ValueError: If the discriminator attribute is not found. + """ + upper_fieldname = fieldname.upper() + + def get_field_discriminator(field: Any) -> Optional[str]: + """Search for the discriminator attribute in a given field.""" + + if isinstance(field, dict): + if key in field: + return f'{field[key]}' + + if hasattr(field, fieldname): + attr = getattr(field, fieldname) + if isinstance(attr, Enum): + return f'{attr.value}' + return f'{attr}' + + if hasattr(field, upper_fieldname): + attr = getattr(field, upper_fieldname) + if isinstance(attr, Enum): + return f'{attr.value}' + return f'{attr}' + + return None + + + if isinstance(model, list): + for field in model: + discriminator = get_field_discriminator(field) + if discriminator is not None: + return discriminator + + discriminator = get_field_discriminator(model) + if discriminator is not None: + return discriminator raise ValueError(f'Could not find discriminator field {fieldname} in {model}') diff --git a/src/livepeer/utils/datetimes.py b/src/livepeer/utils/datetimes.py new file mode 100644 index 0000000..a6c52cd --- /dev/null +++ b/src/livepeer/utils/datetimes.py @@ -0,0 +1,23 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from datetime import datetime +import sys + + +def parse_datetime(datetime_string: str) -> datetime: + """ + Convert a RFC 3339 / ISO 8601 formatted string into a datetime object. + Python versions 3.11 and later support parsing RFC 3339 directly with + datetime.fromisoformat(), but for earlier versions, this function + encapsulates the necessary extra logic. + """ + # Python 3.11 and later can parse RFC 3339 directly + if sys.version_info >= (3, 11): + return datetime.fromisoformat(datetime_string) + + # For Python 3.10 and earlier, a common ValueError is trailing 'Z' suffix, + # so fix that upfront. + if datetime_string.endswith("Z"): + datetime_string = datetime_string[:-1] + "+00:00" + + return datetime.fromisoformat(datetime_string) diff --git a/src/livepeer/utils/enums.py b/src/livepeer/utils/enums.py index c650b10..c3bc13c 100644 --- a/src/livepeer/utils/enums.py +++ b/src/livepeer/utils/enums.py @@ -1,34 +1,74 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" import enum - +import sys class OpenEnumMeta(enum.EnumMeta): - def __call__( - cls, value, names=None, *, module=None, qualname=None, type=None, start=1 - ): - # The `type` kwarg also happens to be a built-in that pylint flags as - # redeclared. Safe to ignore this lint rule with this scope. - # pylint: disable=redefined-builtin + # The __call__ method `boundary` kwarg was added in 3.11 and must be present + # for pyright. Refer also: https://github.com/pylint-dev/pylint/issues/9622 + # pylint: disable=unexpected-keyword-arg + # The __call__ method `values` varg must be named for pyright. + # pylint: disable=keyword-arg-before-vararg + + if sys.version_info >= (3, 11): + def __call__( + cls, value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin + + if names is not None: + return super().__call__( + value, + names=names, + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + *values, + module=module, + qualname=qualname, + type=type, + start=start, + boundary=boundary, + ) + except ValueError: + return value + else: + def __call__( + cls, value, names=None, *, module=None, qualname=None, type=None, start=1 + ): + # The `type` kwarg also happens to be a built-in that pylint flags as + # redeclared. Safe to ignore this lint rule with this scope. + # pylint: disable=redefined-builtin - if names is not None: - return super().__call__( - value, - names=names, - module=module, - qualname=qualname, - type=type, - start=start, - ) + if names is not None: + return super().__call__( + value, + names=names, + module=module, + qualname=qualname, + type=type, + start=start, + ) - try: - return super().__call__( - value, - names=names, # pyright: ignore[reportArgumentType] - module=module, - qualname=qualname, - type=type, - start=start, - ) - except ValueError: - return value + try: + return super().__call__( + value, + names=names, # pyright: ignore[reportArgumentType] + module=module, + qualname=qualname, + type=type, + start=start, + ) + except ValueError: + return value diff --git a/src/livepeer/utils/eventstreaming.py b/src/livepeer/utils/eventstreaming.py index 553b386..74a63f7 100644 --- a/src/livepeer/utils/eventstreaming.py +++ b/src/livepeer/utils/eventstreaming.py @@ -2,12 +2,72 @@ import re import json -from typing import Callable, TypeVar, Optional, Generator, AsyncGenerator, Tuple +from typing import ( + Callable, + Generic, + TypeVar, + Optional, + Generator, + AsyncGenerator, + Tuple, +) import httpx T = TypeVar("T") +class EventStream(Generic[T]): + response: httpx.Response + generator: Generator[T, None, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events(response, decoder, sentinel) + + def __iter__(self): + return self + + def __next__(self): + return next(self.generator) + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + self.response.close() + + +class EventStreamAsync(Generic[T]): + response: httpx.Response + generator: AsyncGenerator[T, None] + + def __init__( + self, + response: httpx.Response, + decoder: Callable[[str], T], + sentinel: Optional[str] = None, + ): + self.response = response + self.generator = stream_events_async(response, decoder, sentinel) + + def __aiter__(self): + return self + + async def __anext__(self): + return await self.generator.__anext__() + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_val, exc_tb): + await self.response.aclose() + + class ServerEvent: id: Optional[str] = None event: Optional[str] = None diff --git a/src/livepeer/utils/forms.py b/src/livepeer/utils/forms.py index 9f5a731..0472aba 100644 --- a/src/livepeer/utils/forms.py +++ b/src/livepeer/utils/forms.py @@ -109,13 +109,12 @@ def serialize_multipart_form( if not field_metadata: continue - f_name = field.alias if field.alias is not None else name + f_name = field.alias if field.alias else name if field_metadata.file: file_fields: Dict[str, FieldInfo] = val.__class__.model_fields file_name = "" - field_name = "" content = None content_type = None @@ -131,20 +130,15 @@ def serialize_multipart_form( elif file_field_name == "content_type": content_type = getattr(val, file_field_name, None) else: - field_name = ( - file_field.alias - if file_field.alias is not None - else file_field_name - ) file_name = getattr(val, file_field_name) - if field_name == "" or file_name == "" or content is None: + if file_name == "" or content is None: raise ValueError("invalid multipart/form-data file") if content_type is not None: - files[field_name] = (file_name, content, content_type) + files[f_name] = (file_name, content, content_type) else: - files[field_name] = (file_name, content) + files[f_name] = (file_name, content) elif field_metadata.json: files[f_name] = ( None, diff --git a/src/livepeer/utils/requestbodies.py b/src/livepeer/utils/requestbodies.py index 4f586ae..d5240dd 100644 --- a/src/livepeer/utils/requestbodies.py +++ b/src/livepeer/utils/requestbodies.py @@ -23,7 +23,7 @@ @dataclass class SerializedRequestBody: - media_type: str + media_type: Optional[str] = None content: Optional[Any] = None data: Optional[Any] = None files: Optional[Any] = None diff --git a/src/livepeer/utils/serializers.py b/src/livepeer/utils/serializers.py index 85d57f4..76e44d7 100644 --- a/src/livepeer/utils/serializers.py +++ b/src/livepeer/utils/serializers.py @@ -1,20 +1,24 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from decimal import Decimal +import functools import json -from typing import Any, Dict, List, Union, get_args -import httpx +import typing +from typing import Any, Dict, List, Tuple, Union, get_args +import typing_extensions from typing_extensions import get_origin + +import httpx from pydantic import ConfigDict, create_model from pydantic_core import from_json -from typing_inspect import is_optional_type from ..types.basemodel import BaseModel, Nullable, OptionalNullable, Unset def serialize_decimal(as_str: bool): def serialize(d): - if is_optional_type(type(d)) and d is None: + # Optional[T] is a Union[T, None] + if is_union(type(d)) and type(None) in get_args(type(d)) and d is None: return None if isinstance(d, Unset): return d @@ -42,7 +46,8 @@ def validate_decimal(d): def serialize_float(as_str: bool): def serialize(f): - if is_optional_type(type(f)) and f is None: + # Optional[T] is a Union[T, None] + if is_union(type(f)) and type(None) in get_args(type(f)) and f is None: return None if isinstance(f, Unset): return f @@ -70,7 +75,8 @@ def validate_float(f): def serialize_int(as_str: bool): def serialize(i): - if is_optional_type(type(i)) and i is None: + # Optional[T] is a Union[T, None] + if is_union(type(i)) and type(None) in get_args(type(i)) and i is None: return None if isinstance(i, Unset): return i @@ -116,6 +122,20 @@ def validate(e): return validate +def validate_const(v): + def validate(c): + # Optional[T] is a Union[T, None] + if is_union(type(c)) and type(None) in get_args(type(c)) and c is None: + return None + + if v != c: + raise ValueError(f"Expected {v}") + + return c + + return validate + + def unmarshal_json(raw, typ: Any) -> Any: return unmarshal(from_json(raw), typ) @@ -150,7 +170,7 @@ def marshal_json(val, typ): if len(d) == 0: return "" - return json.dumps(d[next(iter(d))], separators=(",", ":"), sort_keys=True) + return json.dumps(d[next(iter(d))], separators=(",", ":")) def is_nullable(field): @@ -168,10 +188,29 @@ def is_nullable(field): return False +def is_union(obj: object) -> bool: + """ + Returns True if the given object is a typing.Union or typing_extensions.Union. + """ + return any(obj is typing_obj for typing_obj in _get_typing_objects_by_name_of("Union")) + + def stream_to_text(stream: httpx.Response) -> str: return "".join(stream.iter_text()) +async def stream_to_text_async(stream: httpx.Response) -> str: + return "".join([chunk async for chunk in stream.aiter_text()]) + + +def stream_to_bytes(stream: httpx.Response) -> bytes: + return stream.content + + +async def stream_to_bytes_async(stream: httpx.Response) -> bytes: + return await stream.aread() + + def get_pydantic_model(data: Any, typ: Any) -> Any: if not _contains_pydantic_model(data): return unmarshal(data, typ) @@ -188,3 +227,22 @@ def _contains_pydantic_model(data: Any) -> bool: return any(_contains_pydantic_model(value) for value in data.values()) return False + + +@functools.cache +def _get_typing_objects_by_name_of(name: str) -> Tuple[Any, ...]: + """ + Get typing objects by name from typing and typing_extensions. + Reference: https://typing-extensions.readthedocs.io/en/latest/#runtime-use-of-types + """ + result = tuple( + getattr(module, name) + for module in (typing, typing_extensions) + if hasattr(module, name) + ) + if not result: + raise ValueError( + f"Neither typing nor typing_extensions has an object called {name!r}" + ) + return result + diff --git a/src/livepeer/utils/values.py b/src/livepeer/utils/values.py index 2b4b683..dae01a4 100644 --- a/src/livepeer/utils/values.py +++ b/src/livepeer/utils/values.py @@ -3,8 +3,9 @@ from datetime import datetime from enum import Enum from email.message import Message +from functools import partial import os -from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union +from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union, cast from httpx import Response from pydantic import BaseModel @@ -51,6 +52,8 @@ def match_status_codes(status_codes: List[str], status_code: int) -> bool: T = TypeVar("T") +def cast_partial(typ): + return partial(cast, typ) def get_global_from_env( value: Optional[T], env_key: str, type_cast: Callable[[str], T] diff --git a/src/livepeer/webhook.py b/src/livepeer/webhook.py index 352ec08..d6cc1e4 100644 --- a/src/livepeer/webhook.py +++ b/src/livepeer/webhook.py @@ -5,7 +5,7 @@ from livepeer._hooks import HookContext from livepeer.models import components, errors, operations from livepeer.types import BaseModel, OptionalNullable, UNSET -from typing import List, Optional, Union, cast +from typing import List, Mapping, Optional, Union, cast class Webhook(BaseSDK): @@ -17,12 +17,14 @@ def get_all( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhooksResponse: r"""Retrieve a Webhook :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -31,7 +33,9 @@ def get_all( if server_url is not None: base_url = server_url - req = self.build_request( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request( method="GET", path="/webhook", base_url=base_url, @@ -42,6 +46,7 @@ def get_all( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -56,6 +61,7 @@ def get_all( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhooks", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -72,21 +78,28 @@ def get_all( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhooksResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -96,12 +109,14 @@ async def get_all_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhooksResponse: r"""Retrieve a Webhook :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -110,7 +125,9 @@ async def get_all_async( if server_url is not None: base_url = server_url - req = self.build_request_async( + else: + base_url = self._get_url(base_url, url_variables) + req = self._build_request_async( method="GET", path="/webhook", base_url=base_url, @@ -121,6 +138,7 @@ async def get_all_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -135,6 +153,7 @@ async def get_all_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhooks", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -151,21 +170,28 @@ async def get_all_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhooksResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -176,6 +202,7 @@ def create( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateWebhookResponse: r"""Create a webhook @@ -186,6 +213,7 @@ def create( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -194,12 +222,14 @@ def create( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.WebhookInput) request = cast(components.WebhookInput, request) - req = self.build_request( + req = self._build_request( method="POST", path="/webhook", base_url=base_url, @@ -210,6 +240,7 @@ def create( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.WebhookInput @@ -227,6 +258,7 @@ def create( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -243,21 +275,28 @@ def create( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -268,6 +307,7 @@ async def create_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.CreateWebhookResponse: r"""Create a webhook @@ -278,6 +318,7 @@ async def create_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -286,12 +327,14 @@ async def create_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) if not isinstance(request, BaseModel): request = utils.unmarshal(request, components.WebhookInput) request = cast(components.WebhookInput, request) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/webhook", base_url=base_url, @@ -302,6 +345,7 @@ async def create_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request, False, False, "json", components.WebhookInput @@ -319,6 +363,7 @@ async def create_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="createWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -335,21 +380,28 @@ async def create_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.CreateWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -360,6 +412,7 @@ def get( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhookResponse: r"""Retrieve a webhook @@ -367,6 +420,7 @@ def get( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -375,12 +429,14 @@ def get( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetWebhookRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/webhook/{id}", base_url=base_url, @@ -391,6 +447,7 @@ def get( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -405,6 +462,7 @@ def get( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -421,21 +479,28 @@ def get( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -446,6 +511,7 @@ async def get_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhookResponse: r"""Retrieve a webhook @@ -453,6 +519,7 @@ async def get_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -461,12 +528,14 @@ async def get_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetWebhookRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/webhook/{id}", base_url=base_url, @@ -477,6 +546,7 @@ async def get_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -491,6 +561,7 @@ async def get_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -507,21 +578,28 @@ async def get_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -533,6 +611,7 @@ def update( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateWebhookResponse: r"""Update a webhook @@ -541,6 +620,7 @@ def update( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -549,13 +629,15 @@ def update( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateWebhookRequest( id=id, webhook=utils.get_pydantic_model(webhook, components.WebhookInput), ) - req = self.build_request( + req = self._build_request( method="PUT", path="/webhook/{id}", base_url=base_url, @@ -566,6 +648,7 @@ def update( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.webhook, False, False, "json", components.WebhookInput @@ -583,6 +666,7 @@ def update( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -599,21 +683,28 @@ def update( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -625,6 +716,7 @@ async def update_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.UpdateWebhookResponse: r"""Update a webhook @@ -633,6 +725,7 @@ async def update_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -641,13 +734,15 @@ async def update_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.UpdateWebhookRequest( id=id, webhook=utils.get_pydantic_model(webhook, components.WebhookInput), ) - req = self.build_request_async( + req = self._build_request_async( method="PUT", path="/webhook/{id}", base_url=base_url, @@ -658,6 +753,7 @@ async def update_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, get_serialized_body=lambda: utils.serialize_request_body( request.webhook, False, False, "json", components.WebhookInput @@ -675,6 +771,7 @@ async def update_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="updateWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -691,21 +788,28 @@ async def update_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.UpdateWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -716,6 +820,7 @@ def delete( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteWebhookResponse: r"""Delete a webhook @@ -723,6 +828,7 @@ def delete( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -731,12 +837,14 @@ def delete( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteWebhookRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="DELETE", path="/webhook/{id}", base_url=base_url, @@ -747,6 +855,7 @@ def delete( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -761,6 +870,7 @@ def delete( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -777,21 +887,28 @@ def delete( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -802,6 +919,7 @@ async def delete_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.DeleteWebhookResponse: r"""Delete a webhook @@ -809,6 +927,7 @@ async def delete_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -817,12 +936,14 @@ async def delete_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.DeleteWebhookRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="DELETE", path="/webhook/{id}", base_url=base_url, @@ -833,6 +954,7 @@ async def delete_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -847,6 +969,7 @@ async def delete_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="deleteWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -863,21 +986,28 @@ async def delete_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.DeleteWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -888,6 +1018,7 @@ def get_logs( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhookLogsResponse: r"""Retrieve webhook logs @@ -895,6 +1026,7 @@ def get_logs( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -903,12 +1035,14 @@ def get_logs( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetWebhookLogsRequest( id=id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/webhook/{id}/log", base_url=base_url, @@ -919,6 +1053,7 @@ def get_logs( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -933,6 +1068,7 @@ def get_logs( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhookLogs", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -949,21 +1085,28 @@ def get_logs( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhookLogsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -974,6 +1117,7 @@ async def get_logs_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhookLogsResponse: r"""Retrieve webhook logs @@ -981,6 +1125,7 @@ async def get_logs_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -989,12 +1134,14 @@ async def get_logs_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetWebhookLogsRequest( id=id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/webhook/{id}/log", base_url=base_url, @@ -1005,6 +1152,7 @@ async def get_logs_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1019,6 +1167,7 @@ async def get_logs_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhookLogs", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1035,21 +1184,28 @@ async def get_logs_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhookLogsResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1061,6 +1217,7 @@ def get_log( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhookLogResponse: r"""Retrieve a webhook log @@ -1069,6 +1226,7 @@ def get_log( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1077,13 +1235,15 @@ def get_log( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetWebhookLogRequest( id=id, log_id=log_id, ) - req = self.build_request( + req = self._build_request( method="GET", path="/webhook/{id}/log/{logId}", base_url=base_url, @@ -1094,6 +1254,7 @@ def get_log( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1108,6 +1269,7 @@ def get_log( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhookLog", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1124,21 +1286,28 @@ def get_log( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhookLogResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1150,6 +1319,7 @@ async def get_log_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.GetWebhookLogResponse: r"""Retrieve a webhook log @@ -1158,6 +1328,7 @@ async def get_log_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1166,13 +1337,15 @@ async def get_log_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.GetWebhookLogRequest( id=id, log_id=log_id, ) - req = self.build_request_async( + req = self._build_request_async( method="GET", path="/webhook/{id}/log/{logId}", base_url=base_url, @@ -1183,6 +1356,7 @@ async def get_log_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1197,6 +1371,7 @@ async def get_log_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="getWebhookLog", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1213,21 +1388,28 @@ async def get_log_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.GetWebhookLogResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1239,6 +1421,7 @@ def resend_log( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.ResendWebhookResponse: r"""Resend a webhook @@ -1252,6 +1435,7 @@ def resend_log( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1260,13 +1444,15 @@ def resend_log( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.ResendWebhookRequest( id=id, log_id=log_id, ) - req = self.build_request( + req = self._build_request( method="POST", path="/webhook/{id}/log/{logId}/resend", base_url=base_url, @@ -1277,6 +1463,7 @@ def resend_log( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1291,6 +1478,7 @@ def resend_log( http_res = self.do_request( hook_ctx=HookContext( + base_url=base_url or "", operation_id="resendWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1307,21 +1495,28 @@ def resend_log( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.ResendWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, ) @@ -1333,6 +1528,7 @@ async def resend_log_async( retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, ) -> operations.ResendWebhookResponse: r"""Resend a webhook @@ -1346,6 +1542,7 @@ async def resend_log_async( :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. """ base_url = None url_variables = None @@ -1354,13 +1551,15 @@ async def resend_log_async( if server_url is not None: base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) request = operations.ResendWebhookRequest( id=id, log_id=log_id, ) - req = self.build_request_async( + req = self._build_request_async( method="POST", path="/webhook/{id}/log/{logId}/resend", base_url=base_url, @@ -1371,6 +1570,7 @@ async def resend_log_async( request_has_query_params=True, user_agent_header="user-agent", accept_header_value="application/json", + http_headers=http_headers, security=self.sdk_configuration.security, timeout_ms=timeout_ms, ) @@ -1385,6 +1585,7 @@ async def resend_log_async( http_res = await self.do_request_async( hook_ctx=HookContext( + base_url=base_url or "", operation_id="resendWebhook", oauth2_scopes=[], security_source=self.sdk_configuration.security, @@ -1401,20 +1602,27 @@ async def resend_log_async( ), http_meta=components.HTTPMetadata(request=req, response=http_res), ) - if utils.match_response(http_res, ["4XX", "5XX"], "*"): + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise errors.SDKError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( - "API error occurred", http_res.status_code, http_res.text, http_res + "API error occurred", http_res.status_code, http_res_text, http_res ) if utils.match_response(http_res, "default", "application/json"): return operations.ResendWebhookResponse( - error=utils.unmarshal_json(http_res.text, Optional[errors.Error]), + error=utils.unmarshal_json(http_res.text, Optional[components.Error]), http_meta=components.HTTPMetadata(request=req, response=http_res), ) content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) raise errors.SDKError( f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", http_res.status_code, - http_res.text, + http_res_text, http_res, )