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.kotlin.internal.apis
import com.svix.kotlin.models.EnvironmentIn
import com.svix.kotlin.models.EnvironmentOut
import com.svix.kotlin.models.HTTPValidationError
import com.svix.kotlin.models.HttpErrorOut
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 EnvironmentApi(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")
}
}
/**
* Export Environment Configuration
* Download a JSON file containing all org-settings and event types
* @param idempotencyKey The request's idempotency key (optional)
* @return EnvironmentOut
* @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 v1EnvironmentExport(idempotencyKey: kotlin.String?) : EnvironmentOut {
val localVariableConfig = v1EnvironmentExportRequestConfig(idempotencyKey = idempotencyKey)
val localVarResponse = request(
localVariableConfig
)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as EnvironmentOut
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 v1EnvironmentExport
*
* @param idempotencyKey The request's idempotency key (optional)
* @return RequestConfig
*/
fun v1EnvironmentExportRequestConfig(idempotencyKey: kotlin.String?) : RequestConfig {
val localVariableBody = null
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap = mutableMapOf()
idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }
return RequestConfig(
method = RequestMethod.POST,
path = "/api/v1/environment/export",
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
)
}
/**
* Export Environment Configuration
* Download a JSON file containing all org-settings and event types
* @return EnvironmentOut
* @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 v1EnvironmentExportGet() : EnvironmentOut {
val localVariableConfig = v1EnvironmentExportGetRequestConfig()
val localVarResponse = request(
localVariableConfig
)
return when (localVarResponse.responseType) {
ResponseType.Success -> (localVarResponse as Success<*>).data as EnvironmentOut
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 v1EnvironmentExportGet
*
* @return RequestConfig
*/
fun v1EnvironmentExportGetRequestConfig() : RequestConfig {
val localVariableBody = null
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap = mutableMapOf()
return RequestConfig(
method = RequestMethod.GET,
path = "/api/v1/environment/export",
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
)
}
/**
* Import Environment Configuration
* Import a configuration into the active organization. It doesn't delete anything, only adds/updates what was passed to it.
* @param environmentIn
* @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 v1EnvironmentImport(environmentIn: EnvironmentIn, idempotencyKey: kotlin.String?) : Unit {
val localVariableConfig = v1EnvironmentImportRequestConfig(environmentIn = environmentIn, 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 v1EnvironmentImport
*
* @param environmentIn
* @param idempotencyKey The request's idempotency key (optional)
* @return RequestConfig
*/
fun v1EnvironmentImportRequestConfig(environmentIn: EnvironmentIn, idempotencyKey: kotlin.String?) : RequestConfig {
val localVariableBody = environmentIn
val localVariableQuery: MultiValueMap = mutableMapOf()
val localVariableHeaders: MutableMap = mutableMapOf()
idempotencyKey?.apply { localVariableHeaders["idempotency-key"] = this.toString() }
return RequestConfig(
method = RequestMethod.POST,
path = "/api/v1/environment/import",
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
)
}
}