-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add other api services, token verifier & webhooks (#98)
- Loading branch information
1 parent
41793b4
commit ce81435
Showing
12 changed files
with
486 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,6 @@ wheel | |
setuptools | ||
twine | ||
auditwheel; sys_platform == 'linux' | ||
cibuildwheel | ||
cibuildwheel | ||
|
||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import aiohttp | ||
from livekit.protocol import egress as proto_egress | ||
from ._service import Service | ||
from .access_token import VideoGrants | ||
|
||
SVC = "Egress" | ||
|
||
|
||
class EgressService(Service): | ||
def __init__( | ||
self, session: aiohttp.ClientSession, url: str, api_key: str, api_secret: str | ||
): | ||
super().__init__(session, url, api_key, api_secret) | ||
|
||
async def start_room_composite_egress( | ||
self, start: proto_egress.RoomCompositeEgressRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"StartRoomCompositeEgress", | ||
start, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def start_web_egress( | ||
self, start: proto_egress.WebEgressRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"StartWebEgress", | ||
start, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def start_participant_egress( | ||
self, start: proto_egress.ParticipantEgressRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"StartParticipantEgress", | ||
start, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def start_track_composite_egress( | ||
self, start: proto_egress.TrackCompositeEgressRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"StartTrackCompositeEgress", | ||
start, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def start_track_egress( | ||
self, start: proto_egress.TrackEgressRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"StartTrackEgress", | ||
start, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def update_layout( | ||
self, update: proto_egress.UpdateLayoutRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"UpdateLayout", | ||
update, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def update_stream( | ||
self, update: proto_egress.UpdateStreamRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"UpdateStream", | ||
update, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) | ||
|
||
async def list_egress( | ||
self, list: proto_egress.ListEgressRequest | ||
) -> proto_egress.ListEgressResponse: | ||
return await self._client.request( | ||
SVC, | ||
"ListEgress", | ||
list, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.ListEgressResponse, | ||
) | ||
|
||
async def stop_egress( | ||
self, stop: proto_egress.StopEgressRequest | ||
) -> proto_egress.EgressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"StopEgress", | ||
stop, | ||
self._auth_header(VideoGrants(room_record=True)), | ||
proto_egress.EgressInfo, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import aiohttp | ||
from livekit.protocol import ingress as proto_ingress | ||
from ._service import Service | ||
from .access_token import VideoGrants | ||
|
||
SVC = "Ingress" | ||
|
||
|
||
class IngressService(Service): | ||
def __init__( | ||
self, session: aiohttp.ClientSession, url: str, api_key: str, api_secret: str | ||
): | ||
super().__init__(session, url, api_key, api_secret) | ||
|
||
async def create_ingress( | ||
self, create: proto_ingress.CreateIngressRequest | ||
) -> proto_ingress.IngressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"CreateIngress", | ||
create, | ||
self._auth_header(VideoGrants(ingress_admin=True)), | ||
proto_ingress.IngressInfo, | ||
) | ||
|
||
async def update_ingress( | ||
self, update: proto_ingress.UpdateIngressRequest | ||
) -> proto_ingress.IngressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"UpdateIngress", | ||
update, | ||
self._auth_header(VideoGrants(ingress_admin=True)), | ||
proto_ingress.IngressInfo, | ||
) | ||
|
||
async def list_ingress( | ||
self, list: proto_ingress.ListIngressRequest | ||
) -> proto_ingress.ListIngressResponse: | ||
return await self._client.request( | ||
SVC, | ||
"ListIngress", | ||
list, | ||
self._auth_header(VideoGrants(ingress_admin=True)), | ||
proto_ingress.ListIngressResponse, | ||
) | ||
|
||
async def delete_ingress( | ||
self, delete: proto_ingress.DeleteIngressRequest | ||
) -> proto_ingress.IngressInfo: | ||
return await self._client.request( | ||
SVC, | ||
"DeleteIngress", | ||
delete, | ||
self._auth_header(VideoGrants(ingress_admin=True)), | ||
proto_ingress.IngressInfo, | ||
) |
Oops, something went wrong.