diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0552d74..690d65c 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: b4f7f2df-6c4d-4150-a18f-8b74fe44eb22 management: - docChecksum: 59634240879b8bce1b699c21c7f4f276 + docChecksum: dbab2ff06b2456d244f05a9b01369a62 docVersion: 1.0.0 - speakeasyVersion: 1.377.1 - generationVersion: 2.404.1 - releaseVersion: 0.5.0 - configChecksum: 3b33f25e938c6a67453f8e636f88064a + speakeasyVersion: 1.390.7 + generationVersion: 2.409.8 + releaseVersion: 0.5.1 + configChecksum: fc35ae30680aa33273de880d9e8a6db9 repoURL: https://github.com/livepeer/livepeer-java.git features: java: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 4d8f487..b501f49 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: true java: - version: 0.5.0 + version: 0.5.1 additionalDependencies: [] additionalPlugins: [] artifactID: livepeer diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 647effc..f2dff20 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.377.1 +speakeasyVersion: 1.390.7 sources: Livepeer: sourceNamespace: livepeer @@ -8,8 +8,8 @@ sources: - latest livepeer-studio-api: sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:9333277669bf8fb46063579d611518570aff37c2bfb20e0a90fd3b0c030ca2ad - sourceBlobDigest: sha256:1705d75b1de89f7c2e60643ed2c2aaced22b577da6f2935b1c2e09d533bb7182 + sourceRevisionDigest: sha256:c8b860fdb232c8542b780411cb63acbcd89d450e3258de2e472ecd3177ea2e1a + sourceBlobDigest: sha256:ad3df7b39244e817fb05acd9fe2d4fd5e6b3e027c1f7fbdc7372a15220bc8849 tags: - latest - main @@ -17,8 +17,8 @@ targets: livepeer-java: source: livepeer-studio-api sourceNamespace: livepeer-studio-api - sourceRevisionDigest: sha256:9333277669bf8fb46063579d611518570aff37c2bfb20e0a90fd3b0c030ca2ad - sourceBlobDigest: sha256:1705d75b1de89f7c2e60643ed2c2aaced22b577da6f2935b1c2e09d533bb7182 + sourceRevisionDigest: sha256:c8b860fdb232c8542b780411cb63acbcd89d450e3258de2e472ecd3177ea2e1a + sourceBlobDigest: sha256:ad3df7b39244e817fb05acd9fe2d4fd5e6b3e027c1f7fbdc7372a15220bc8849 outLocation: /github/workspace/repo my-first-target: source: Livepeer diff --git a/README.md b/README.md index cb7a2f0..13b339b 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,25 @@ applications written in Java. For full documentation and examples, please visit [docs.livepeer.org](https://docs.livepeer.org/sdks/javascript/). + +## Summary + +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. + + + +## Table of Contents + +* [SDK Installation](#sdk-installation) +* [SDK Example Usage](#sdk-example-usage) +* [Available Resources and Operations](#available-resources-and-operations) +* [Error Handling](#error-handling) +* [Server Selection](#server-selection) +* [Authentication](#authentication) + + ## SDK Installation @@ -18,7 +37,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'studio.livepeer:livepeer:0.5.0' +implementation 'studio.livepeer:livepeer:0.5.1' ``` Maven: @@ -26,7 +45,7 @@ Maven: studio.livepeer livepeer - 0.5.0 + 0.5.1 ``` @@ -285,7 +304,7 @@ public class Application { .build(); GetPlaybackInfoResponse res = sdk.playback().get() - .id("") + .id("") .call(); if (res.playbackInfo().isPresent()) { diff --git a/RELEASES.md b/RELEASES.md index b1002f1..168388a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -46,4 +46,12 @@ Based on: - OpenAPI Doc - Speakeasy CLI 1.377.1 (2.404.1) https://github.com/speakeasy-api/speakeasy ### Generated -- [java v0.5.0] . \ No newline at end of file +- [java v0.5.0] . + +## 2024-09-06 00:09:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.390.7 (2.409.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v0.5.1] . \ No newline at end of file diff --git a/build.gradle b/build.gradle index 630190a..dbdcbd7 100644 --- a/build.gradle +++ b/build.gradle @@ -61,7 +61,7 @@ tasks.withType(Javadoc) { } group = "studio.livepeer" -version = "0.5.0" +version = "0.5.1" sourcesJar { archiveBaseName = "livepeer" @@ -78,7 +78,7 @@ publishing { maven(MavenPublication) { groupId = 'studio.livepeer' artifactId = 'livepeer' - version = '0.5.0' + version = '0.5.1' from components.java diff --git a/codeSamples.yaml b/codeSamples.yaml index cde5191..d1ae42c 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,18 +3,34 @@ info: title: CodeSamples overlay for java target version: 0.0.0 actions: - - target: $["paths"]["/access-control/signing-key"]["post"] + - target: $["paths"]["/stream"]["post"] update: x-codeSamples: - lang: java - label: createSigningKey + label: createStream source: |- package hello.world; import java.lang.Exception; + import java.util.List; + import java.util.Map; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.FfmpegProfile; + import studio.livepeer.livepeer.models.components.Location; + import studio.livepeer.livepeer.models.components.Multistream; + import studio.livepeer.livepeer.models.components.NewStreamPayload; + import studio.livepeer.livepeer.models.components.NewStreamPayloadRecordingSpec; + import studio.livepeer.livepeer.models.components.PlaybackPolicy; + import studio.livepeer.livepeer.models.components.Profile; + import studio.livepeer.livepeer.models.components.Pull; + import studio.livepeer.livepeer.models.components.Target; + import studio.livepeer.livepeer.models.components.TargetSpec; + import studio.livepeer.livepeer.models.components.TranscodeProfile; + import studio.livepeer.livepeer.models.components.TranscodeProfileEncoder; + import studio.livepeer.livepeer.models.components.TranscodeProfileProfile; + import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateSigningKeyResponse; + import studio.livepeer.livepeer.models.operations.CreateStreamResponse; public class Application { @@ -24,10 +40,71 @@ actions: .apiKey("") .build(); - CreateSigningKeyResponse res = sdk.accessControl().create() + NewStreamPayload req = NewStreamPayload.builder() + .name("test_stream") + .pull(Pull.builder() + .source("https://myservice.com/live/stream.flv") + .headers(Map.ofEntries( + Map.entry("Authorization", "Bearer 123"))) + .location(Location.builder() + .lat(39.739d) + .lon(-104.988d) + .build()) + .build()) + .playbackPolicy(PlaybackPolicy.builder() + .type(Type.WEBHOOK) + .webhookId("1bde4o2i6xycudoy") + .webhookContext(Map.ofEntries( + Map.entry("streamerId", "my-custom-id"))) + .refreshInterval(600d) + .build()) + .profiles(List.of( + FfmpegProfile.builder() + .width(1280L) + .name("720p") + .height(720L) + .bitrate(3000000L) + .fps(30L) + .fpsDen(1L) + .quality(23L) + .gop("2") + .profile(Profile.H264_BASELINE) + .build())) + .record(false) + .recordingSpec(NewStreamPayloadRecordingSpec.builder() + .profiles(List.of( + TranscodeProfile.builder() + .bitrate(3000000L) + .width(1280L) + .name("720p") + .height(720L) + .quality(23L) + .fps(30L) + .fpsDen(1L) + .gop("2") + .profile(TranscodeProfileProfile.H264_BASELINE) + .encoder(TranscodeProfileEncoder.H264) + .build())) + .build()) + .multistream(Multistream.builder() + .targets(List.of( + Target.builder() + .profile("720p0") + .videoOnly(false) + .id("PUSH123") + .spec(TargetSpec.builder() + .url("rtmps://live.my-service.tv/channel/secretKey") + .name("My target") + .build()) + .build())) + .build()) + .build(); + + CreateStreamResponse res = sdk.stream().create() + .request(req) .call(); - if (res.signingKey().isPresent()) { + if (res.stream().isPresent()) { // handle response } } catch (SDKError e) { @@ -40,18 +117,19 @@ actions: } } - - target: $["paths"]["/playback/{id}"]["get"] + - target: $["paths"]["/clip"]["post"] update: x-codeSamples: - lang: java - label: getPlaybackInfo + label: createClip source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.ClipPayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetPlaybackInfoResponse; + import studio.livepeer.livepeer.models.operations.CreateClipResponse; public class Application { @@ -61,16 +139,21 @@ actions: .apiKey("") .build(); - GetPlaybackInfoResponse res = sdk.playback().get() - .id("") + ClipPayload req = ClipPayload.builder() + .playbackId("eaw4nk06ts2d0mzb") + .startTime(1587667174725d) + .endTime(1587667174725d) + .name("My Clip") + .sessionId("de7818e7-610a-4057-8f6f-b785dc1e6f88") + .build(); + + CreateClipResponse res = sdk.stream().createClip() + .request(req) .call(); - if (res.playbackInfo().isPresent()) { + if (res.data().isPresent()) { // handle response } - } catch (studio.livepeer.livepeer.models.errors.Error e) { - // handle exception - throw e; } catch (SDKError e) { // handle exception throw e; @@ -81,18 +164,18 @@ actions: } } - - target: $["paths"]["/stream/{id}"]["delete"] + - target: $["paths"]["/multistream/target/{id}"]["get"] update: x-codeSamples: - lang: java - label: deleteStream + label: getMultistreamTarget source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteStreamResponse; + import studio.livepeer.livepeer.models.operations.GetMultistreamTargetResponse; public class Application { @@ -102,11 +185,13 @@ actions: .apiKey("") .build(); - DeleteStreamResponse res = sdk.stream().delete() - .id("") + GetMultistreamTargetResponse res = sdk.multistream().get() + .id("") .call(); - // handle response + if (res.multistreamTarget().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -117,18 +202,18 @@ actions: } } - - target: $["paths"]["/multistream/target/{id}"]["get"] + - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] update: x-codeSamples: - lang: java - label: getMultistreamTarget + label: resendWebhook source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetMultistreamTargetResponse; + import studio.livepeer.livepeer.models.operations.ResendWebhookResponse; public class Application { @@ -138,11 +223,12 @@ actions: .apiKey("") .build(); - GetMultistreamTargetResponse res = sdk.multistream().get() - .id("") + ResendWebhookResponse res = sdk.webhook().resendLog() + .id("") + .logId("") .call(); - if (res.multistreamTarget().isPresent()) { + if (res.webhookLog().isPresent()) { // handle response } } catch (SDKError e) { @@ -155,21 +241,18 @@ actions: } } - - target: $["paths"]["/webhook"]["post"] + - target: $["paths"]["/asset"]["get"] update: x-codeSamples: - lang: java - label: createWebhook + label: getAssets source: |- package hello.world; import java.lang.Exception; - import java.util.List; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.Events; - import studio.livepeer.livepeer.models.components.WebhookInput; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateWebhookResponse; + import studio.livepeer.livepeer.models.operations.GetAssetsResponse; public class Application { @@ -179,22 +262,10 @@ actions: .apiKey("") .build(); - WebhookInput req = WebhookInput.builder() - .name("test_webhook") - .url("https://my-service.com/webhook") - .projectId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") - .events(List.of( - Events.STREAM_STARTED, - Events.STREAM_IDLE)) - .sharedSecret("my-secret") - .streamId("de7818e7-610a-4057-8f6f-b785dc1e6f88") - .build(); - - CreateWebhookResponse res = sdk.webhook().create() - .request(req) + GetAssetsResponse res = sdk.asset().getAll() .call(); - if (res.webhook().isPresent()) { + if (res.data().isPresent()) { // handle response } } catch (SDKError e) { @@ -207,18 +278,19 @@ actions: } } - - target: $["paths"]["/asset"]["get"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] update: x-codeSamples: - lang: java - label: getAssets + label: updateSigningKey source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetAssetsResponse; + import studio.livepeer.livepeer.models.operations.UpdateSigningKeyRequestBody; + import studio.livepeer.livepeer.models.operations.UpdateSigningKeyResponse; public class Application { @@ -228,12 +300,13 @@ actions: .apiKey("") .build(); - GetAssetsResponse res = sdk.asset().getAll() + UpdateSigningKeyResponse res = sdk.accessControl().update() + .keyId("") + .requestBody(UpdateSigningKeyRequestBody.builder() + .build()) .call(); - if (res.data().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -244,18 +317,18 @@ actions: } } - - target: $["paths"]["/session/{id}/clips"]["get"] + - target: $["paths"]["/task"]["get"] update: x-codeSamples: - lang: java - label: getSessionClips + label: getTasks source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetSessionClipsResponse; + import studio.livepeer.livepeer.models.operations.GetTasksResponse; public class Application { @@ -265,8 +338,7 @@ actions: .apiKey("") .build(); - GetSessionClipsResponse res = sdk.session().getClips() - .id("") + GetTasksResponse res = sdk.task().getAll() .call(); if (res.data().isPresent()) { @@ -282,18 +354,18 @@ actions: } } - - target: $["paths"]["/stream/{id}/clips"]["get"] + - target: $["paths"]["/stream/{id}/start-pull"]["post"] update: x-codeSamples: - lang: java - label: getClips + label: startPullStream source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetClipsResponse; + import studio.livepeer.livepeer.models.operations.StartPullStreamResponse; public class Application { @@ -303,13 +375,11 @@ actions: .apiKey("") .build(); - GetClipsResponse res = sdk.stream().getClips() - .id("") + StartPullStreamResponse res = sdk.stream().startPull() + .id("") .call(); - if (res.data().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -320,18 +390,18 @@ actions: } } - - target: $["paths"]["/task/{taskId}"]["get"] + - target: $["paths"]["/multistream/target/{id}"]["delete"] update: x-codeSamples: - lang: java - label: getTask + label: deleteMultistreamTarget source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetTaskResponse; + import studio.livepeer.livepeer.models.operations.DeleteMultistreamTargetResponse; public class Application { @@ -341,13 +411,11 @@ actions: .apiKey("") .build(); - GetTaskResponse res = sdk.task().get() - .taskId("") + DeleteMultistreamTargetResponse res = sdk.multistream().delete() + .id("") .call(); - if (res.task().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -358,19 +426,18 @@ actions: } } - - target: $["paths"]["/clip"]["post"] + - target: $["paths"]["/room/{id}"]["get"] update: x-codeSamples: - lang: java - label: createClip + label: getRoom source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.ClipPayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateClipResponse; + import studio.livepeer.livepeer.models.operations.GetRoomResponse; public class Application { @@ -380,19 +447,11 @@ actions: .apiKey("") .build(); - ClipPayload req = ClipPayload.builder() - .playbackId("eaw4nk06ts2d0mzb") - .startTime(1587667174725d) - .endTime(1587667174725d) - .name("My Clip") - .sessionId("de7818e7-610a-4057-8f6f-b785dc1e6f88") - .build(); - - CreateClipResponse res = sdk.stream().createClip() - .request(req) + GetRoomResponse res = sdk.room().get() + .id("") .call(); - if (res.data().isPresent()) { + if (res.room().isPresent()) { // handle response } } catch (SDKError e) { @@ -405,21 +464,18 @@ actions: } } - - target: $["paths"]["/webhook/{id}"]["put"] + - target: $["paths"]["/asset/{assetId}"]["get"] update: x-codeSamples: - lang: java - label: updateWebhook + label: getAsset source: |- package hello.world; import java.lang.Exception; - import java.util.List; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.Events; - import studio.livepeer.livepeer.models.components.WebhookInput; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UpdateWebhookResponse; + import studio.livepeer.livepeer.models.operations.GetAssetResponse; public class Application { @@ -429,21 +485,11 @@ actions: .apiKey("") .build(); - UpdateWebhookResponse res = sdk.webhook().update() - .id("") - .webhook(WebhookInput.builder() - .name("test_webhook") - .url("https://my-service.com/webhook") - .projectId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") - .events(List.of( - Events.STREAM_STARTED, - Events.STREAM_IDLE)) - .sharedSecret("my-secret") - .streamId("de7818e7-610a-4057-8f6f-b785dc1e6f88") - .build()) + GetAssetResponse res = sdk.asset().get() + .assetId("") .call(); - if (res.webhook().isPresent()) { + if (res.asset().isPresent()) { // handle response } } catch (SDKError e) { @@ -456,18 +502,19 @@ actions: } } - - target: $["paths"]["/room/{id}/egress"]["delete"] + - target: $["paths"]["/stream/{parentId}/sessions"]["get"] update: x-codeSamples: - lang: java - label: stopRoomEgress + label: getRecordedSessions source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.StopRoomEgressResponse; + import studio.livepeer.livepeer.models.operations.GetRecordedSessionsResponse; + import studio.livepeer.livepeer.models.operations.Record; public class Application { @@ -477,11 +524,14 @@ actions: .apiKey("") .build(); - StopRoomEgressResponse res = sdk.room().stopEgress() - .id("") + GetRecordedSessionsResponse res = sdk.session().getRecorded() + .parentId("") + .record(Record.of(trueL)) .call(); - // handle response + if (res.data().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -492,19 +542,18 @@ actions: } } - - target: $["paths"]["/data/views/query"]["get"] + - target: $["paths"]["/session/{id}/clips"]["get"] update: x-codeSamples: - lang: java - label: getViewershipMetrics + label: getSessionClips source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetViewershipMetricsRequest; - import studio.livepeer.livepeer.models.operations.GetViewershipMetricsResponse; + import studio.livepeer.livepeer.models.operations.GetSessionClipsResponse; public class Application { @@ -514,11 +563,8 @@ actions: .apiKey("") .build(); - GetViewershipMetricsRequest req = GetViewershipMetricsRequest.builder() - .build(); - - GetViewershipMetricsResponse res = sdk.metrics().getViewership() - .request(req) + GetSessionClipsResponse res = sdk.session().getClips() + .id("") .call(); if (res.data().isPresent()) { @@ -534,18 +580,18 @@ actions: } } - - target: $["paths"]["/access-control/signing-key"]["get"] + - target: $["paths"]["/room"]["post"] update: x-codeSamples: - lang: java - label: getSigningKeys + label: createRoom source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetSigningKeysResponse; + import studio.livepeer.livepeer.models.operations.CreateRoomResponse; public class Application { @@ -555,10 +601,10 @@ actions: .apiKey("") .build(); - GetSigningKeysResponse res = sdk.accessControl().getAll() + CreateRoomResponse res = sdk.room().create() .call(); - if (res.data().isPresent()) { + if (res.createRoomResponse().isPresent()) { // handle response } } catch (SDKError e) { @@ -571,20 +617,19 @@ actions: } } - - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] + - target: $["paths"]["/room/{id}/user/{userId}"]["put"] update: x-codeSamples: - lang: java - label: addMultistreamTarget + label: updateRoomUser source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.TargetAddPayload; - import studio.livepeer.livepeer.models.components.TargetAddPayloadSpec; + import studio.livepeer.livepeer.models.components.RoomUserUpdatePayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.AddMultistreamTargetResponse; + import studio.livepeer.livepeer.models.operations.UpdateRoomUserResponse; public class Application { @@ -594,16 +639,12 @@ actions: .apiKey("") .build(); - AddMultistreamTargetResponse res = sdk.stream().addMultistreamTarget() - .id("") - .targetAddPayload(TargetAddPayload.builder() - .profile("720p0") - .videoOnly(false) - .id("PUSH123") - .spec(TargetAddPayloadSpec.builder() - .url("rtmps://live.my-service.tv/channel/secretKey") - .name("My target") - .build()) + UpdateRoomUserResponse res = sdk.room().updateUser() + .id("") + .userId("") + .roomUserUpdatePayload(RoomUserUpdatePayload.builder() + .canPublish(true) + .canPublishData(true) .build()) .call(); @@ -618,18 +659,19 @@ actions: } } - - target: $["paths"]["/room"]["post"] + - target: $["paths"]["/data/views/query"]["get"] update: x-codeSamples: - lang: java - label: createRoom + label: getViewershipMetrics source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateRoomResponse; + import studio.livepeer.livepeer.models.operations.GetViewershipMetricsRequest; + import studio.livepeer.livepeer.models.operations.GetViewershipMetricsResponse; public class Application { @@ -639,10 +681,14 @@ actions: .apiKey("") .build(); - CreateRoomResponse res = sdk.room().create() + GetViewershipMetricsRequest req = GetViewershipMetricsRequest.builder() + .build(); + + GetViewershipMetricsResponse res = sdk.metrics().getViewership() + .request(req) .call(); - if (res.createRoomResponse().isPresent()) { + if (res.data().isPresent()) { // handle response } } catch (SDKError e) { @@ -655,18 +701,19 @@ actions: } } - - target: $["paths"]["/room/{id}"]["get"] + - target: $["paths"]["/data/usage/query"]["get"] update: x-codeSamples: - lang: java - label: getRoom + label: getUsageMetrics source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetRoomResponse; + import studio.livepeer.livepeer.models.operations.GetUsageMetricsRequest; + import studio.livepeer.livepeer.models.operations.GetUsageMetricsResponse; public class Application { @@ -676,11 +723,14 @@ actions: .apiKey("") .build(); - GetRoomResponse res = sdk.room().get() - .id("") + GetUsageMetricsRequest req = GetUsageMetricsRequest.builder() + .build(); + + GetUsageMetricsResponse res = sdk.metrics().getUsage() + .request(req) .call(); - if (res.room().isPresent()) { + if (res.usageMetric().isPresent()) { // handle response } } catch (SDKError e) { @@ -693,18 +743,21 @@ actions: } } - - target: $["paths"]["/room/{id}"]["delete"] + - target: $["paths"]["/webhook"]["post"] update: x-codeSamples: - lang: java - label: deleteRoom + label: createWebhook source: |- package hello.world; import java.lang.Exception; + import java.util.List; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.Events; + import studio.livepeer.livepeer.models.components.WebhookInput; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteRoomResponse; + import studio.livepeer.livepeer.models.operations.CreateWebhookResponse; public class Application { @@ -714,48 +767,22 @@ actions: .apiKey("") .build(); - DeleteRoomResponse res = sdk.room().delete() - .id("") - .call(); - - // handle response - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - - target: $["paths"]["/room/{id}/user/{userId}"]["get"] - update: - x-codeSamples: - - lang: java - label: getRoomUser - source: |- - package hello.world; - - import java.lang.Exception; - import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetRoomUserResponse; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - Livepeer sdk = Livepeer.builder() - .apiKey("") + WebhookInput req = WebhookInput.builder() + .name("test_webhook") + .url("https://my-service.com/webhook") + .projectId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") + .events(List.of( + Events.STREAM_STARTED, + Events.STREAM_IDLE)) + .sharedSecret("my-secret") + .streamId("de7818e7-610a-4057-8f6f-b785dc1e6f88") .build(); - GetRoomUserResponse res = sdk.room().getUser() - .id("") - .userId("") + CreateWebhookResponse res = sdk.webhook().create() + .request(req) .call(); - if (res.getRoomUserResponse().isPresent()) { + if (res.webhook().isPresent()) { // handle response } } catch (SDKError e) { @@ -768,18 +795,21 @@ actions: } } - - target: $["paths"]["/webhook"]["get"] + - target: $["paths"]["/webhook/{id}"]["put"] update: x-codeSamples: - lang: java - label: getWebhooks + label: updateWebhook source: |- package hello.world; import java.lang.Exception; + import java.util.List; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.Events; + import studio.livepeer.livepeer.models.components.WebhookInput; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetWebhooksResponse; + import studio.livepeer.livepeer.models.operations.UpdateWebhookResponse; public class Application { @@ -789,10 +819,21 @@ actions: .apiKey("") .build(); - GetWebhooksResponse res = sdk.webhook().getAll() + UpdateWebhookResponse res = sdk.webhook().update() + .id("") + .webhook(WebhookInput.builder() + .name("test_webhook") + .url("https://my-service.com/webhook") + .projectId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") + .events(List.of( + Events.STREAM_STARTED, + Events.STREAM_IDLE)) + .sharedSecret("my-secret") + .streamId("de7818e7-610a-4057-8f6f-b785dc1e6f88") + .build()) .call(); - if (res.data().isPresent()) { + if (res.webhook().isPresent()) { // handle response } } catch (SDKError e) { @@ -805,18 +846,18 @@ actions: } } - - target: $["paths"]["/webhook/{id}"]["get"] + - target: $["paths"]["/webhook/{id}/log"]["get"] update: x-codeSamples: - lang: java - label: getWebhook + label: getWebhookLogs source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetWebhookResponse; + import studio.livepeer.livepeer.models.operations.GetWebhookLogsResponse; public class Application { @@ -826,11 +867,11 @@ actions: .apiKey("") .build(); - GetWebhookResponse res = sdk.webhook().get() - .id("") + GetWebhookLogsResponse res = sdk.webhook().getLogs() + .id("") .call(); - if (res.webhook().isPresent()) { + if (res.data().isPresent()) { // handle response } } catch (SDKError e) { @@ -843,19 +884,18 @@ actions: } } - - target: $["paths"]["/room/{id}/user"]["post"] + - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] update: x-codeSamples: - lang: java - label: createRoomUser + label: getWebhookLog source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.RoomUserPayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateRoomUserResponse; + import studio.livepeer.livepeer.models.operations.GetWebhookLogResponse; public class Application { @@ -865,16 +905,12 @@ actions: .apiKey("") .build(); - CreateRoomUserResponse res = sdk.room().createUser() - .id("") - .roomUserPayload(RoomUserPayload.builder() - .name("name") - .canPublish(true) - .canPublishData(true) - .build()) + GetWebhookLogResponse res = sdk.webhook().getLog() + .id("") + .logId("") .call(); - if (res.roomUserResponse().isPresent()) { + if (res.webhookLog().isPresent()) { // handle response } } catch (SDKError e) { @@ -887,19 +923,18 @@ actions: } } - - target: $["paths"]["/multistream/target"]["post"] + - target: $["paths"]["/access-control/signing-key"]["post"] update: x-codeSamples: - lang: java - label: createMultistreamTarget + label: createSigningKey source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.MultistreamTargetInput; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateMultistreamTargetResponse; + import studio.livepeer.livepeer.models.operations.CreateSigningKeyResponse; public class Application { @@ -909,15 +944,10 @@ actions: .apiKey("") .build(); - MultistreamTargetInput req = MultistreamTargetInput.builder() - .url("rtmps://live.my-service.tv/channel/secretKey") - .build(); - - CreateMultistreamTargetResponse res = sdk.multistream().create() - .request(req) + CreateSigningKeyResponse res = sdk.accessControl().create() .call(); - if (res.multistreamTarget().isPresent()) { + if (res.signingKey().isPresent()) { // handle response } } catch (SDKError e) { @@ -930,19 +960,20 @@ actions: } } - - target: $["paths"]["/multistream/target/{id}"]["patch"] + - target: $["paths"]["/stream/{id}/create-multistream-target"]["post"] update: x-codeSamples: - lang: java - label: updateMultistreamTarget + label: addMultistreamTarget source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.MultistreamTargetPatchPayload; + import studio.livepeer.livepeer.models.components.TargetAddPayload; + import studio.livepeer.livepeer.models.components.TargetAddPayloadSpec; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UpdateMultistreamTargetResponse; + import studio.livepeer.livepeer.models.operations.AddMultistreamTargetResponse; public class Application { @@ -952,10 +983,16 @@ actions: .apiKey("") .build(); - UpdateMultistreamTargetResponse res = sdk.multistream().update() - .id("") - .multistreamTargetPatchPayload(MultistreamTargetPatchPayload.builder() - .url("rtmps://live.my-service.tv/channel/secretKey") + AddMultistreamTargetResponse res = sdk.stream().addMultistreamTarget() + .id("") + .targetAddPayload(TargetAddPayload.builder() + .profile("720p0") + .videoOnly(false) + .id("PUSH123") + .spec(TargetAddPayloadSpec.builder() + .url("rtmps://live.my-service.tv/channel/secretKey") + .name("My target") + .build()) .build()) .call(); @@ -970,11 +1007,11 @@ actions: } } - - target: $["paths"]["/asset/request-upload"]["post"] + - target: $["paths"]["/asset/upload/url"]["post"] update: x-codeSamples: - lang: java - label: requestUpload + label: uploadAsset source: |- package hello.world; @@ -982,14 +1019,14 @@ actions: import java.util.List; import java.util.Map; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.NewAssetPayload; + import studio.livepeer.livepeer.models.components.NewAssetFromUrlPayload; import studio.livepeer.livepeer.models.components.PlaybackPolicy; import studio.livepeer.livepeer.models.components.TranscodeProfile; import studio.livepeer.livepeer.models.components.TranscodeProfileEncoder; import studio.livepeer.livepeer.models.components.TranscodeProfileProfile; import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.RequestUploadResponse; + import studio.livepeer.livepeer.models.operations.UploadAssetResponse; public class Application { @@ -999,8 +1036,9 @@ actions: .apiKey("") .build(); - NewAssetPayload req = NewAssetPayload.builder() + NewAssetFromUrlPayload req = NewAssetFromUrlPayload.builder() .name("filename.mp4") + .url("https://s3.amazonaws.com/my-bucket/path/filename.mp4") .staticMp4(true) .playbackPolicy(PlaybackPolicy.builder() .type(Type.WEBHOOK) @@ -1024,11 +1062,11 @@ actions: .build())) .build(); - RequestUploadResponse res = sdk.asset().create() + UploadAssetResponse res = sdk.asset().createViaUrl() .request(req) .call(); - if (res.data().isPresent()) { + if (res.twoHundredApplicationJsonData().isPresent()) { // handle response } } catch (SDKError e) { @@ -1041,19 +1079,18 @@ actions: } } - - target: $["paths"]["/room/{id}/user/{userId}"]["put"] + - target: $["paths"]["/room/{id}"]["delete"] update: x-codeSamples: - lang: java - label: updateRoomUser + label: deleteRoom source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.RoomUserUpdatePayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UpdateRoomUserResponse; + import studio.livepeer.livepeer.models.operations.DeleteRoomResponse; public class Application { @@ -1063,13 +1100,8 @@ actions: .apiKey("") .build(); - UpdateRoomUserResponse res = sdk.room().updateUser() - .id("") - .userId("") - .roomUserUpdatePayload(RoomUserUpdatePayload.builder() - .canPublish(true) - .canPublishData(true) - .build()) + DeleteRoomResponse res = sdk.room().delete() + .id("") .call(); // handle response @@ -1083,56 +1115,18 @@ actions: } } - - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] - update: - x-codeSamples: - - lang: java - label: getPublicViewershipMetrics - source: |- - package hello.world; - - import java.lang.Exception; - import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetPublicViewershipMetricsResponse; - - public class Application { - - public static void main(String[] args) throws Exception { - try { - Livepeer sdk = Livepeer.builder() - .apiKey("") - .build(); - - GetPublicViewershipMetricsResponse res = sdk.metrics().getPublicViewership() - .playbackId("") - .call(); - - if (res.data().isPresent()) { - // handle response - } - } catch (SDKError e) { - // handle exception - throw e; - } catch (Exception e) { - // handle exception - throw e; - } - - } - } - - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] + - target: $["paths"]["/room/{id}/egress"]["delete"] update: x-codeSamples: - lang: java - label: removeMultistreamTarget + label: stopRoomEgress source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.RemoveMultistreamTargetResponse; + import studio.livepeer.livepeer.models.operations.StopRoomEgressResponse; public class Application { @@ -1142,9 +1136,8 @@ actions: .apiKey("") .build(); - RemoveMultistreamTargetResponse res = sdk.stream().removeMultistreamTarget() - .id("") - .targetId("") + StopRoomEgressResponse res = sdk.room().stopEgress() + .id("") .call(); // handle response @@ -1158,18 +1151,18 @@ actions: } } - - target: $["paths"]["/webhook/{id}"]["delete"] + - target: $["paths"]["/playback/{id}"]["get"] update: x-codeSamples: - lang: java - label: deleteWebhook + label: getPlaybackInfo source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteWebhookResponse; + import studio.livepeer.livepeer.models.operations.GetPlaybackInfoResponse; public class Application { @@ -1179,13 +1172,16 @@ actions: .apiKey("") .build(); - DeleteWebhookResponse res = sdk.webhook().delete() - .id("") + GetPlaybackInfoResponse res = sdk.playback().get() + .id("") .call(); - if (res.webhook().isPresent()) { + if (res.playbackInfo().isPresent()) { // handle response } + } catch (studio.livepeer.livepeer.models.errors.Error e) { + // handle exception + throw e; } catch (SDKError e) { // handle exception throw e; @@ -1196,18 +1192,22 @@ actions: } } - - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] + - target: $["paths"]["/asset/{assetId}"]["patch"] update: x-codeSamples: - lang: java - label: deleteRoomUser + label: updateAsset source: |- package hello.world; import java.lang.Exception; + import java.util.Map; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.AssetPatchPayload; + import studio.livepeer.livepeer.models.components.PlaybackPolicy; + import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteRoomUserResponse; + import studio.livepeer.livepeer.models.operations.UpdateAssetResponse; public class Application { @@ -1217,12 +1217,23 @@ actions: .apiKey("") .build(); - DeleteRoomUserResponse res = sdk.room().deleteUser() - .id("") - .userId("") + UpdateAssetResponse res = sdk.asset().update() + .assetId("") + .assetPatchPayload(AssetPatchPayload.builder() + .name("filename.mp4") + .playbackPolicy(PlaybackPolicy.builder() + .type(Type.WEBHOOK) + .webhookId("1bde4o2i6xycudoy") + .webhookContext(Map.ofEntries( + Map.entry("streamerId", "my-custom-id"))) + .refreshInterval(600d) + .build()) + .build()) .call(); - // handle response + if (res.asset().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -1233,20 +1244,18 @@ actions: } } - - target: $["paths"]["/data/views/now"]["get"] + - target: $["paths"]["/data/views/query/total/{playbackId}"]["get"] update: x-codeSamples: - lang: java - label: getRealtimeViewershipNow + label: getPublicViewershipMetrics source: |- package hello.world; import java.lang.Exception; - import java.util.List; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.BreakdownBy; - import studio.livepeer.livepeer.models.operations.GetRealtimeViewershipNowResponse; + import studio.livepeer.livepeer.models.operations.GetPublicViewershipMetricsResponse; public class Application { @@ -1256,11 +1265,8 @@ actions: .apiKey("") .build(); - GetRealtimeViewershipNowResponse res = sdk.metrics().getRealtimeViewership() + GetPublicViewershipMetricsResponse res = sdk.metrics().getPublicViewership() .playbackId("") - .creatorId("") - .breakdownBy(List.of( - BreakdownBy.PLAYBACK_ID)) .call(); if (res.data().isPresent()) { @@ -1368,18 +1374,18 @@ actions: } } - - target: $["paths"]["/webhook/{id}/log"]["get"] + - target: $["paths"]["/stream/{id}/terminate"]["delete"] update: x-codeSamples: - lang: java - label: getWebhookLogs + label: terminateStream source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetWebhookLogsResponse; + import studio.livepeer.livepeer.models.operations.TerminateStreamResponse; public class Application { @@ -1389,13 +1395,11 @@ actions: .apiKey("") .build(); - GetWebhookLogsResponse res = sdk.webhook().getLogs() - .id("") + TerminateStreamResponse res = sdk.stream().terminate() + .id("") .call(); - if (res.data().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -1406,26 +1410,19 @@ actions: } } - - target: $["paths"]["/asset/upload/url"]["post"] + - target: $["paths"]["/multistream/target"]["post"] update: x-codeSamples: - lang: java - label: uploadAsset + label: createMultistreamTarget source: |- package hello.world; import java.lang.Exception; - import java.util.List; - import java.util.Map; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.NewAssetFromUrlPayload; - import studio.livepeer.livepeer.models.components.PlaybackPolicy; - import studio.livepeer.livepeer.models.components.TranscodeProfile; - import studio.livepeer.livepeer.models.components.TranscodeProfileEncoder; - import studio.livepeer.livepeer.models.components.TranscodeProfileProfile; - import studio.livepeer.livepeer.models.components.Type; + import studio.livepeer.livepeer.models.components.MultistreamTargetInput; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UploadAssetResponse; + import studio.livepeer.livepeer.models.operations.CreateMultistreamTargetResponse; public class Application { @@ -1435,37 +1432,15 @@ actions: .apiKey("") .build(); - NewAssetFromUrlPayload req = NewAssetFromUrlPayload.builder() - .name("filename.mp4") - .url("https://s3.amazonaws.com/my-bucket/path/filename.mp4") - .staticMp4(true) - .playbackPolicy(PlaybackPolicy.builder() - .type(Type.WEBHOOK) - .webhookId("1bde4o2i6xycudoy") - .webhookContext(Map.ofEntries( - Map.entry("streamerId", "my-custom-id"))) - .refreshInterval(600d) - .build()) - .profiles(List.of( - TranscodeProfile.builder() - .bitrate(3000000L) - .width(1280L) - .name("720p") - .height(720L) - .quality(23L) - .fps(30L) - .fpsDen(1L) - .gop("2") - .profile(TranscodeProfileProfile.H264_BASELINE) - .encoder(TranscodeProfileEncoder.H264) - .build())) + MultistreamTargetInput req = MultistreamTargetInput.builder() + .url("rtmps://live.my-service.tv/channel/secretKey") .build(); - UploadAssetResponse res = sdk.asset().createViaUrl() + CreateMultistreamTargetResponse res = sdk.multistream().create() .request(req) .call(); - if (res.twoHundredApplicationJsonData().isPresent()) { + if (res.multistreamTarget().isPresent()) { // handle response } } catch (SDKError e) { @@ -1478,19 +1453,19 @@ actions: } } - - target: $["paths"]["/data/usage/query"]["get"] + - target: $["paths"]["/multistream/target/{id}"]["patch"] update: x-codeSamples: - lang: java - label: getUsageMetrics + label: updateMultistreamTarget source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.MultistreamTargetPatchPayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetUsageMetricsRequest; - import studio.livepeer.livepeer.models.operations.GetUsageMetricsResponse; + import studio.livepeer.livepeer.models.operations.UpdateMultistreamTargetResponse; public class Application { @@ -1500,16 +1475,14 @@ actions: .apiKey("") .build(); - GetUsageMetricsRequest req = GetUsageMetricsRequest.builder() - .build(); - - GetUsageMetricsResponse res = sdk.metrics().getUsage() - .request(req) + UpdateMultistreamTargetResponse res = sdk.multistream().update() + .id("") + .multistreamTargetPatchPayload(MultistreamTargetPatchPayload.builder() + .url("rtmps://live.my-service.tv/channel/secretKey") + .build()) .call(); - if (res.usageMetric().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -1520,18 +1493,18 @@ actions: } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] + - target: $["paths"]["/webhook"]["get"] update: x-codeSamples: - lang: java - label: deleteSigningKey + label: getWebhooks source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteSigningKeyResponse; + import studio.livepeer.livepeer.models.operations.GetWebhooksResponse; public class Application { @@ -1541,11 +1514,12 @@ actions: .apiKey("") .build(); - DeleteSigningKeyResponse res = sdk.accessControl().delete() - .keyId("") + GetWebhooksResponse res = sdk.webhook().getAll() .call(); - // handle response + if (res.data().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -1594,18 +1568,18 @@ actions: } } - - target: $["paths"]["/session"]["get"] + - target: $["paths"]["/stream/{id}"]["delete"] update: x-codeSamples: - lang: java - label: getSessions + label: deleteStream source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetSessionsResponse; + import studio.livepeer.livepeer.models.operations.DeleteStreamResponse; public class Application { @@ -1615,12 +1589,11 @@ actions: .apiKey("") .build(); - GetSessionsResponse res = sdk.session().getAll() + DeleteStreamResponse res = sdk.stream().delete() + .id("") .call(); - if (res.data().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -1631,11 +1604,11 @@ actions: } } - - target: $["paths"]["/stream/{id}"]["patch"] + - target: $["paths"]["/asset/request-upload"]["post"] update: x-codeSamples: - lang: java - label: updateStream + label: requestUpload source: |- package hello.world; @@ -1643,20 +1616,14 @@ actions: import java.util.List; import java.util.Map; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.FfmpegProfile; - import studio.livepeer.livepeer.models.components.Multistream; + import studio.livepeer.livepeer.models.components.NewAssetPayload; import studio.livepeer.livepeer.models.components.PlaybackPolicy; - import studio.livepeer.livepeer.models.components.Profile; - import studio.livepeer.livepeer.models.components.RecordingSpec; - import studio.livepeer.livepeer.models.components.StreamPatchPayload; - import studio.livepeer.livepeer.models.components.Target; - import studio.livepeer.livepeer.models.components.TargetSpec; import studio.livepeer.livepeer.models.components.TranscodeProfile; import studio.livepeer.livepeer.models.components.TranscodeProfileEncoder; import studio.livepeer.livepeer.models.components.TranscodeProfileProfile; import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UpdateStreamResponse; + import studio.livepeer.livepeer.models.operations.RequestUploadResponse; public class Application { @@ -1666,57 +1633,71 @@ actions: .apiKey("") .build(); - UpdateStreamResponse res = sdk.stream().update() - .id("") - .streamPatchPayload(StreamPatchPayload.builder() - .record(false) - .multistream(Multistream.builder() - .targets(List.of( - Target.builder() - .profile("720p0") - .videoOnly(false) - .id("PUSH123") - .spec(TargetSpec.builder() - .url("rtmps://live.my-service.tv/channel/secretKey") - .name("My target") - .build()) - .build())) - .build()) - .playbackPolicy(PlaybackPolicy.builder() - .type(Type.WEBHOOK) - .webhookId("1bde4o2i6xycudoy") - .webhookContext(Map.ofEntries( - Map.entry("streamerId", "my-custom-id"))) - .refreshInterval(600d) - .build()) - .profiles(List.of( - FfmpegProfile.builder() - .width(1280L) - .name("720p") - .height(720L) - .bitrate(3000000L) - .fps(30L) - .fpsDen(1L) - .quality(23L) - .gop("2") - .profile(Profile.H264_BASELINE) - .build())) - .recordingSpec(RecordingSpec.builder() - .profiles(List.of( - TranscodeProfile.builder() - .bitrate(3000000L) - .width(1280L) - .name("720p") - .height(720L) - .quality(23L) - .fps(30L) - .fpsDen(1L) - .gop("2") - .profile(TranscodeProfileProfile.H264_BASELINE) - .encoder(TranscodeProfileEncoder.H264) - .build())) - .build()) + NewAssetPayload req = NewAssetPayload.builder() + .name("filename.mp4") + .staticMp4(true) + .playbackPolicy(PlaybackPolicy.builder() + .type(Type.WEBHOOK) + .webhookId("1bde4o2i6xycudoy") + .webhookContext(Map.ofEntries( + Map.entry("streamerId", "my-custom-id"))) + .refreshInterval(600d) .build()) + .profiles(List.of( + TranscodeProfile.builder() + .bitrate(3000000L) + .width(1280L) + .name("720p") + .height(720L) + .quality(23L) + .fps(30L) + .fpsDen(1L) + .gop("2") + .profile(TranscodeProfileProfile.H264_BASELINE) + .encoder(TranscodeProfileEncoder.H264) + .build())) + .build(); + + RequestUploadResponse res = sdk.asset().create() + .request(req) + .call(); + + if (res.data().isPresent()) { + // handle response + } + } catch (SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } + } + - target: $["paths"]["/access-control/signing-key/{keyId}"]["delete"] + update: + x-codeSamples: + - lang: java + label: deleteSigningKey + source: |- + package hello.world; + + import java.lang.Exception; + import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.errors.SDKError; + import studio.livepeer.livepeer.models.operations.DeleteSigningKeyResponse; + + public class Application { + + public static void main(String[] args) throws Exception { + try { + Livepeer sdk = Livepeer.builder() + .apiKey("") + .build(); + + DeleteSigningKeyResponse res = sdk.accessControl().delete() + .keyId("") .call(); // handle response @@ -1730,18 +1711,18 @@ actions: } } - - target: $["paths"]["/multistream/target"]["get"] + - target: $["paths"]["/stream/{id}/clips"]["get"] update: x-codeSamples: - lang: java - label: getMultistreamTargets + label: getClips source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetMultistreamTargetsResponse; + import studio.livepeer.livepeer.models.operations.GetClipsResponse; public class Application { @@ -1751,7 +1732,8 @@ actions: .apiKey("") .build(); - GetMultistreamTargetsResponse res = sdk.multistream().getAll() + GetClipsResponse res = sdk.stream().getClips() + .id("") .call(); if (res.data().isPresent()) { @@ -1767,18 +1749,18 @@ actions: } } - - target: $["paths"]["/multistream/target/{id}"]["delete"] + - target: $["paths"]["/task/{taskId}"]["get"] update: x-codeSamples: - lang: java - label: deleteMultistreamTarget + label: getTask source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteMultistreamTargetResponse; + import studio.livepeer.livepeer.models.operations.GetTaskResponse; public class Application { @@ -1788,11 +1770,13 @@ actions: .apiKey("") .build(); - DeleteMultistreamTargetResponse res = sdk.multistream().delete() - .id("") + GetTaskResponse res = sdk.task().get() + .taskId("") .call(); - // handle response + if (res.task().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -1803,18 +1787,18 @@ actions: } } - - target: $["paths"]["/stream/{id}/terminate"]["delete"] + - target: $["paths"]["/stream/{id}"]["get"] update: x-codeSamples: - lang: java - label: terminateStream + label: getStream source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.TerminateStreamResponse; + import studio.livepeer.livepeer.models.operations.GetStreamResponse; public class Application { @@ -1824,11 +1808,13 @@ actions: .apiKey("") .build(); - TerminateStreamResponse res = sdk.stream().terminate() - .id("") + GetStreamResponse res = sdk.stream().get() + .id("") .call(); - // handle response + if (res.stream().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -1839,19 +1825,19 @@ actions: } } - - target: $["paths"]["/data/views/query/creator"]["get"] + - target: $["paths"]["/room/{id}/egress"]["post"] update: x-codeSamples: - lang: java - label: getCreatorViewershipMetrics + label: startRoomEgress source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.RoomEgressPayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetCreatorViewershipMetricsRequest; - import studio.livepeer.livepeer.models.operations.GetCreatorViewershipMetricsResponse; + import studio.livepeer.livepeer.models.operations.StartRoomEgressResponse; public class Application { @@ -1861,14 +1847,56 @@ actions: .apiKey("") .build(); - GetCreatorViewershipMetricsRequest req = GetCreatorViewershipMetricsRequest.builder() + StartRoomEgressResponse res = sdk.room().startEgress() + .id("") + .roomEgressPayload(RoomEgressPayload.builder() + .streamId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") + .build()) + .call(); + + // handle response + } catch (SDKError e) { + // handle exception + throw e; + } catch (Exception e) { + // handle exception + throw e; + } + + } + } + - target: $["paths"]["/room/{id}/user"]["post"] + update: + x-codeSamples: + - lang: java + label: createRoomUser + source: |- + package hello.world; + + import java.lang.Exception; + import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.RoomUserPayload; + import studio.livepeer.livepeer.models.errors.SDKError; + import studio.livepeer.livepeer.models.operations.CreateRoomUserResponse; + + public class Application { + + public static void main(String[] args) throws Exception { + try { + Livepeer sdk = Livepeer.builder() + .apiKey("") .build(); - GetCreatorViewershipMetricsResponse res = sdk.metrics().getCreatorViewership() - .request(req) + CreateRoomUserResponse res = sdk.room().createUser() + .id("") + .roomUserPayload(RoomUserPayload.builder() + .name("name") + .canPublish(true) + .canPublishData(true) + .build()) .call(); - if (res.data().isPresent()) { + if (res.roomUserResponse().isPresent()) { // handle response } } catch (SDKError e) { @@ -1881,18 +1909,18 @@ actions: } } - - target: $["paths"]["/asset/{assetId}"]["delete"] + - target: $["paths"]["/room/{id}/user/{userId}"]["delete"] update: x-codeSamples: - lang: java - label: deleteAsset + label: deleteRoomUser source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.DeleteAssetResponse; + import studio.livepeer.livepeer.models.operations.DeleteRoomUserResponse; public class Application { @@ -1902,8 +1930,9 @@ actions: .apiKey("") .build(); - DeleteAssetResponse res = sdk.asset().delete() - .assetId("") + DeleteRoomUserResponse res = sdk.room().deleteUser() + .id("") + .userId("") .call(); // handle response @@ -1917,19 +1946,32 @@ actions: } } - - target: $["paths"]["/stream/{parentId}/sessions"]["get"] + - target: $["paths"]["/stream/{id}"]["patch"] update: x-codeSamples: - lang: java - label: getRecordedSessions + label: updateStream source: |- package hello.world; import java.lang.Exception; + import java.util.List; + import java.util.Map; import studio.livepeer.livepeer.Livepeer; + import studio.livepeer.livepeer.models.components.FfmpegProfile; + import studio.livepeer.livepeer.models.components.Multistream; + import studio.livepeer.livepeer.models.components.PlaybackPolicy; + import studio.livepeer.livepeer.models.components.Profile; + import studio.livepeer.livepeer.models.components.RecordingSpec; + import studio.livepeer.livepeer.models.components.StreamPatchPayload; + import studio.livepeer.livepeer.models.components.Target; + import studio.livepeer.livepeer.models.components.TargetSpec; + import studio.livepeer.livepeer.models.components.TranscodeProfile; + import studio.livepeer.livepeer.models.components.TranscodeProfileEncoder; + import studio.livepeer.livepeer.models.components.TranscodeProfileProfile; + import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetRecordedSessionsResponse; - import studio.livepeer.livepeer.models.operations.Record; + import studio.livepeer.livepeer.models.operations.UpdateStreamResponse; public class Application { @@ -1939,14 +1981,60 @@ actions: .apiKey("") .build(); - GetRecordedSessionsResponse res = sdk.session().getRecorded() - .parentId("") - .record(Record.of(true)) + UpdateStreamResponse res = sdk.stream().update() + .id("") + .streamPatchPayload(StreamPatchPayload.builder() + .record(false) + .multistream(Multistream.builder() + .targets(List.of( + Target.builder() + .profile("720p0") + .videoOnly(false) + .id("PUSH123") + .spec(TargetSpec.builder() + .url("rtmps://live.my-service.tv/channel/secretKey") + .name("My target") + .build()) + .build())) + .build()) + .playbackPolicy(PlaybackPolicy.builder() + .type(Type.WEBHOOK) + .webhookId("1bde4o2i6xycudoy") + .webhookContext(Map.ofEntries( + Map.entry("streamerId", "my-custom-id"))) + .refreshInterval(600d) + .build()) + .profiles(List.of( + FfmpegProfile.builder() + .width(1280L) + .name("720p") + .height(720L) + .bitrate(3000000L) + .fps(30L) + .fpsDen(1L) + .quality(23L) + .gop("2") + .profile(Profile.H264_BASELINE) + .build())) + .recordingSpec(RecordingSpec.builder() + .profiles(List.of( + TranscodeProfile.builder() + .bitrate(3000000L) + .width(1280L) + .name("720p") + .height(720L) + .quality(23L) + .fps(30L) + .fpsDen(1L) + .gop("2") + .profile(TranscodeProfileProfile.H264_BASELINE) + .encoder(TranscodeProfileEncoder.H264) + .build())) + .build()) + .build()) .call(); - if (res.data().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -1957,19 +2045,18 @@ actions: } } - - target: $["paths"]["/room/{id}/egress"]["post"] + - target: $["paths"]["/room/{id}/user/{userId}"]["get"] update: x-codeSamples: - lang: java - label: startRoomEgress + label: getRoomUser source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.RoomEgressPayload; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.StartRoomEgressResponse; + import studio.livepeer.livepeer.models.operations.GetRoomUserResponse; public class Application { @@ -1979,14 +2066,14 @@ actions: .apiKey("") .build(); - StartRoomEgressResponse res = sdk.room().startEgress() - .id("") - .roomEgressPayload(RoomEgressPayload.builder() - .streamId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") - .build()) + GetRoomUserResponse res = sdk.room().getUser() + .id("") + .userId("") .call(); - // handle response + if (res.getRoomUserResponse().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -1997,18 +2084,18 @@ actions: } } - - target: $["paths"]["/stream/{id}/start-pull"]["post"] + - target: $["paths"]["/webhook/{id}"]["get"] update: x-codeSamples: - lang: java - label: startPullStream + label: getWebhook source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.StartPullStreamResponse; + import studio.livepeer.livepeer.models.operations.GetWebhookResponse; public class Application { @@ -2018,11 +2105,13 @@ actions: .apiKey("") .build(); - StartPullStreamResponse res = sdk.stream().startPull() - .id("") + GetWebhookResponse res = sdk.webhook().get() + .id("") .call(); - // handle response + if (res.webhook().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -2033,18 +2122,18 @@ actions: } } - - target: $["paths"]["/webhook/{id}/log/{logId}/resend"]["post"] + - target: $["paths"]["/session/{id}"]["get"] update: x-codeSamples: - lang: java - label: resendWebhook + label: getSession source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.ResendWebhookResponse; + import studio.livepeer.livepeer.models.operations.GetSessionResponse; public class Application { @@ -2054,12 +2143,11 @@ actions: .apiKey("") .build(); - ResendWebhookResponse res = sdk.webhook().resendLog() - .id("") - .logId("") + GetSessionResponse res = sdk.session().get() + .id("") .call(); - if (res.webhookLog().isPresent()) { + if (res.session().isPresent()) { // handle response } } catch (SDKError e) { @@ -2072,34 +2160,18 @@ actions: } } - - target: $["paths"]["/stream"]["post"] + - target: $["paths"]["/asset/{assetId}"]["delete"] update: x-codeSamples: - lang: java - label: createStream + label: deleteAsset source: |- package hello.world; import java.lang.Exception; - import java.util.List; - import java.util.Map; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.FfmpegProfile; - import studio.livepeer.livepeer.models.components.Location; - import studio.livepeer.livepeer.models.components.Multistream; - import studio.livepeer.livepeer.models.components.NewStreamPayload; - import studio.livepeer.livepeer.models.components.NewStreamPayloadRecordingSpec; - import studio.livepeer.livepeer.models.components.PlaybackPolicy; - import studio.livepeer.livepeer.models.components.Profile; - import studio.livepeer.livepeer.models.components.Pull; - import studio.livepeer.livepeer.models.components.Target; - import studio.livepeer.livepeer.models.components.TargetSpec; - import studio.livepeer.livepeer.models.components.TranscodeProfile; - import studio.livepeer.livepeer.models.components.TranscodeProfileEncoder; - import studio.livepeer.livepeer.models.components.TranscodeProfileProfile; - import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.CreateStreamResponse; + import studio.livepeer.livepeer.models.operations.DeleteAssetResponse; public class Application { @@ -2109,73 +2181,11 @@ actions: .apiKey("") .build(); - NewStreamPayload req = NewStreamPayload.builder() - .name("test_stream") - .pull(Pull.builder() - .source("https://myservice.com/live/stream.flv") - .headers(Map.ofEntries( - Map.entry("Authorization", "Bearer 123"))) - .location(Location.builder() - .lat(39.739d) - .lon(-104.988d) - .build()) - .build()) - .playbackPolicy(PlaybackPolicy.builder() - .type(Type.WEBHOOK) - .webhookId("1bde4o2i6xycudoy") - .webhookContext(Map.ofEntries( - Map.entry("streamerId", "my-custom-id"))) - .refreshInterval(600d) - .build()) - .profiles(List.of( - FfmpegProfile.builder() - .width(1280L) - .name("720p") - .height(720L) - .bitrate(3000000L) - .fps(30L) - .fpsDen(1L) - .quality(23L) - .gop("2") - .profile(Profile.H264_BASELINE) - .build())) - .record(false) - .recordingSpec(NewStreamPayloadRecordingSpec.builder() - .profiles(List.of( - TranscodeProfile.builder() - .bitrate(3000000L) - .width(1280L) - .name("720p") - .height(720L) - .quality(23L) - .fps(30L) - .fpsDen(1L) - .gop("2") - .profile(TranscodeProfileProfile.H264_BASELINE) - .encoder(TranscodeProfileEncoder.H264) - .build())) - .build()) - .multistream(Multistream.builder() - .targets(List.of( - Target.builder() - .profile("720p0") - .videoOnly(false) - .id("PUSH123") - .spec(TargetSpec.builder() - .url("rtmps://live.my-service.tv/channel/secretKey") - .name("My target") - .build()) - .build())) - .build()) - .build(); - - CreateStreamResponse res = sdk.stream().create() - .request(req) + DeleteAssetResponse res = sdk.asset().delete() + .assetId("") .call(); - if (res.stream().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -2186,22 +2196,20 @@ actions: } } - - target: $["paths"]["/asset/{assetId}"]["patch"] + - target: $["paths"]["/data/views/now"]["get"] update: x-codeSamples: - lang: java - label: updateAsset + label: getRealtimeViewershipNow source: |- package hello.world; import java.lang.Exception; - import java.util.Map; + import java.util.List; import studio.livepeer.livepeer.Livepeer; - import studio.livepeer.livepeer.models.components.AssetPatchPayload; - import studio.livepeer.livepeer.models.components.PlaybackPolicy; - import studio.livepeer.livepeer.models.components.Type; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UpdateAssetResponse; + import studio.livepeer.livepeer.models.operations.BreakdownBy; + import studio.livepeer.livepeer.models.operations.GetRealtimeViewershipNowResponse; public class Application { @@ -2211,21 +2219,14 @@ actions: .apiKey("") .build(); - UpdateAssetResponse res = sdk.asset().update() - .assetId("") - .assetPatchPayload(AssetPatchPayload.builder() - .name("filename.mp4") - .playbackPolicy(PlaybackPolicy.builder() - .type(Type.WEBHOOK) - .webhookId("1bde4o2i6xycudoy") - .webhookContext(Map.ofEntries( - Map.entry("streamerId", "my-custom-id"))) - .refreshInterval(600d) - .build()) - .build()) + GetRealtimeViewershipNowResponse res = sdk.metrics().getRealtimeViewership() + .playbackId("") + .creatorId("") + .breakdownBy(List.of( + BreakdownBy.PLAYBACK_ID)) .call(); - if (res.asset().isPresent()) { + if (res.data().isPresent()) { // handle response } } catch (SDKError e) { @@ -2238,18 +2239,18 @@ actions: } } - - target: $["paths"]["/session/{id}"]["get"] + - target: $["paths"]["/access-control/signing-key"]["get"] update: x-codeSamples: - lang: java - label: getSession + label: getSigningKeys source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetSessionResponse; + import studio.livepeer.livepeer.models.operations.GetSigningKeysResponse; public class Application { @@ -2259,11 +2260,10 @@ actions: .apiKey("") .build(); - GetSessionResponse res = sdk.session().get() - .id("") + GetSigningKeysResponse res = sdk.accessControl().getAll() .call(); - if (res.session().isPresent()) { + if (res.data().isPresent()) { // handle response } } catch (SDKError e) { @@ -2276,18 +2276,18 @@ actions: } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] + - target: $["paths"]["/stream/{id}/multistream/{targetId}"]["delete"] update: x-codeSamples: - lang: java - label: getSigningKey + label: removeMultistreamTarget source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetSigningKeyResponse; + import studio.livepeer.livepeer.models.operations.RemoveMultistreamTargetResponse; public class Application { @@ -2297,13 +2297,12 @@ actions: .apiKey("") .build(); - GetSigningKeyResponse res = sdk.accessControl().get() - .keyId("") + RemoveMultistreamTargetResponse res = sdk.stream().removeMultistreamTarget() + .id("") + .targetId("") .call(); - if (res.signingKey().isPresent()) { - // handle response - } + // handle response } catch (SDKError e) { // handle exception throw e; @@ -2314,18 +2313,18 @@ actions: } } - - target: $["paths"]["/stream/{id}"]["get"] + - target: $["paths"]["/webhook/{id}"]["delete"] update: x-codeSamples: - lang: java - label: getStream + label: deleteWebhook source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetStreamResponse; + import studio.livepeer.livepeer.models.operations.DeleteWebhookResponse; public class Application { @@ -2335,11 +2334,11 @@ actions: .apiKey("") .build(); - GetStreamResponse res = sdk.stream().get() - .id("") + DeleteWebhookResponse res = sdk.webhook().delete() + .id("") .call(); - if (res.stream().isPresent()) { + if (res.webhook().isPresent()) { // handle response } } catch (SDKError e) { @@ -2352,18 +2351,18 @@ actions: } } - - target: $["paths"]["/webhook/{id}/log/{logId}"]["get"] + - target: $["paths"]["/access-control/signing-key/{keyId}"]["get"] update: x-codeSamples: - lang: java - label: getWebhookLog + label: getSigningKey source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetWebhookLogResponse; + import studio.livepeer.livepeer.models.operations.GetSigningKeyResponse; public class Application { @@ -2373,12 +2372,11 @@ actions: .apiKey("") .build(); - GetWebhookLogResponse res = sdk.webhook().getLog() - .id("") - .logId("") + GetSigningKeyResponse res = sdk.accessControl().get() + .keyId("") .call(); - if (res.webhookLog().isPresent()) { + if (res.signingKey().isPresent()) { // handle response } } catch (SDKError e) { @@ -2391,18 +2389,18 @@ actions: } } - - target: $["paths"]["/asset/{assetId}"]["get"] + - target: $["paths"]["/multistream/target"]["get"] update: x-codeSamples: - lang: java - label: getAsset + label: getMultistreamTargets source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetAssetResponse; + import studio.livepeer.livepeer.models.operations.GetMultistreamTargetsResponse; public class Application { @@ -2412,11 +2410,10 @@ actions: .apiKey("") .build(); - GetAssetResponse res = sdk.asset().get() - .assetId("") + GetMultistreamTargetsResponse res = sdk.multistream().getAll() .call(); - if (res.asset().isPresent()) { + if (res.data().isPresent()) { // handle response } } catch (SDKError e) { @@ -2429,19 +2426,18 @@ actions: } } - - target: $["paths"]["/access-control/signing-key/{keyId}"]["patch"] + - target: $["paths"]["/session"]["get"] update: x-codeSamples: - lang: java - label: updateSigningKey + label: getSessions source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.UpdateSigningKeyRequestBody; - import studio.livepeer.livepeer.models.operations.UpdateSigningKeyResponse; + import studio.livepeer.livepeer.models.operations.GetSessionsResponse; public class Application { @@ -2451,13 +2447,12 @@ actions: .apiKey("") .build(); - UpdateSigningKeyResponse res = sdk.accessControl().update() - .keyId("") - .requestBody(UpdateSigningKeyRequestBody.builder() - .build()) + GetSessionsResponse res = sdk.session().getAll() .call(); - // handle response + if (res.data().isPresent()) { + // handle response + } } catch (SDKError e) { // handle exception throw e; @@ -2468,18 +2463,19 @@ actions: } } - - target: $["paths"]["/task"]["get"] + - target: $["paths"]["/data/views/query/creator"]["get"] update: x-codeSamples: - lang: java - label: getTasks + label: getCreatorViewershipMetrics source: |- package hello.world; import java.lang.Exception; import studio.livepeer.livepeer.Livepeer; import studio.livepeer.livepeer.models.errors.SDKError; - import studio.livepeer.livepeer.models.operations.GetTasksResponse; + import studio.livepeer.livepeer.models.operations.GetCreatorViewershipMetricsRequest; + import studio.livepeer.livepeer.models.operations.GetCreatorViewershipMetricsResponse; public class Application { @@ -2489,7 +2485,11 @@ actions: .apiKey("") .build(); - GetTasksResponse res = sdk.task().getAll() + GetCreatorViewershipMetricsRequest req = GetCreatorViewershipMetricsRequest.builder() + .build(); + + GetCreatorViewershipMetricsResponse res = sdk.metrics().getCreatorViewership() + .request(req) .call(); if (res.data().isPresent()) { diff --git a/docs/models/components/Task.md b/docs/models/components/Task.md index 31a0363..c1b8b91 100644 --- a/docs/models/components/Task.md +++ b/docs/models/components/Task.md @@ -11,6 +11,7 @@ | `scheduledAt` | *Optional* | :heavy_minus_sign: | Timestamp (in milliseconds) at which the task was scheduled for
execution (e.g. after file upload finished).
| 1587667174725 | | `inputAssetId` | *Optional* | :heavy_minus_sign: | ID of the input asset | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `outputAssetId` | *Optional* | :heavy_minus_sign: | ID of the output asset | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | +| `projectId` | *Optional* | :heavy_minus_sign: | ID of the project | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `requesterId` | *Optional* | :heavy_minus_sign: | ID of the requester hash(IP + SALT + PlaybackId) | 09F8B46C-61A0-4254-9875-F71F4C605BC7 | | `params` | [Optional](../../models/components/Params.md) | :heavy_minus_sign: | Parameters of the task | | | `status` | [Optional](../../models/components/TaskStatus.md) | :heavy_minus_sign: | Status of the task | | diff --git a/docs/sdks/multistream/README.md b/docs/sdks/multistream/README.md index 08093e2..3188371 100644 --- a/docs/sdks/multistream/README.md +++ b/docs/sdks/multistream/README.md @@ -150,7 +150,7 @@ public class Application { .build(); GetMultistreamTargetResponse res = sdk.multistream().get() - .id("") + .id("") .call(); if (res.multistreamTarget().isPresent()) { @@ -209,7 +209,7 @@ public class Application { .build(); UpdateMultistreamTargetResponse res = sdk.multistream().update() - .id("") + .id("") .multistreamTargetPatchPayload(MultistreamTargetPatchPayload.builder() .url("rtmps://live.my-service.tv/channel/secretKey") .build()) @@ -271,7 +271,7 @@ public class Application { .build(); DeleteMultistreamTargetResponse res = sdk.multistream().delete() - .id("") + .id("") .call(); // handle response diff --git a/docs/sdks/playback/README.md b/docs/sdks/playback/README.md index f2477d3..495995e 100644 --- a/docs/sdks/playback/README.md +++ b/docs/sdks/playback/README.md @@ -32,7 +32,7 @@ public class Application { .build(); GetPlaybackInfoResponse res = sdk.playback().get() - .id("") + .id("") .call(); if (res.playbackInfo().isPresent()) { diff --git a/docs/sdks/room/README.md b/docs/sdks/room/README.md index 1580b9e..0664ac2 100644 --- a/docs/sdks/room/README.md +++ b/docs/sdks/room/README.md @@ -96,7 +96,7 @@ public class Application { .build(); GetRoomResponse res = sdk.room().get() - .id("") + .id("") .call(); if (res.room().isPresent()) { @@ -156,7 +156,7 @@ public class Application { .build(); DeleteRoomResponse res = sdk.room().delete() - .id("") + .id("") .call(); // handle response @@ -217,7 +217,7 @@ public class Application { .build(); StartRoomEgressResponse res = sdk.room().startEgress() - .id("") + .id("") .roomEgressPayload(RoomEgressPayload.builder() .streamId("aac12556-4d65-4d34-9fb6-d1f0985eb0a9") .build()) @@ -279,7 +279,7 @@ public class Application { .build(); StopRoomEgressResponse res = sdk.room().stopEgress() - .id("") + .id("") .call(); // handle response @@ -341,7 +341,7 @@ public class Application { .build(); CreateRoomUserResponse res = sdk.room().createUser() - .id("") + .id("") .roomUserPayload(RoomUserPayload.builder() .name("name") .canPublish(true) @@ -407,7 +407,7 @@ public class Application { .build(); GetRoomUserResponse res = sdk.room().getUser() - .id("") + .id("") .userId("") .call(); @@ -470,7 +470,7 @@ public class Application { .build(); UpdateRoomUserResponse res = sdk.room().updateUser() - .id("") + .id("") .userId("") .roomUserUpdatePayload(RoomUserUpdatePayload.builder() .canPublish(true) @@ -535,7 +535,7 @@ public class Application { .build(); DeleteRoomUserResponse res = sdk.room().deleteUser() - .id("") + .id("") .userId("") .call(); diff --git a/docs/sdks/session/README.md b/docs/sdks/session/README.md index b08c618..8740386 100644 --- a/docs/sdks/session/README.md +++ b/docs/sdks/session/README.md @@ -35,7 +35,7 @@ public class Application { .build(); GetSessionClipsResponse res = sdk.session().getClips() - .id("") + .id("") .call(); if (res.data().isPresent()) { @@ -144,7 +144,7 @@ public class Application { .build(); GetSessionResponse res = sdk.session().get() - .id("") + .id("") .call(); if (res.session().isPresent()) { @@ -204,7 +204,7 @@ public class Application { GetRecordedSessionsResponse res = sdk.session().getRecorded() .parentId("") - .record(Record.of(true)) + .record(Record.of(trueL)) .call(); if (res.data().isPresent()) { diff --git a/docs/sdks/stream/README.md b/docs/sdks/stream/README.md index bf313be..7e11d4d 100644 --- a/docs/sdks/stream/README.md +++ b/docs/sdks/stream/README.md @@ -247,7 +247,7 @@ public class Application { .build(); GetStreamResponse res = sdk.stream().get() - .id("") + .id("") .call(); if (res.stream().isPresent()) { @@ -319,7 +319,7 @@ public class Application { .build(); UpdateStreamResponse res = sdk.stream().update() - .id("") + .id("") .streamPatchPayload(StreamPatchPayload.builder() .record(false) .multistream(Multistream.builder() @@ -429,7 +429,7 @@ public class Application { .build(); DeleteStreamResponse res = sdk.stream().delete() - .id("") + .id("") .call(); // handle response @@ -493,7 +493,7 @@ public class Application { .build(); TerminateStreamResponse res = sdk.stream().terminate() - .id("") + .id("") .call(); // handle response @@ -556,7 +556,7 @@ public class Application { .build(); StartPullStreamResponse res = sdk.stream().startPull() - .id("") + .id("") .call(); // handle response @@ -679,7 +679,7 @@ public class Application { .build(); GetClipsResponse res = sdk.stream().getClips() - .id("") + .id("") .call(); if (res.data().isPresent()) { @@ -739,7 +739,7 @@ public class Application { .build(); AddMultistreamTargetResponse res = sdk.stream().addMultistreamTarget() - .id("") + .id("") .targetAddPayload(TargetAddPayload.builder() .profile("720p0") .videoOnly(false) @@ -805,7 +805,7 @@ public class Application { .build(); RemoveMultistreamTargetResponse res = sdk.stream().removeMultistreamTarget() - .id("") + .id("") .targetId("") .call(); diff --git a/docs/sdks/webhook/README.md b/docs/sdks/webhook/README.md index f48748e..e36364c 100644 --- a/docs/sdks/webhook/README.md +++ b/docs/sdks/webhook/README.md @@ -163,7 +163,7 @@ public class Application { .build(); GetWebhookResponse res = sdk.webhook().get() - .id("") + .id("") .call(); if (res.webhook().isPresent()) { @@ -224,7 +224,7 @@ public class Application { .build(); UpdateWebhookResponse res = sdk.webhook().update() - .id("") + .id("") .webhook(WebhookInput.builder() .name("test_webhook") .url("https://my-service.com/webhook") @@ -293,7 +293,7 @@ public class Application { .build(); DeleteWebhookResponse res = sdk.webhook().delete() - .id("") + .id("") .call(); if (res.webhook().isPresent()) { @@ -351,7 +351,7 @@ public class Application { .build(); GetWebhookLogsResponse res = sdk.webhook().getLogs() - .id("") + .id("") .call(); if (res.data().isPresent()) { @@ -409,7 +409,7 @@ public class Application { .build(); GetWebhookLogResponse res = sdk.webhook().getLog() - .id("") + .id("") .logId("") .call(); @@ -472,7 +472,7 @@ public class Application { .build(); ResendWebhookResponse res = sdk.webhook().resendLog() - .id("") + .id("") .logId("") .call(); diff --git a/src/main/java/studio/livepeer/livepeer/SDKConfiguration.java b/src/main/java/studio/livepeer/livepeer/SDKConfiguration.java index a9cb585..ce8774d 100644 --- a/src/main/java/studio/livepeer/livepeer/SDKConfiguration.java +++ b/src/main/java/studio/livepeer/livepeer/SDKConfiguration.java @@ -23,9 +23,9 @@ public Optional securitySource() { public int serverIdx = 0; public String language = "java"; public String openapiDocVersion = "1.0.0"; - public String sdkVersion = "0.5.0"; - public String genVersion = "2.404.1"; - public String userAgent = "speakeasy-sdk/java 0.5.0 2.404.1 1.0.0 studio.livepeer.livepeer"; + public String sdkVersion = "0.5.1"; + public String genVersion = "2.409.8"; + public String userAgent = "speakeasy-sdk/java 0.5.1 2.409.8 1.0.0 studio.livepeer.livepeer"; private Hooks _hooks = createHooks(); diff --git a/src/main/java/studio/livepeer/livepeer/models/components/AssetSpec.java b/src/main/java/studio/livepeer/livepeer/models/components/AssetSpec.java index 6cb5a01..286e682 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/AssetSpec.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/AssetSpec.java @@ -221,8 +221,7 @@ public Builder nftMetadata(Optional nftMetadata) { public AssetSpec build() { if (nftMetadataTemplate == null) { nftMetadataTemplate = _SINGLETON_VALUE_NftMetadataTemplate.value(); - } - return new AssetSpec( + } return new AssetSpec( nftMetadataTemplate, nftMetadata); } diff --git a/src/main/java/studio/livepeer/livepeer/models/components/Custom.java b/src/main/java/studio/livepeer/livepeer/models/components/Custom.java index 71daf05..60871bb 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/Custom.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/Custom.java @@ -229,8 +229,7 @@ public Builder headers(Optional> headers) { public Custom build() { if (method == null) { method = _SINGLETON_VALUE_Method.value(); - } - return new Custom( + } return new Custom( url, method, headers); diff --git a/src/main/java/studio/livepeer/livepeer/models/components/GetRoomUserResponse.java b/src/main/java/studio/livepeer/livepeer/models/components/GetRoomUserResponse.java index c2f7667..d0300d8 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/GetRoomUserResponse.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/GetRoomUserResponse.java @@ -361,8 +361,7 @@ public Builder metadata(Optional metadata) { public GetRoomUserResponse build() { if (isPublisher == null) { isPublisher = _SINGLETON_VALUE_IsPublisher.value(); - } - return new GetRoomUserResponse( + } return new GetRoomUserResponse( id, joinedAt, name, diff --git a/src/main/java/studio/livepeer/livepeer/models/components/RoomUserUpdatePayload.java b/src/main/java/studio/livepeer/livepeer/models/components/RoomUserUpdatePayload.java index cfaa2ec..7d0f4ac 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/RoomUserUpdatePayload.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/RoomUserUpdatePayload.java @@ -245,8 +245,7 @@ public RoomUserUpdatePayload build() { } if (canPublishData == null) { canPublishData = _SINGLETON_VALUE_CanPublishData.value(); - } - return new RoomUserUpdatePayload( + } return new RoomUserUpdatePayload( canPublish, canPublishData, metadata); diff --git a/src/main/java/studio/livepeer/livepeer/models/components/Spec.java b/src/main/java/studio/livepeer/livepeer/models/components/Spec.java index ccfe255..f1ed21c 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/Spec.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/Spec.java @@ -221,8 +221,7 @@ public Builder nftMetadata(Optional nftMetadata) { public Spec build() { if (nftMetadataTemplate == null) { nftMetadataTemplate = _SINGLETON_VALUE_NftMetadataTemplate.value(); - } - return new Spec( + } return new Spec( nftMetadataTemplate, nftMetadata); } diff --git a/src/main/java/studio/livepeer/livepeer/models/components/Target.java b/src/main/java/studio/livepeer/livepeer/models/components/Target.java index 046449f..a0dcdca 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/Target.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/Target.java @@ -323,8 +323,7 @@ public Builder spec(Optional spec) { public Target build() { if (videoOnly == null) { videoOnly = _SINGLETON_VALUE_VideoOnly.value(); - } - return new Target( + } return new Target( profile, videoOnly, id, diff --git a/src/main/java/studio/livepeer/livepeer/models/components/TargetAddPayload.java b/src/main/java/studio/livepeer/livepeer/models/components/TargetAddPayload.java index 84a3401..eec1b35 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/TargetAddPayload.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/TargetAddPayload.java @@ -323,8 +323,7 @@ public Builder spec(Optional spec) { public TargetAddPayload build() { if (videoOnly == null) { videoOnly = _SINGLETON_VALUE_VideoOnly.value(); - } - return new TargetAddPayload( + } return new TargetAddPayload( profile, videoOnly, id, diff --git a/src/main/java/studio/livepeer/livepeer/models/components/TargetOutput.java b/src/main/java/studio/livepeer/livepeer/models/components/TargetOutput.java index cfa4331..e313216 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/TargetOutput.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/TargetOutput.java @@ -244,8 +244,7 @@ public Builder id(Optional id) { public TargetOutput build() { if (videoOnly == null) { videoOnly = _SINGLETON_VALUE_VideoOnly.value(); - } - return new TargetOutput( + } return new TargetOutput( profile, videoOnly, id); diff --git a/src/main/java/studio/livepeer/livepeer/models/components/Task.java b/src/main/java/studio/livepeer/livepeer/models/components/Task.java index 82d95a6..c5777dc 100644 --- a/src/main/java/studio/livepeer/livepeer/models/components/Task.java +++ b/src/main/java/studio/livepeer/livepeer/models/components/Task.java @@ -65,6 +65,13 @@ public class Task { @JsonProperty("outputAssetId") private Optional outputAssetId; + /** + * ID of the project + */ + @JsonInclude(Include.NON_ABSENT) + @JsonProperty("projectId") + private Optional projectId; + /** * ID of the requester hash(IP + SALT + PlaybackId) */ @@ -101,6 +108,7 @@ public Task( @JsonProperty("scheduledAt") Optional scheduledAt, @JsonProperty("inputAssetId") Optional inputAssetId, @JsonProperty("outputAssetId") Optional outputAssetId, + @JsonProperty("projectId") Optional projectId, @JsonProperty("requesterId") Optional requesterId, @JsonProperty("params") Optional params, @JsonProperty("status") Optional status, @@ -111,6 +119,7 @@ public Task( Utils.checkNotNull(scheduledAt, "scheduledAt"); Utils.checkNotNull(inputAssetId, "inputAssetId"); Utils.checkNotNull(outputAssetId, "outputAssetId"); + Utils.checkNotNull(projectId, "projectId"); Utils.checkNotNull(requesterId, "requesterId"); Utils.checkNotNull(params, "params"); Utils.checkNotNull(status, "status"); @@ -121,6 +130,7 @@ public Task( this.scheduledAt = scheduledAt; this.inputAssetId = inputAssetId; this.outputAssetId = outputAssetId; + this.projectId = projectId; this.requesterId = requesterId; this.params = params; this.status = status; @@ -128,7 +138,7 @@ public Task( } public Task() { - this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); + this(Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); } /** @@ -182,6 +192,14 @@ public Optional outputAssetId() { return outputAssetId; } + /** + * ID of the project + */ + @JsonIgnore + public Optional projectId() { + return projectId; + } + /** * ID of the requester hash(IP + SALT + PlaybackId) */ @@ -333,6 +351,24 @@ public Task withOutputAssetId(Optional outputAssetId) { return this; } + /** + * ID of the project + */ + public Task withProjectId(String projectId) { + Utils.checkNotNull(projectId, "projectId"); + this.projectId = Optional.ofNullable(projectId); + return this; + } + + /** + * ID of the project + */ + public Task withProjectId(Optional projectId) { + Utils.checkNotNull(projectId, "projectId"); + this.projectId = projectId; + return this; + } + /** * ID of the requester hash(IP + SALT + PlaybackId) */ @@ -421,6 +457,7 @@ public boolean equals(java.lang.Object o) { Objects.deepEquals(this.scheduledAt, other.scheduledAt) && Objects.deepEquals(this.inputAssetId, other.inputAssetId) && Objects.deepEquals(this.outputAssetId, other.outputAssetId) && + Objects.deepEquals(this.projectId, other.projectId) && Objects.deepEquals(this.requesterId, other.requesterId) && Objects.deepEquals(this.params, other.params) && Objects.deepEquals(this.status, other.status) && @@ -436,6 +473,7 @@ public int hashCode() { scheduledAt, inputAssetId, outputAssetId, + projectId, requesterId, params, status, @@ -451,6 +489,7 @@ public String toString() { "scheduledAt", scheduledAt, "inputAssetId", inputAssetId, "outputAssetId", outputAssetId, + "projectId", projectId, "requesterId", requesterId, "params", params, "status", status, @@ -471,6 +510,8 @@ public final static class Builder { private Optional outputAssetId = Optional.empty(); + private Optional projectId = Optional.empty(); + private Optional requesterId = Optional.empty(); private Optional params = Optional.empty(); @@ -595,6 +636,24 @@ public Builder outputAssetId(Optional outputAssetId) { return this; } + /** + * ID of the project + */ + public Builder projectId(String projectId) { + Utils.checkNotNull(projectId, "projectId"); + this.projectId = Optional.ofNullable(projectId); + return this; + } + + /** + * ID of the project + */ + public Builder projectId(Optional projectId) { + Utils.checkNotNull(projectId, "projectId"); + this.projectId = projectId; + return this; + } + /** * ID of the requester hash(IP + SALT + PlaybackId) */ @@ -675,6 +734,7 @@ public Task build() { scheduledAt, inputAssetId, outputAssetId, + projectId, requesterId, params, status,