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

commonMain.org.danilopianini.centralpublisher.api.IntegrationApi.kt Maven / Gradle / Ivy

The newest version!
/**
 *
 * Please note:
 * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * Do not edit this file manually.
 *
 */

@file:Suppress(
    "ArrayInDataClass",
    "EnumEntryName",
    "RemoveRedundantQualifierName",
    "UnusedImport"
)

package org.danilopianini.centralpublisher.api


import org.danilopianini.centralpublisher.impl.infrastructure.*
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.request.forms.formData
import io.ktor.client.engine.HttpClientEngine
import kotlinx.serialization.json.Json
import io.ktor.http.ParametersBuilder
import kotlinx.serialization.*
import kotlinx.serialization.descriptors.*
import kotlinx.serialization.encoding.*

open class IntegrationApi : ApiClient {

    constructor(
        baseUrl: String = ApiClient.BASE_URL,
        httpClientEngine: HttpClientEngine? = null,
        httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null,
        jsonSerializer: Json = ApiClient.JSON_DEFAULT
    ) : super(baseUrl = baseUrl, httpClientEngine = httpClientEngine, httpClientConfig = httpClientConfig, jsonBlock = jsonSerializer)

    constructor(
        baseUrl: String,
        httpClient: HttpClient
    ): super(baseUrl = baseUrl, httpClient = httpClient)

    /**
     * 
     * Integrate a deployment bundle with a build for manual testing. For more information, see the the following [documentation](https://central.sonatype.org/publish/publish-portal-api/#manually-testing-a-deployment-bundle). 
     * @param deploymentId The deployment identifier, which was obtained by a call to `/api/v1/publisher/upload`.
     * @param relativePath The full path to a specific file from a deployment bundle.
     * @return org.danilopianini.centralpublisher.impl.infrastructure.OctetByteArray
     */
    @Suppress("UNCHECKED_CAST")
    open suspend fun apiV1PublisherDeploymentDeploymentIdDownloadRelativePathGet(deploymentId: kotlin.String, relativePath: kotlin.String): HttpResponse {

        val localVariableAuthNames = listOf("BasicAuth", "BearerAuth")

        val localVariableBody = 
            io.ktor.client.utils.EmptyContent

        val localVariableQuery = mutableMapOf>()
        val localVariableHeaders = mutableMapOf()

        val localVariableConfig = RequestConfig(
            RequestMethod.GET,
            "/api/v1/publisher/deployment/{deploymentId}/download/{relativePath}".replace("{" + "deploymentId" + "}", "$deploymentId").replace("{" + "relativePath" + "}", "$relativePath"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            requiresAuthentication = true,
        )

        return request(
            localVariableConfig,
            localVariableBody,
            localVariableAuthNames
        ).wrap()
    }


    /**
     * 
     * Integrate deployment bundles with a build for manual testing. For more information, see the the following [documentation](https://central.sonatype.org/publish/publish-portal-api/#manually-testing-a-deployment-bundle). 
     * @param relativePath The full path to a specific file from a deployment bundle.
     * @return org.danilopianini.centralpublisher.impl.infrastructure.OctetByteArray
     */
    @Suppress("UNCHECKED_CAST")
    open suspend fun apiV1PublisherDeploymentsDownloadRelativePathGet(relativePath: kotlin.String): HttpResponse {

        val localVariableAuthNames = listOf("BasicAuth", "BearerAuth")

        val localVariableBody = 
            io.ktor.client.utils.EmptyContent

        val localVariableQuery = mutableMapOf>()
        val localVariableHeaders = mutableMapOf()

        val localVariableConfig = RequestConfig(
            RequestMethod.GET,
            "/api/v1/publisher/deployments/download/{relativePath}".replace("{" + "relativePath" + "}", "$relativePath"),
            query = localVariableQuery,
            headers = localVariableHeaders,
            requiresAuthentication = true,
        )

        return request(
            localVariableConfig,
            localVariableBody,
            localVariableAuthNames
        ).wrap()
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy