Package blue.starry.penicillin.core.session.config

Types

Link copied to clipboard
data class ApiConfig(    val emulationMode: EmulationMode,     val skipEmulationChecking: Boolean,     val defaultTweetMode: TweetMode) : SessionConfig

Configurations related to api execution.

Link copied to clipboard
data class Credentials(    val consumerKey: String?,     val consumerSecret: String?,     val accessToken: String?,     val accessTokenSecret: String?,     val bearerToken: String?,     val knownDeviceToken: String?) : SessionConfig

Represents your application and account credentials.

Link copied to clipboard
interface SessionConfig

Represents additional config from SessionConfigBuilder.

Link copied to clipboard
interface SessionConfigBuilder<C : SessionConfig>

Represents additional config builder which is used in ApiClient builder.

Functions

Link copied to clipboard
fun SessionBuilder.account(block: Credentials.Builder.() -> Unit)

Initializes account configuration.

Link copied to clipboard
fun SessionBuilder.api(block: ApiConfig.Builder.() -> Unit)

Creates ApiConfig configurations. Provides timeout, retries, emulations and so on.

Link copied to clipboard
fun Credentials.Builder.application(client: OfficialClient.OAuth1a)

Configures your application with predefined OAuth 1.0a client.

fun Credentials.Builder.application(consumerKey: String, consumerSecret: String)

Configures your application with consumer key and consumer secret.

Link copied to clipboard
fun SessionBuilder.httpClient(client: HttpClient)

Creates HttpClient with existing client.

fun SessionBuilder.httpClient(block: HttpClientConfig<*>.() -> Unit = {})

Creates HttpClient with default engine factory and engine config block

fun <T : HttpClientEngineConfig> SessionBuilder.httpClient(engineFactory: HttpClientEngineFactory<T>, block: HttpClientConfig<T>.() -> Unit = {})

Creates HttpClient with engine factory and config block.

Link copied to clipboard
fun ApiConfig.Builder.skipEmulationChecking()

Skips emulationMode checking.

Link copied to clipboard
fun Credentials.Builder.token(client: OfficialClient.OAuth2)

Configures your account with predefined OAuth 2 client.

fun Credentials.Builder.token(bearerToken: String)

Configures your account with bearer token.

fun Credentials.Builder.token(accessToken: String, accessTokenSecret: String)

Configures your account with access token and access token secret.