symphony.bdk.core.service.stream.stream_service.OboStreamService#

class symphony.bdk.core.service.stream.stream_service.OboStreamService(streams_api: symphony.bdk.gen.pod_api.streams_api.StreamsApi, room_membership_api: symphony.bdk.gen.pod_api.room_membership_api.RoomMembershipApi, share_api: symphony.bdk.gen.agent_api.share_api.ShareApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#

Bases: object

Class exposing OBO-enabled endpoints for stream management.

__init__(streams_api: symphony.bdk.gen.pod_api.streams_api.StreamsApi, room_membership_api: symphony.bdk.gen.pod_api.room_membership_api.RoomMembershipApi, share_api: symphony.bdk.gen.agent_api.share_api.ShareApi, auth_session: symphony.bdk.core.auth.auth_session.AuthSession, retry_config: symphony.bdk.core.config.model.bdk_retry_config.BdkRetryConfig)#
Parameters
  • streams_api – a generated StreamsApi instance.

  • room_membership_api – a generated RoomMembershipApi instance.

  • share_api – a generated ShareApi instance.

  • auth_session – the bot session.

Methods

__init__(streams_api, room_membership_api, ...)

param streams_api

a generated StreamsApi instance.

add_member_to_room(user_id, room_id)

Adds a member to an existing room.

demote_owner_to_room_participant(user_id, ...)

Demotes room owner to a participant in the chat room.

get_stream(stream_id)

Returns information about a particular stream.

list_all_streams(stream_filter[, ...])

Returns an asynchronous of all the streams of which the requesting user is a member, sorted by creation date (ascending - oldest to newest).

list_streams(stream_filter[, skip, limit])

Returns a list of all the streams of which the requesting user is a member, sorted by creation date (ascending - oldest to newest).

promote_user_to_room_owner(user_id, room_id)

Promotes user to owner of the chat room.

remove_member_from_room(user_id, room_id)

Removes a member from an existing room.

share(stream_id, content)

Share third-party content, such as a news article, into the specified stream.

add_member_to_room(user_id: int, room_id: str)#

Adds a member to an existing room. Wraps the Add Member endpoint.

Parameters
  • user_id – the id of the user to be added to the room.

  • room_id – the id of the room in which to add the user.

Returns

None

demote_owner_to_room_participant(user_id: int, room_id: str)#

Demotes room owner to a participant in the chat room. Wraps the Demote Owner endpoint.

Parameters
  • user_id – the id of the room owner to be demoted.

  • room_id – the room id.

Returns

None

get_stream(stream_id: str) symphony.bdk.gen.pod_model.v2_stream_attributes.V2StreamAttributes#

Returns information about a particular stream. Wraps the Stream Info V2 endpoint.

Parameters

stream_id – the ID of the stream to be retrieved.

Returns

the information about the given stream.

list_all_streams(stream_filter: symphony.bdk.gen.pod_model.stream_filter.StreamFilter, chunk_size: int = 50, max_number: int = None) AsyncGenerator[symphony.bdk.gen.pod_model.stream_attributes.StreamAttributes, None]#

Returns an asynchronous of all the streams of which the requesting user is a member, sorted by creation date (ascending - oldest to newest). Wraps the List User Streams endpoint.

Parameters
  • stream_filter – the stream searching criteria.

  • chunk_size – the maximum number of elements to retrieve in one underlying HTTP call

  • max_number – the total maximum number of elements to retrieve

Returns

an asynchronous generator of the streams matching the search filter.

list_streams(stream_filter: symphony.bdk.gen.pod_model.stream_filter.StreamFilter, skip: int = 0, limit: int = 50) symphony.bdk.gen.pod_model.stream_list.StreamList#

Returns a list of all the streams of which the requesting user is a member, sorted by creation date (ascending - oldest to newest). Wraps the List User Streams endpoint.

Parameters
  • stream_filter – the stream searching criteria.

  • skip – number of stream results to skip.

  • limit – maximum number of streams to return.

Returns

the list of stream retrieved matching the search filter.

promote_user_to_room_owner(user_id: int, room_id: str)#

Promotes user to owner of the chat room. Wraps the Promote Owner endpoint.

Parameters
  • user_id – the id of the user to be promoted as owner.

  • room_id – the room id.

Returns

None

remove_member_from_room(user_id: int, room_id: str)#

Removes a member from an existing room. Wraps the Remove Member endpoint.

Parameters
  • user_id – the id of the user to be removed from the room.

  • room_id – the id of the room from which to remove the user.

Returns

None

share(stream_id: str, content: symphony.bdk.gen.agent_model.share_content.ShareContent) symphony.bdk.gen.agent_model.v2_message.V2Message#

Share third-party content, such as a news article, into the specified stream. The stream can be a chat room, an IM, or an MIM. Wraps the Share endpoint.

Parameters
  • stream_id – the id of the stream in which to share the given content.

  • content – the third-party content to be shared.

Returns

the created message.