Skip to content

Latest commit

 

History

History
240 lines (171 loc) · 7.34 KB

README.md

File metadata and controls

240 lines (171 loc) · 7.34 KB

Session

(session())

Overview

Operations related to session api

Available Operations

getClips

Retrieve clips of a session

Example Usage

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;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            GetSessionClipsResponse res = sdk.session().getClips()
                .id("<value>")
                .call();

            if (res.data().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ ID of the parent session

Response

GetSessionClipsResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

getAll

Retrieve sessions

Example Usage

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;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            GetSessionsResponse res = sdk.session().getAll()
                .call();

            if (res.data().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Response

GetSessionsResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

get

Retrieve a session

Example Usage

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;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            GetSessionResponse res = sdk.session().get()
                .id("<value>")
                .call();

            if (res.session().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description
id String ✔️ ID of the session

Response

GetSessionResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*

getRecorded

Retrieve Recorded Sessions

Example Usage

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.GetRecordedSessionsResponse;
import studio.livepeer.livepeer.models.operations.Record;

public class Application {

    public static void main(String[] args) throws Exception {
        try {
            Livepeer sdk = Livepeer.builder()
                .apiKey("<YOUR_BEARER_TOKEN_HERE>")
                .build();

            GetRecordedSessionsResponse res = sdk.session().getRecorded()
                .parentId("<value>")
                .record(Record.of(true))
                .call();

            if (res.data().isPresent()) {
                // handle response
            }
        } catch (SDKError e) {
            // handle exception
            throw e;
        } catch (Exception e) {
            // handle exception
            throw e;
        }

    }
}

Parameters

Parameter Type Required Description Example
parentId String ✔️ ID of the parent stream
record Optional Flag indicating if the response should only include recorded
sessions
true

Response

GetRecordedSessionsResponse

Errors

Error Object Status Code Content Type
models/errors/SDKError 4xx-5xx */*