Session

data class Session(    val client: ApiClient,     val httpClient: HttpClient,     val credentials: Credentials,     val option: ApiConfig,     shouldCloseHttpClient: Boolean) : Closeable

Penicillin Session instance. Provides HttpClient, credentials, options.

Constructors

Link copied to clipboard
fun Session(    client: ApiClient,     httpClient: HttpClient,     credentials: Credentials,     option: ApiConfig,     shouldCloseHttpClient: Boolean)

Functions

Link copied to clipboard
open override fun close()

Closes HttpClient if shouldCloseHttpClient is true.

Properties

Link copied to clipboard
val client: ApiClient

ApiClient instance.

Link copied to clipboard
val credentials: Credentials

Account credentials.

Link copied to clipboard
val httpClient: HttpClient

Ktor HttpClient instance.

Link copied to clipboard
val option: ApiConfig

Api configurations.

Extensions

Link copied to clipboard
fun Session.delete(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates DELETE api request.

Link copied to clipboard
fun Session.get(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates GET api request.

Link copied to clipboard
fun Session.head(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates HEAD api request.

Link copied to clipboard
fun Session.options(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates OPTIONS api request.

Link copied to clipboard
fun Session.patch(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates PATCH api request.

Link copied to clipboard
fun Session.post(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates POST api request.

Link copied to clipboard
fun Session.put(    path: String,     host: EndpointHost = EndpointHost.Default,     builder: ApiRequestBuilder.() -> Unit = {}): ApiRequest

Creates PUT api request.