Class MediaApi


  • public class MediaApi
    extends Object
    • Constructor Detail

      • MediaApi

        public MediaApi()
      • MediaApi

        public MediaApi​(ApiClient apiClient)
    • Method Detail

      • getApiClient

        public ApiClient getApiClient()
      • setApiClient

        public void setApiClient​(ApiClient apiClient)
      • getHostIndex

        public int getHostIndex()
      • setHostIndex

        public void setHostIndex​(int hostIndex)
      • getCustomBaseUrl

        public String getCustomBaseUrl()
      • setCustomBaseUrl

        public void setCustomBaseUrl​(String customBaseUrl)
      • deleteMediaCall

        public okhttp3.Call deleteMediaCall​(String accountId,
                                            String mediaId,
                                            ApiCallback _callback)
                                     throws ApiException
        Build call for deleteMedia
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • deleteMedia

        public void deleteMedia​(String accountId,
                                String mediaId)
                         throws ApiException
        Delete Media Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • deleteMediaWithHttpInfo

        public ApiResponse<Void> deleteMediaWithHttpInfo​(String accountId,
                                                         String mediaId)
                                                  throws ApiException
        Delete Media Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        Returns:
        ApiResponse<Void>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • deleteMediaAsync

        public okhttp3.Call deleteMediaAsync​(String accountId,
                                             String mediaId,
                                             ApiCallback<Void> _callback)
                                      throws ApiException
        Delete Media (asynchronously) Deletes a media file from Bandwidth API server. Make sure you don't have any application scripts still using the media before you delete. If you accidentally delete a media file you can immediately upload a new file with the same name.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • getMediaCall

        public okhttp3.Call getMediaCall​(String accountId,
                                         String mediaId,
                                         ApiCallback _callback)
                                  throws ApiException
        Build call for getMedia
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
        Http Response Details:
        Status Code Description Response Headers
        200 OK -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • getMedia

        public File getMedia​(String accountId,
                             String mediaId)
                      throws ApiException
        Get Media Downloads a media file you previously uploaded.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        Returns:
        File
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        200 OK -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • getMediaWithHttpInfo

        public ApiResponse<File> getMediaWithHttpInfo​(String accountId,
                                                      String mediaId)
                                               throws ApiException
        Get Media Downloads a media file you previously uploaded.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        Returns:
        ApiResponse<File>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        200 OK -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • getMediaAsync

        public okhttp3.Call getMediaAsync​(String accountId,
                                          String mediaId,
                                          ApiCallback<File> _callback)
                                   throws ApiException
        Get Media (asynchronously) Downloads a media file you previously uploaded.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
        Http Response Details:
        Status Code Description Response Headers
        200 OK -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • listMediaCall

        public okhttp3.Call listMediaCall​(String accountId,
                                          String continuationToken,
                                          ApiCallback _callback)
                                   throws ApiException
        Build call for listMedia
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        continuationToken - Continuation token used to retrieve subsequent media. (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
        Http Response Details:
        Status Code Description Response Headers
        200 OK * Continuation-Token - Continuation token used to retrieve subsequent media.
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • listMedia

        public List<Media> listMedia​(String accountId,
                                     String continuationToken)
                              throws ApiException
        List Media Gets a list of your media files. No query parameters are supported.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        continuationToken - Continuation token used to retrieve subsequent media. (optional)
        Returns:
        List<Media>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        200 OK * Continuation-Token - Continuation token used to retrieve subsequent media.
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • listMediaWithHttpInfo

        public ApiResponse<List<Media>> listMediaWithHttpInfo​(String accountId,
                                                              String continuationToken)
                                                       throws ApiException
        List Media Gets a list of your media files. No query parameters are supported.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        continuationToken - Continuation token used to retrieve subsequent media. (optional)
        Returns:
        ApiResponse<List<Media>>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        200 OK * Continuation-Token - Continuation token used to retrieve subsequent media.
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • listMediaAsync

        public okhttp3.Call listMediaAsync​(String accountId,
                                           String continuationToken,
                                           ApiCallback<List<Media>> _callback)
                                    throws ApiException
        List Media (asynchronously) Gets a list of your media files. No query parameters are supported.
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        continuationToken - Continuation token used to retrieve subsequent media. (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
        Http Response Details:
        Status Code Description Response Headers
        200 OK * Continuation-Token - Continuation token used to retrieve subsequent media.
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • uploadMediaCall

        public okhttp3.Call uploadMediaCall​(String accountId,
                                            String mediaId,
                                            File body,
                                            String contentType,
                                            String cacheControl,
                                            ApiCallback _callback)
                                     throws ApiException
        Build call for uploadMedia
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        body - (required)
        contentType - The media type of the entity-body. (optional)
        cacheControl - General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional)
        _callback - Callback for upload/download progress
        Returns:
        Call to execute
        Throws:
        ApiException - If fail to serialize the request body object
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • uploadMedia

        public void uploadMedia​(String accountId,
                                String mediaId,
                                File body,
                                String contentType,
                                String cacheControl)
                         throws ApiException
        Upload Media Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-).
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        body - (required)
        contentType - The media type of the entity-body. (optional)
        cacheControl - General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional)
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • uploadMediaWithHttpInfo

        public ApiResponse<Void> uploadMediaWithHttpInfo​(String accountId,
                                                         String mediaId,
                                                         File body,
                                                         String contentType,
                                                         String cacheControl)
                                                  throws ApiException
        Upload Media Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-).
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        body - (required)
        contentType - The media type of the entity-body. (optional)
        cacheControl - General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional)
        Returns:
        ApiResponse<Void>
        Throws:
        ApiException - If fail to call the API, e.g. server error or cannot deserialize the response body
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -
      • uploadMediaAsync

        public okhttp3.Call uploadMediaAsync​(String accountId,
                                             String mediaId,
                                             File body,
                                             String contentType,
                                             String cacheControl,
                                             ApiCallback<Void> _callback)
                                      throws ApiException
        Upload Media (asynchronously) Upload a file. You may add headers to the request in order to provide some control to your media file. If a file is uploaded with the same name as a file that already exists under this account, the previous file will be overwritten. A list of supported media types can be found [here](https://support.bandwidth.com/hc/en-us/articles/360014128994-What-MMS-file-types-are-supported-).
        Parameters:
        accountId - Your Bandwidth Account ID. (required)
        mediaId - Media ID to retrieve. (required)
        body - (required)
        contentType - The media type of the entity-body. (optional)
        cacheControl - General-header field is used to specify directives that MUST be obeyed by all caching mechanisms along the request/response chain. (optional)
        _callback - The callback to be executed when the API call finishes
        Returns:
        The request call
        Throws:
        ApiException - If fail to process the API call, e.g. serializing the request body object
        Http Response Details:
        Status Code Description Response Headers
        204 No Content -
        400 Bad Request -
        401 Unauthorized -
        403 Forbidden -
        404 Not Found -
        406 Not Acceptable -
        415 Unsupported Media Type -
        429 Too Many Requests -
        500 Internal Server Error -