Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package com.telnyx.sdk.api;
import com.telnyx.sdk.ApiException;
import com.telnyx.sdk.ApiClient;
import com.telnyx.sdk.ApiResponse;
import com.telnyx.sdk.Configuration;
import com.telnyx.sdk.Pair;
import javax.ws.rs.core.GenericType;
import com.telnyx.sdk.model.CreateIpConnectionRequest;
import com.telnyx.sdk.model.IpConnectionResponse;
import com.telnyx.sdk.model.ListIpConnectionsResponse;
import com.telnyx.sdk.model.UpdateIpConnectionRequest;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
public class IpConnectionsApi {
private ApiClient apiClient;
public IpConnectionsApi() {
this(Configuration.getDefaultApiClient());
}
public IpConnectionsApi(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Get the API cilent
*
* @return API client
*/
public ApiClient getApiClient() {
return apiClient;
}
/**
* Set the API cilent
*
* @param apiClient an instance of API client
*/
public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
/**
* Create an Ip connection
* Creates an IP connection.
* @param createIpConnectionRequest Parameters that can be defined during IP connection creation (required)
* @return IpConnectionResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Successful response with details about an IP connection.
-
422
Bad request
-
*/
public IpConnectionResponse createIpConnection(CreateIpConnectionRequest createIpConnectionRequest) throws ApiException {
return createIpConnectionWithHttpInfo(createIpConnectionRequest).getData();
}
/**
* Create an Ip connection
* Creates an IP connection.
* @param createIpConnectionRequest Parameters that can be defined during IP connection creation (required)
* @return ApiResponse<IpConnectionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
201
Successful response with details about an IP connection.
-
422
Bad request
-
*/
public ApiResponse createIpConnectionWithHttpInfo(CreateIpConnectionRequest createIpConnectionRequest) throws ApiException {
Object localVarPostBody = createIpConnectionRequest;
// verify the required parameter 'createIpConnectionRequest' is set
if (createIpConnectionRequest == null) {
throw new ApiException(400, "Missing the required parameter 'createIpConnectionRequest' when calling createIpConnection");
}
// create path and map variables
String localVarPath = "/ip_connections";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "bearerAuth" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("IpConnectionsApi.createIpConnection", localVarPath, "POST", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Delete an Ip connection
* Deletes an existing IP connection.
* @param id Identifies the type of resource. (required)
* @return IpConnectionResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with details about an IP connection.
-
401
Unauthorized
-
404
Resource not found
-
422
Bad request
-
*/
public IpConnectionResponse deleteIpConnection(String id) throws ApiException {
return deleteIpConnectionWithHttpInfo(id).getData();
}
/**
* Delete an Ip connection
* Deletes an existing IP connection.
* @param id Identifies the type of resource. (required)
* @return ApiResponse<IpConnectionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with details about an IP connection.
-
401
Unauthorized
-
404
Resource not found
-
422
Bad request
-
*/
public ApiResponse deleteIpConnectionWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling deleteIpConnection");
}
// create path and map variables
String localVarPath = "/ip_connections/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "bearerAuth" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("IpConnectionsApi.deleteIpConnection", localVarPath, "DELETE", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
private ApiResponse listIpConnectionsWithHttpInfo(Integer pageNumber, Integer pageSize, String filterConnectionNameContains, String filterOutboundOutboundVoiceProfileId, String sort) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/ip_connections";
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[connection_name][contains]", filterConnectionNameContains));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[outbound.outbound_voice_profile_id]", filterOutboundOutboundVoiceProfileId));
localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort));
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "bearerAuth" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("IpConnectionsApi.listIpConnections", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
public class APIlistIpConnectionsRequest {
private Integer pageNumber;
private Integer pageSize;
private String filterConnectionNameContains;
private String filterOutboundOutboundVoiceProfileId;
private String sort;
private APIlistIpConnectionsRequest() {
}
/**
* Set pageNumber
* @param pageNumber The page number to load (optional, default to 1)
* @return APIlistIpConnectionsRequest
*/
public APIlistIpConnectionsRequest pageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
return this;
}
/**
* Set pageSize
* @param pageSize The size of the page (optional, default to 50)
* @return APIlistIpConnectionsRequest
*/
public APIlistIpConnectionsRequest pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* Set filterConnectionNameContains
* @param filterConnectionNameContains If present, connections with <code>connection_name</code> containing the given value will be returned. Matching is not case-sensitive. Requires at least three characters. (optional, default to "null")
* @return APIlistIpConnectionsRequest
*/
public APIlistIpConnectionsRequest filterConnectionNameContains(String filterConnectionNameContains) {
this.filterConnectionNameContains = filterConnectionNameContains;
return this;
}
/**
* Set filterOutboundOutboundVoiceProfileId
* @param filterOutboundOutboundVoiceProfileId Identifies the associated outbound voice profile. (optional)
* @return APIlistIpConnectionsRequest
*/
public APIlistIpConnectionsRequest filterOutboundOutboundVoiceProfileId(String filterOutboundOutboundVoiceProfileId) {
this.filterOutboundOutboundVoiceProfileId = filterOutboundOutboundVoiceProfileId;
return this;
}
/**
* Set sort
* @param sort Specifies the sort order for results. By default sorting direction is ascending. To have the results sorted in descending order add the <code> -</code> prefix.<br/><br/> That is: <ul> <li> <code>connection_name</code>: sorts the result by the <code>connection_name</code> field in ascending order. </li> <li> <code>-connection_name</code>: sorts the result by the <code>connection_name</code> field in descending order. </li> </ul> <br/> If not given, results are sorted by <code>created_at</code> in descending order. (optional, default to created_at)
* @return APIlistIpConnectionsRequest
*/
public APIlistIpConnectionsRequest sort(String sort) {
this.sort = sort;
return this;
}
/**
* Execute listIpConnections request
* @return ListIpConnectionsResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with a list of IP connections.
-
400
Bad request
-
401
Unauthorized
-
404
Resource not found
-
*/
public ListIpConnectionsResponse execute() throws ApiException {
return this.executeWithHttpInfo().getData();
}
/**
* Execute listIpConnections request with HTTP info returned
* @return ApiResponse<ListIpConnectionsResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with a list of IP connections.
-
400
Bad request
-
401
Unauthorized
-
404
Resource not found
-
*/
public ApiResponse executeWithHttpInfo() throws ApiException {
return listIpConnectionsWithHttpInfo(pageNumber, pageSize, filterConnectionNameContains, filterOutboundOutboundVoiceProfileId, sort);
}
}
/**
* List Ip connections
* Returns a list of your IP connections.
* @return listIpConnectionsRequest
* @throws ApiException if fails to make API call
*/
public APIlistIpConnectionsRequest listIpConnections() throws ApiException {
return new APIlistIpConnectionsRequest();
}
/**
* Retrieve an Ip connection
* Retrieves the details of an existing ip connection.
* @param id IP Connection ID (required)
* @return IpConnectionResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with details about an IP connection.
-
401
Unauthorized
-
404
Resource not found
-
422
Bad request
-
*/
public IpConnectionResponse retrieveIpConnection(String id) throws ApiException {
return retrieveIpConnectionWithHttpInfo(id).getData();
}
/**
* Retrieve an Ip connection
* Retrieves the details of an existing ip connection.
* @param id IP Connection ID (required)
* @return ApiResponse<IpConnectionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with details about an IP connection.
-
401
Unauthorized
-
404
Resource not found
-
422
Bad request
-
*/
public ApiResponse retrieveIpConnectionWithHttpInfo(String id) throws ApiException {
Object localVarPostBody = null;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling retrieveIpConnection");
}
// create path and map variables
String localVarPath = "/ip_connections/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "bearerAuth" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("IpConnectionsApi.retrieveIpConnection", localVarPath, "GET", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
/**
* Update an Ip connection
* Updates settings of an existing IP connection.
* @param id Identifies the type of resource. (required)
* @param updateIpConnectionRequest Parameters that can be updated in a IP connection (required)
* @return IpConnectionResponse
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with details about an IP connection.
-
401
Unauthorized
-
404
Resource not found
-
422
Bad request
-
*/
public IpConnectionResponse updateIpConnection(String id, UpdateIpConnectionRequest updateIpConnectionRequest) throws ApiException {
return updateIpConnectionWithHttpInfo(id, updateIpConnectionRequest).getData();
}
/**
* Update an Ip connection
* Updates settings of an existing IP connection.
* @param id Identifies the type of resource. (required)
* @param updateIpConnectionRequest Parameters that can be updated in a IP connection (required)
* @return ApiResponse<IpConnectionResponse>
* @throws ApiException if fails to make API call
* @http.response.details
Status Code
Description
Response Headers
200
Successful response with details about an IP connection.
-
401
Unauthorized
-
404
Resource not found
-
422
Bad request
-
*/
public ApiResponse updateIpConnectionWithHttpInfo(String id, UpdateIpConnectionRequest updateIpConnectionRequest) throws ApiException {
Object localVarPostBody = updateIpConnectionRequest;
// verify the required parameter 'id' is set
if (id == null) {
throw new ApiException(400, "Missing the required parameter 'id' when calling updateIpConnection");
}
// verify the required parameter 'updateIpConnectionRequest' is set
if (updateIpConnectionRequest == null) {
throw new ApiException(400, "Missing the required parameter 'updateIpConnectionRequest' when calling updateIpConnection");
}
// create path and map variables
String localVarPath = "/ip_connections/{id}"
.replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
// query params
List localVarQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "bearerAuth" };
GenericType localVarReturnType = new GenericType() {};
return apiClient.invokeAPI("IpConnectionsApi.updateIpConnection", localVarPath, "PATCH", localVarQueryParams, localVarPostBody,
localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType,
localVarAuthNames, localVarReturnType, false);
}
}