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.
/*
* Svix API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.svix.internal.api;
import com.svix.internal.ApiCallback;
import com.svix.internal.ApiClient;
import com.svix.internal.ApiException;
import com.svix.internal.ApiResponse;
import com.svix.internal.Configuration;
import com.svix.internal.Pair;
import com.svix.internal.ProgressRequestBody;
import com.svix.internal.ProgressResponseBody;
import com.google.gson.reflect.TypeToken;
import java.io.IOException;
import com.svix.models.HTTPValidationError;
import com.svix.models.HttpErrorOut;
import com.svix.models.MessageOut;
import com.svix.models.RotatedUrlOut;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class InboundApi {
private ApiClient localVarApiClient;
public InboundApi() {
this(Configuration.getDefaultApiClient());
}
public InboundApi(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
public ApiClient getApiClient() {
return localVarApiClient;
}
public void setApiClient(ApiClient apiClient) {
this.localVarApiClient = apiClient;
}
/**
* Build call for v1InboundMsg
* @param appId The app's ID or UID (required)
* @param inboundToken (required)
* @param body (required)
* @param eventType The event type's name (optional)
* @param idempotencyKey The request's idempotency key (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
202
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public okhttp3.Call v1InboundMsgCall(String appId, String inboundToken, String body, String eventType, String idempotencyKey, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = body;
// create path and map variables
String localVarPath = "/api/v1/app/{app_id}/inbound/msg/{inbound_token}"
.replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString()))
.replaceAll("\\{" + "inbound_token" + "\\}", localVarApiClient.escapeString(inboundToken.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (eventType != null) {
localVarQueryParams.addAll(localVarApiClient.parameterToPair("event_type", eventType));
}
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "HTTPBearer" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call v1InboundMsgValidateBeforeCall(String appId, String inboundToken, String body, String eventType, String idempotencyKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'appId' is set
if (appId == null) {
throw new ApiException("Missing the required parameter 'appId' when calling v1InboundMsg(Async)");
}
// verify the required parameter 'inboundToken' is set
if (inboundToken == null) {
throw new ApiException("Missing the required parameter 'inboundToken' when calling v1InboundMsg(Async)");
}
// verify the required parameter 'body' is set
if (body == null) {
throw new ApiException("Missing the required parameter 'body' when calling v1InboundMsg(Async)");
}
okhttp3.Call localVarCall = v1InboundMsgCall(appId, inboundToken, body, eventType, idempotencyKey, _callback);
return localVarCall;
}
/**
* Handle Inbound
* Handles a raw inbound webhook for the application.
* @param appId The app's ID or UID (required)
* @param inboundToken (required)
* @param body (required)
* @param eventType The event type's name (optional)
* @param idempotencyKey The request's idempotency key (optional)
* @return MessageOut
* @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
202
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public MessageOut v1InboundMsg(String appId, String inboundToken, String body, String eventType, String idempotencyKey) throws ApiException {
ApiResponse localVarResp = v1InboundMsgWithHttpInfo(appId, inboundToken, body, eventType, idempotencyKey);
return localVarResp.getData();
}
/**
* Handle Inbound
* Handles a raw inbound webhook for the application.
* @param appId The app's ID or UID (required)
* @param inboundToken (required)
* @param body (required)
* @param eventType The event type's name (optional)
* @param idempotencyKey The request's idempotency key (optional)
* @return ApiResponse<MessageOut>
* @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
202
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public ApiResponse v1InboundMsgWithHttpInfo(String appId, String inboundToken, String body, String eventType, String idempotencyKey) throws ApiException {
okhttp3.Call localVarCall = v1InboundMsgValidateBeforeCall(appId, inboundToken, body, eventType, idempotencyKey, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Handle Inbound (asynchronously)
* Handles a raw inbound webhook for the application.
* @param appId The app's ID or UID (required)
* @param inboundToken (required)
* @param body (required)
* @param eventType The event type's name (optional)
* @param idempotencyKey The request's idempotency key (optional)
* @param _callback The callback to be executed when the API call finishes
* @return 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
202
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public okhttp3.Call v1InboundMsgAsync(String appId, String inboundToken, String body, String eventType, String idempotencyKey, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = v1InboundMsgValidateBeforeCall(appId, inboundToken, body, eventType, idempotencyKey, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
/**
* Build call for v1InboundRotateUrl
* @param appId The app's ID or UID (required)
* @param idempotencyKey The request's idempotency key (optional)
* @param _callback Callback for upload/download progress
* @return Call to execute
* @throws ApiException If fail to serialize the request body object
* @http.response.details
Status Code
Description
Response Headers
200
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public okhttp3.Call v1InboundRotateUrlCall(String appId, String idempotencyKey, final ApiCallback _callback) throws ApiException {
Object localVarPostBody = null;
// create path and map variables
String localVarPath = "/api/v1/app/{app_id}/inbound/rotate-url"
.replaceAll("\\{" + "app_id" + "\\}", localVarApiClient.escapeString(appId.toString()));
List localVarQueryParams = new ArrayList();
List localVarCollectionQueryParams = new ArrayList();
Map localVarHeaderParams = new HashMap();
Map localVarCookieParams = new HashMap();
Map localVarFormParams = new HashMap();
if (idempotencyKey != null) {
localVarHeaderParams.put("idempotency-key", localVarApiClient.parameterToString(idempotencyKey));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
if (localVarAccept != null) {
localVarHeaderParams.put("Accept", localVarAccept);
}
final String[] localVarContentTypes = {
};
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
localVarHeaderParams.put("Content-Type", localVarContentType);
String[] localVarAuthNames = new String[] { "HTTPBearer" };
return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
}
@SuppressWarnings("rawtypes")
private okhttp3.Call v1InboundRotateUrlValidateBeforeCall(String appId, String idempotencyKey, final ApiCallback _callback) throws ApiException {
// verify the required parameter 'appId' is set
if (appId == null) {
throw new ApiException("Missing the required parameter 'appId' when calling v1InboundRotateUrl(Async)");
}
okhttp3.Call localVarCall = v1InboundRotateUrlCall(appId, idempotencyKey, _callback);
return localVarCall;
}
/**
* Rotate Url
* Invalidates the previous inbound url (if one exists), producing a new inbound URL for this app
* @param appId The app's ID or UID (required)
* @param idempotencyKey The request's idempotency key (optional)
* @return RotatedUrlOut
* @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
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public RotatedUrlOut v1InboundRotateUrl(String appId, String idempotencyKey) throws ApiException {
ApiResponse localVarResp = v1InboundRotateUrlWithHttpInfo(appId, idempotencyKey);
return localVarResp.getData();
}
/**
* Rotate Url
* Invalidates the previous inbound url (if one exists), producing a new inbound URL for this app
* @param appId The app's ID or UID (required)
* @param idempotencyKey The request's idempotency key (optional)
* @return ApiResponse<RotatedUrlOut>
* @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
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public ApiResponse v1InboundRotateUrlWithHttpInfo(String appId, String idempotencyKey) throws ApiException {
okhttp3.Call localVarCall = v1InboundRotateUrlValidateBeforeCall(appId, idempotencyKey, null);
Type localVarReturnType = new TypeToken(){}.getType();
return localVarApiClient.execute(localVarCall, localVarReturnType);
}
/**
* Rotate Url (asynchronously)
* Invalidates the previous inbound url (if one exists), producing a new inbound URL for this app
* @param appId The app's ID or UID (required)
* @param idempotencyKey The request's idempotency key (optional)
* @param _callback The callback to be executed when the API call finishes
* @return 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
-
400
Bad request
-
401
Unauthorized
-
403
Forbidden
-
404
Not Found
-
409
Conflict
-
422
Validation Error
-
429
Too Many Requests
-
*/
public okhttp3.Call v1InboundRotateUrlAsync(String appId, String idempotencyKey, final ApiCallback _callback) throws ApiException {
okhttp3.Call localVarCall = v1InboundRotateUrlValidateBeforeCall(appId, idempotencyKey, _callback);
Type localVarReturnType = new TypeToken(){}.getType();
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
return localVarCall;
}
}