All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.svix.kotlin.internal.apis.EndpointApi.kt Maven / Gradle / Ivy

/**
* 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.kotlin.internal.apis

import com.svix.kotlin.models.EndpointHeadersIn
import com.svix.kotlin.models.EndpointHeadersOut
import com.svix.kotlin.models.EndpointHeadersPatchIn
import com.svix.kotlin.models.EndpointIn
import com.svix.kotlin.models.EndpointMtlsConfigIn
import com.svix.kotlin.models.EndpointOauthConfigIn
import com.svix.kotlin.models.EndpointOut
import com.svix.kotlin.models.EndpointPatch
import com.svix.kotlin.models.EndpointSecretOut
import com.svix.kotlin.models.EndpointSecretRotateIn
import com.svix.kotlin.models.EndpointStats
import com.svix.kotlin.models.EndpointTransformationIn
import com.svix.kotlin.models.EndpointTransformationOut
import com.svix.kotlin.models.EndpointTransformationSimulateIn
import com.svix.kotlin.models.EndpointTransformationSimulateOut
import com.svix.kotlin.models.EndpointUpdate
import com.svix.kotlin.models.EventExampleIn
import com.svix.kotlin.models.HTTPValidationError
import com.svix.kotlin.models.HttpErrorOut
import com.svix.kotlin.models.ListResponseEndpointOut
import com.svix.kotlin.models.ListResponseSinkOut
import com.svix.kotlin.models.MessageOut
import com.svix.kotlin.models.Ordering
import com.svix.kotlin.models.RecoverIn
import com.svix.kotlin.models.RecoverOut
import com.svix.kotlin.models.ReplayIn
import com.svix.kotlin.models.ReplayOut
import com.svix.kotlin.models.SinkIn
import com.svix.kotlin.models.SinkOut

import com.svix.kotlin.internal.infrastructure.ApiClient
import com.svix.kotlin.internal.infrastructure.ClientException
import com.svix.kotlin.internal.infrastructure.ClientError
import com.svix.kotlin.internal.infrastructure.ServerException
import com.svix.kotlin.internal.infrastructure.ServerError
import com.svix.kotlin.internal.infrastructure.MultiValueMap
import com.svix.kotlin.internal.infrastructure.RequestConfig
import com.svix.kotlin.internal.infrastructure.RequestMethod
import com.svix.kotlin.internal.infrastructure.ResponseType
import com.svix.kotlin.internal.infrastructure.Success
import com.svix.kotlin.internal.infrastructure.toMultiValue

class EndpointApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
    companion object {
        @JvmStatic
        val defaultBasePath: String by lazy {
            System.getProperties().getProperty("com.svix.kotlin.internal.baseUrl", "https://api.eu.svix.com")
        }
    }

    /**
    * Create Endpoint
    * Create a new endpoint for the application.  When `secret` is `null` the secret is automatically generated (recommended)
    * @param appId The app's ID or UID 
    * @param endpointIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return EndpointOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointCreate(appId: kotlin.String, endpointIn: EndpointIn, idempotencyKey: kotlin.String?) : EndpointOut {
        val localVariableConfig = v1EndpointCreateRequestConfig(appId = appId, endpointIn = endpointIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointCreate
    *
    * @param appId The app's ID or UID 
    * @param endpointIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1EndpointCreateRequestConfig(appId: kotlin.String, endpointIn: EndpointIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = endpointIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/endpoint".replace("{"+"app_id"+"}", "$appId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Delete Endpoint
    * Delete an endpoint.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointDelete(appId: kotlin.String, endpointId: kotlin.String) : Unit {
        val localVariableConfig = v1EndpointDeleteRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointDelete
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointDeleteRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.DELETE,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Delete Endpoint Mtls Config
    * Delete endpoint mTLS configuration
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointDeleteMtlsConfig(appId: kotlin.String, endpointId: kotlin.String) : Unit {
        val localVariableConfig = v1EndpointDeleteMtlsConfigRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointDeleteMtlsConfig
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointDeleteMtlsConfigRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.DELETE,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Delete Endpoint Oauth Config
    * Delete endpoint OAuth configuration
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointDeleteOauthConfig(appId: kotlin.String, endpointId: kotlin.String) : Unit {
        val localVariableConfig = v1EndpointDeleteOauthConfigRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointDeleteOauthConfig
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointDeleteOauthConfigRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.DELETE,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Get Endpoint
    * Get an endpoint.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return EndpointOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointGet(appId: kotlin.String, endpointId: kotlin.String) : EndpointOut {
        val localVariableConfig = v1EndpointGetRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointGet
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointGetRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Get Endpoint Headers
    * Get the additional headers to be sent with the webhook
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return EndpointHeadersOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointGetHeaders(appId: kotlin.String, endpointId: kotlin.String) : EndpointHeadersOut {
        val localVariableConfig = v1EndpointGetHeadersRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointHeadersOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointGetHeaders
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointGetHeadersRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Get Endpoint Secret
    * Get the endpoint's signing secret.  This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return EndpointSecretOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointGetSecret(appId: kotlin.String, endpointId: kotlin.String) : EndpointSecretOut {
        val localVariableConfig = v1EndpointGetSecretRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointSecretOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointGetSecret
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointGetSecretRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Endpoint Stats
    * Get basic statistics for the endpoint.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param since Filter the range to data starting from this date (optional)
    * @param until Filter the range to data ending by this date (optional)
    * @return EndpointStats
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointGetStats(appId: kotlin.String, endpointId: kotlin.String, since: java.time.OffsetDateTime?, until: java.time.OffsetDateTime?) : EndpointStats {
        val localVariableConfig = v1EndpointGetStatsRequestConfig(appId = appId, endpointId = endpointId, since = since, until = until)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointStats
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointGetStats
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param since Filter the range to data starting from this date (optional)
    * @param until Filter the range to data ending by this date (optional)
    * @return RequestConfig
    */
    fun v1EndpointGetStatsRequestConfig(appId: kotlin.String, endpointId: kotlin.String, since: java.time.OffsetDateTime?, until: java.time.OffsetDateTime?) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf>()
            .apply {
                if (since != null) {
                    put("since", listOf(parseDateToQueryString(since)))
                }
                if (until != null) {
                    put("until", listOf(parseDateToQueryString(until)))
                }
            }
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * List Endpoints
    * List the application's endpoints.
    * @param appId The app's ID or UID 
    * @param limit Limit the number of returned items (optional)
    * @param iterator The iterator returned from a prior invocation (optional)
    * @param order The sorting order of the returned items (optional)
    * @return ListResponseEndpointOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointList(appId: kotlin.String, limit: kotlin.Int?, iterator: kotlin.String?, order: Ordering?) : ListResponseEndpointOut {
        val localVariableConfig = v1EndpointListRequestConfig(appId = appId, limit = limit, iterator = iterator, order = order)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as ListResponseEndpointOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointList
    *
    * @param appId The app's ID or UID 
    * @param limit Limit the number of returned items (optional)
    * @param iterator The iterator returned from a prior invocation (optional)
    * @param order The sorting order of the returned items (optional)
    * @return RequestConfig
    */
    fun v1EndpointListRequestConfig(appId: kotlin.String, limit: kotlin.Int?, iterator: kotlin.String?, order: Ordering?) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf>()
            .apply {
                if (limit != null) {
                    put("limit", listOf(limit.toString()))
                }
                if (iterator != null) {
                    put("iterator", listOf(iterator.toString()))
                }
                if (order != null) {
                    put("order", listOf(order.toString()))
                }
            }
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/endpoint".replace("{"+"app_id"+"}", "$appId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Patch Endpoint
    * Partially update an endpoint.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointPatch  
    * @return EndpointOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointPatch(appId: kotlin.String, endpointId: kotlin.String, endpointPatch: EndpointPatch) : EndpointOut {
        val localVariableConfig = v1EndpointPatchRequestConfig(appId = appId, endpointId = endpointId, endpointPatch = endpointPatch)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointPatch
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointPatch  
    * @return RequestConfig
    */
    fun v1EndpointPatchRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointPatch: EndpointPatch) : RequestConfig {
        val localVariableBody = endpointPatch
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PATCH,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Patch Endpoint Headers
    * Partially set the additional headers to be sent with the webhook
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointHeadersPatchIn  
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointPatchHeaders(appId: kotlin.String, endpointId: kotlin.String, endpointHeadersPatchIn: EndpointHeadersPatchIn) : Unit {
        val localVariableConfig = v1EndpointPatchHeadersRequestConfig(appId = appId, endpointId = endpointId, endpointHeadersPatchIn = endpointHeadersPatchIn)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointPatchHeaders
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointHeadersPatchIn  
    * @return RequestConfig
    */
    fun v1EndpointPatchHeadersRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointHeadersPatchIn: EndpointHeadersPatchIn) : RequestConfig {
        val localVariableBody = endpointHeadersPatchIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PATCH,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Recover Failed Webhooks
    * Resend all failed messages since a given time.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param recoverIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RecoverOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointRecover(appId: kotlin.String, endpointId: kotlin.String, recoverIn: RecoverIn, idempotencyKey: kotlin.String?) : RecoverOut {
        val localVariableConfig = v1EndpointRecoverRequestConfig(appId = appId, endpointId = endpointId, recoverIn = recoverIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as RecoverOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointRecover
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param recoverIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1EndpointRecoverRequestConfig(appId: kotlin.String, endpointId: kotlin.String, recoverIn: RecoverIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = recoverIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/recover".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Replay Missing Webhooks
    * Replays messages to the endpoint. Only messages that were created after `since` will be sent. Messages that were previously sent to the endpoint are not resent.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param replayIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return ReplayOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointReplay(appId: kotlin.String, endpointId: kotlin.String, replayIn: ReplayIn, idempotencyKey: kotlin.String?) : ReplayOut {
        val localVariableConfig = v1EndpointReplayRequestConfig(appId = appId, endpointId = endpointId, replayIn = replayIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as ReplayOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointReplay
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param replayIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1EndpointReplayRequestConfig(appId: kotlin.String, endpointId: kotlin.String, replayIn: ReplayIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = replayIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/replay-missing".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Rotate Endpoint Secret
    * Rotates the endpoint's signing secret.  The previous secret will be valid for the next 24 hours.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointSecretRotateIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointRotateSecret(appId: kotlin.String, endpointId: kotlin.String, endpointSecretRotateIn: EndpointSecretRotateIn, idempotencyKey: kotlin.String?) : Unit {
        val localVariableConfig = v1EndpointRotateSecretRequestConfig(appId = appId, endpointId = endpointId, endpointSecretRotateIn = endpointSecretRotateIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointRotateSecret
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointSecretRotateIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1EndpointRotateSecretRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointSecretRotateIn: EndpointSecretRotateIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = endpointSecretRotateIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Send Event Type Example Message
    * Send an example message for an event
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param eventExampleIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return MessageOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointSendExample(appId: kotlin.String, endpointId: kotlin.String, eventExampleIn: EventExampleIn, idempotencyKey: kotlin.String?) : MessageOut {
        val localVariableConfig = v1EndpointSendExampleRequestConfig(appId = appId, endpointId = endpointId, eventExampleIn = eventExampleIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as MessageOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointSendExample
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param eventExampleIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1EndpointSendExampleRequestConfig(appId: kotlin.String, endpointId: kotlin.String, eventExampleIn: EventExampleIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = eventExampleIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Get Endpoint Transformation
    * Get the transformation code associated with this endpoint
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return EndpointTransformationOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointTransformationGet(appId: kotlin.String, endpointId: kotlin.String) : EndpointTransformationOut {
        val localVariableConfig = v1EndpointTransformationGetRequestConfig(appId = appId, endpointId = endpointId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointTransformationOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointTransformationGet
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1EndpointTransformationGetRequestConfig(appId: kotlin.String, endpointId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Set Endpoint Transformation
    * Set or unset the transformation code associated with this endpoint
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointTransformationIn  
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointTransformationPartialUpdate(appId: kotlin.String, endpointId: kotlin.String, endpointTransformationIn: EndpointTransformationIn) : Unit {
        val localVariableConfig = v1EndpointTransformationPartialUpdateRequestConfig(appId = appId, endpointId = endpointId, endpointTransformationIn = endpointTransformationIn)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointTransformationPartialUpdate
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointTransformationIn  
    * @return RequestConfig
    */
    fun v1EndpointTransformationPartialUpdateRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointTransformationIn: EndpointTransformationIn) : RequestConfig {
        val localVariableBody = endpointTransformationIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PATCH,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Simulate
    * Simulate running the transformation on the payload and code
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointTransformationSimulateIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return EndpointTransformationSimulateOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointTransformationSimulate(appId: kotlin.String, endpointId: kotlin.String, endpointTransformationSimulateIn: EndpointTransformationSimulateIn, idempotencyKey: kotlin.String?) : EndpointTransformationSimulateOut {
        val localVariableConfig = v1EndpointTransformationSimulateRequestConfig(appId = appId, endpointId = endpointId, endpointTransformationSimulateIn = endpointTransformationSimulateIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointTransformationSimulateOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointTransformationSimulate
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointTransformationSimulateIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1EndpointTransformationSimulateRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointTransformationSimulateIn: EndpointTransformationSimulateIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = endpointTransformationSimulateIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/transformation/simulate".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Update Endpoint
    * Update an endpoint.
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointUpdate  
    * @return EndpointOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointUpdate(appId: kotlin.String, endpointId: kotlin.String, endpointUpdate: EndpointUpdate) : EndpointOut {
        val localVariableConfig = v1EndpointUpdateRequestConfig(appId = appId, endpointId = endpointId, endpointUpdate = endpointUpdate)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as EndpointOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointUpdate
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointUpdate  
    * @return RequestConfig
    */
    fun v1EndpointUpdateRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointUpdate: EndpointUpdate) : RequestConfig {
        val localVariableBody = endpointUpdate
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PUT,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Update Endpoint Headers
    * Set the additional headers to be sent with the webhook
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointHeadersIn  
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointUpdateHeaders(appId: kotlin.String, endpointId: kotlin.String, endpointHeadersIn: EndpointHeadersIn) : Unit {
        val localVariableConfig = v1EndpointUpdateHeadersRequestConfig(appId = appId, endpointId = endpointId, endpointHeadersIn = endpointHeadersIn)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointUpdateHeaders
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointHeadersIn  
    * @return RequestConfig
    */
    fun v1EndpointUpdateHeadersRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointHeadersIn: EndpointHeadersIn) : RequestConfig {
        val localVariableBody = endpointHeadersIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PUT,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/headers".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Update Endpoint Mtls Config
    * Create/update endpoint mTLS configuration
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointMtlsConfigIn  
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointUpdateMtlsConfig(appId: kotlin.String, endpointId: kotlin.String, endpointMtlsConfigIn: EndpointMtlsConfigIn) : Unit {
        val localVariableConfig = v1EndpointUpdateMtlsConfigRequestConfig(appId = appId, endpointId = endpointId, endpointMtlsConfigIn = endpointMtlsConfigIn)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointUpdateMtlsConfig
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointMtlsConfigIn  
    * @return RequestConfig
    */
    fun v1EndpointUpdateMtlsConfigRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointMtlsConfigIn: EndpointMtlsConfigIn) : RequestConfig {
        val localVariableBody = endpointMtlsConfigIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PUT,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/mtls".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Update Endpoint Oauth Config
    * Create/update endpoint OAuth configuration
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointOauthConfigIn  
    * @return void
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1EndpointUpdateOauthConfig(appId: kotlin.String, endpointId: kotlin.String, endpointOauthConfigIn: EndpointOauthConfigIn) : Unit {
        val localVariableConfig = v1EndpointUpdateOauthConfigRequestConfig(appId = appId, endpointId = endpointId, endpointOauthConfigIn = endpointOauthConfigIn)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> Unit
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1EndpointUpdateOauthConfig
    *
    * @param appId The app's ID or UID 
    * @param endpointId The ep's ID or UID 
    * @param endpointOauthConfigIn  
    * @return RequestConfig
    */
    fun v1EndpointUpdateOauthConfigRequestConfig(appId: kotlin.String, endpointId: kotlin.String, endpointOauthConfigIn: EndpointOauthConfigIn) : RequestConfig {
        val localVariableBody = endpointOauthConfigIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.PUT,
            path = "/api/v1/app/{app_id}/endpoint/{endpoint_id}/oauth".replace("{"+"app_id"+"}", "$appId").replace("{"+"endpoint_id"+"}", "$endpointId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Create Sink
    * Create a new sink for the application.
    * @param appId The app's ID or UID 
    * @param sinkIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return SinkOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1SinkCreate(appId: kotlin.String, sinkIn: SinkIn, idempotencyKey: kotlin.String?) : SinkOut {
        val localVariableConfig = v1SinkCreateRequestConfig(appId = appId, sinkIn = sinkIn, idempotencyKey = idempotencyKey)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as SinkOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1SinkCreate
    *
    * @param appId The app's ID or UID 
    * @param sinkIn  
    * @param idempotencyKey The request's idempotency key (optional)
    * @return RequestConfig
    */
    fun v1SinkCreateRequestConfig(appId: kotlin.String, sinkIn: SinkIn, idempotencyKey: kotlin.String?) : RequestConfig {
        val localVariableBody = sinkIn
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()
        idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }

        return RequestConfig(
            method = RequestMethod.POST,
            path = "/api/v1/app/{app_id}/sink".replace("{"+"app_id"+"}", "$appId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * Get Sink
    * Get a sink.
    * @param appId The app's ID or UID 
    * @param sinkId The ep's ID or UID 
    * @return SinkOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1SinkGet(appId: kotlin.String, sinkId: kotlin.String) : SinkOut {
        val localVariableConfig = v1SinkGetRequestConfig(appId = appId, sinkId = sinkId)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as SinkOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1SinkGet
    *
    * @param appId The app's ID or UID 
    * @param sinkId The ep's ID or UID 
    * @return RequestConfig
    */
    fun v1SinkGetRequestConfig(appId: kotlin.String, sinkId: kotlin.String) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf()
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/sink/{sink_id}".replace("{"+"app_id"+"}", "$appId").replace("{"+"sink_id"+"}", "$sinkId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

    /**
    * List Sinks
    * List the application's sinks.
    * @param appId The app's ID or UID 
    * @param limit Limit the number of returned items (optional)
    * @param iterator The iterator returned from a prior invocation (optional)
    * @param order The sorting order of the returned items (optional)
    * @return ListResponseSinkOut
    * @throws UnsupportedOperationException If the API returns an informational or redirection response
    * @throws ClientException If the API returns a client error response
    * @throws ServerException If the API returns a server error response
    */
    @Suppress("UNCHECKED_CAST")
    @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
    suspend fun v1SinkList(appId: kotlin.String, limit: kotlin.Int?, iterator: kotlin.String?, order: Ordering?) : ListResponseSinkOut {
        val localVariableConfig = v1SinkListRequestConfig(appId = appId, limit = limit, iterator = iterator, order = order)

        val localVarResponse = request(
            localVariableConfig
        )

        return when (localVarResponse.responseType) {
            ResponseType.Success -> (localVarResponse as Success<*>).data as ListResponseSinkOut
            ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.")
            ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.")
            ResponseType.ClientError -> {
                val localVarError = localVarResponse as ClientError<*>
                throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
            ResponseType.ServerError -> {
                val localVarError = localVarResponse as ServerError<*>
                throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse)
            }
        }
    }

    /**
    * To obtain the request config of the operation v1SinkList
    *
    * @param appId The app's ID or UID 
    * @param limit Limit the number of returned items (optional)
    * @param iterator The iterator returned from a prior invocation (optional)
    * @param order The sorting order of the returned items (optional)
    * @return RequestConfig
    */
    fun v1SinkListRequestConfig(appId: kotlin.String, limit: kotlin.Int?, iterator: kotlin.String?, order: Ordering?) : RequestConfig {
        val localVariableBody = null
        val localVariableQuery: MultiValueMap = mutableMapOf>()
            .apply {
                if (limit != null) {
                    put("limit", listOf(limit.toString()))
                }
                if (iterator != null) {
                    put("iterator", listOf(iterator.toString()))
                }
                if (order != null) {
                    put("order", listOf(order.toString()))
                }
            }
        val localVariableHeaders: MutableMap = mutableMapOf()

        return RequestConfig(
            method = RequestMethod.GET,
            path = "/api/v1/app/{app_id}/sink".replace("{"+"app_id"+"}", "$appId"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            body = localVariableBody
        )
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy