Class APIController

java.lang.Object
com.bandwidth.controllers.BaseController
com.bandwidth.webrtc.controllers.APIController

public final class APIController
extends BaseController
This class lists all the endpoints of the groups.
  • Constructor Details

    • APIController

      public APIController​(Configuration config, HttpClient httpClient, java.util.Map<java.lang.String,​AuthManager> authManagers)
      Initializes the controller.
      Parameters:
      config - Configurations added in client.
      httpClient - Send HTTP requests and read the responses.
      authManagers - Apply authorization to requests.
    • APIController

      public APIController​(Configuration config, HttpClient httpClient, java.util.Map<java.lang.String,​AuthManager> authManagers, HttpCallback httpCallback)
      Initializes the controller with HTTPCallback.
      Parameters:
      config - Configurations added in client.
      httpClient - Send HTTP requests and read the responses.
      authManagers - Apply authorization to requests.
      httpCallback - Callback to be called before and after the HTTP call.
  • Method Details

    • createParticipant

      public ApiResponse<AccountsParticipantsResponse> createParticipant​(java.lang.String accountId, Participant body) throws ApiException, java.io.IOException
      Create a new participant under this account Participants are idempotent, so relevant parameters must be set in this function if desired.
      Parameters:
      accountId - Required parameter: Account ID
      body - Optional parameter: Participant parameters
      Returns:
      Returns the AccountsParticipantsResponse wrapped in ApiResponse response from the API call
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • createParticipantAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<AccountsParticipantsResponse>> createParticipantAsync​(java.lang.String accountId, Participant body)
      Create a new participant under this account Participants are idempotent, so relevant parameters must be set in this function if desired.
      Parameters:
      accountId - Required parameter: Account ID
      body - Optional parameter: Participant parameters
      Returns:
      Returns the AccountsParticipantsResponse wrapped in ApiResponse response from the API call
    • getParticipant

      public ApiResponse<Participant> getParticipant​(java.lang.String accountId, java.lang.String participantId) throws ApiException, java.io.IOException
      Get participant by ID.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      Returns:
      Returns the Participant wrapped in ApiResponse response from the API call
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • getParticipantAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<Participant>> getParticipantAsync​(java.lang.String accountId, java.lang.String participantId)
      Get participant by ID.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      Returns:
      Returns the Participant wrapped in ApiResponse response from the API call
    • deleteParticipant

      public ApiResponse<java.lang.Void> deleteParticipant​(java.lang.String accountId, java.lang.String participantId) throws ApiException, java.io.IOException
      Delete participant by ID.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Example:
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • deleteParticipantAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<java.lang.Void>> deleteParticipantAsync​(java.lang.String accountId, java.lang.String participantId)
      Delete participant by ID.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Example:
      Returns:
      Returns the Void wrapped in ApiResponse response from the API call
    • createSession

      public ApiResponse<Session> createSession​(java.lang.String accountId, Session body) throws ApiException, java.io.IOException
      Create a new session Sessions are idempotent, so relevant parameters must be set in this function if desired.
      Parameters:
      accountId - Required parameter: Account ID
      body - Optional parameter: Session parameters
      Returns:
      Returns the Session wrapped in ApiResponse response from the API call
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • createSessionAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<Session>> createSessionAsync​(java.lang.String accountId, Session body)
      Create a new session Sessions are idempotent, so relevant parameters must be set in this function if desired.
      Parameters:
      accountId - Required parameter: Account ID
      body - Optional parameter: Session parameters
      Returns:
      Returns the Session wrapped in ApiResponse response from the API call
    • getSession

      public ApiResponse<Session> getSession​(java.lang.String accountId, java.lang.String sessionId) throws ApiException, java.io.IOException
      Get session by ID.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the Session wrapped in ApiResponse response from the API call
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • getSessionAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<Session>> getSessionAsync​(java.lang.String accountId, java.lang.String sessionId)
      Get session by ID.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the Session wrapped in ApiResponse response from the API call
    • deleteSession

      public ApiResponse<java.lang.Void> deleteSession​(java.lang.String accountId, java.lang.String sessionId) throws ApiException, java.io.IOException
      Delete session by ID.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • deleteSessionAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<java.lang.Void>> deleteSessionAsync​(java.lang.String accountId, java.lang.String sessionId)
      Delete session by ID.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the Void wrapped in ApiResponse response from the API call
    • listSessionParticipants

      public ApiResponse<java.util.List<Participant>> listSessionParticipants​(java.lang.String accountId, java.lang.String sessionId) throws ApiException, java.io.IOException
      List participants in a session.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the List of Participant wrapped in ApiResponse response from the API call
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • listSessionParticipantsAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<java.util.List<Participant>>> listSessionParticipantsAsync​(java.lang.String accountId, java.lang.String sessionId)
      List participants in a session.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the List of Participant wrapped in ApiResponse response from the API call
    • addParticipantToSession

      public ApiResponse<java.lang.Void> addParticipantToSession​(java.lang.String accountId, java.lang.String sessionId, java.lang.String participantId, Subscriptions body) throws ApiException, java.io.IOException
      Add a participant to a session Subscriptions can optionally be provided as part of this call.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      participantId - Required parameter: Participant ID
      body - Optional parameter: Subscriptions the participant should be created with
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • addParticipantToSessionAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<java.lang.Void>> addParticipantToSessionAsync​(java.lang.String accountId, java.lang.String sessionId, java.lang.String participantId, Subscriptions body)
      Add a participant to a session Subscriptions can optionally be provided as part of this call.
      Parameters:
      accountId - Required parameter: Account ID
      sessionId - Required parameter: Session ID
      participantId - Required parameter: Participant ID
      body - Optional parameter: Subscriptions the participant should be created with
      Returns:
      Returns the Void wrapped in ApiResponse response from the API call
    • removeParticipantFromSession

      public ApiResponse<java.lang.Void> removeParticipantFromSession​(java.lang.String accountId, java.lang.String participantId, java.lang.String sessionId) throws ApiException, java.io.IOException
      Remove a participant from a session This will automatically remove any subscriptions the participant has associated with this session.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      sessionId - Required parameter: Session ID
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • removeParticipantFromSessionAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<java.lang.Void>> removeParticipantFromSessionAsync​(java.lang.String accountId, java.lang.String participantId, java.lang.String sessionId)
      Remove a participant from a session This will automatically remove any subscriptions the participant has associated with this session.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the Void wrapped in ApiResponse response from the API call
    • getParticipantSubscriptions

      public ApiResponse<Subscriptions> getParticipantSubscriptions​(java.lang.String accountId, java.lang.String participantId, java.lang.String sessionId) throws ApiException, java.io.IOException
      Get a participant's subscriptions.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the Subscriptions wrapped in ApiResponse response from the API call
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • getParticipantSubscriptionsAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<Subscriptions>> getParticipantSubscriptionsAsync​(java.lang.String accountId, java.lang.String participantId, java.lang.String sessionId)
      Get a participant's subscriptions.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      sessionId - Required parameter: Session ID
      Returns:
      Returns the Subscriptions wrapped in ApiResponse response from the API call
    • updateParticipantSubscriptions

      public ApiResponse<java.lang.Void> updateParticipantSubscriptions​(java.lang.String accountId, java.lang.String participantId, java.lang.String sessionId, Subscriptions body) throws ApiException, java.io.IOException
      Update a participant's subscriptions This is a full update that will replace the participant's subscriptions. First call `getParticipantSubscriptions` if you need the current subscriptions. Call this function with no `Subscriptions` object to remove all subscriptions.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      sessionId - Required parameter: Session ID
      body - Optional parameter: Initial state
      Throws:
      ApiException - Represents error response from the server.
      java.io.IOException - Signals that an I/O exception of some sort has occurred.
    • updateParticipantSubscriptionsAsync

      public java.util.concurrent.CompletableFuture<ApiResponse<java.lang.Void>> updateParticipantSubscriptionsAsync​(java.lang.String accountId, java.lang.String participantId, java.lang.String sessionId, Subscriptions body)
      Update a participant's subscriptions This is a full update that will replace the participant's subscriptions. First call `getParticipantSubscriptions` if you need the current subscriptions. Call this function with no `Subscriptions` object to remove all subscriptions.
      Parameters:
      accountId - Required parameter: Account ID
      participantId - Required parameter: Participant ID
      sessionId - Required parameter: Session ID
      body - Optional parameter: Initial state
      Returns:
      Returns the Void wrapped in ApiResponse response from the API call