Metron

class Metron @JvmOverloads constructor(baseUrl: String = "https://metron.cloud/api", username: String, password: String, userAgent: String = "Kraken/", timeout: Duration = 30.seconds, maxRetries: Int = 5, cache: SQLiteCache, policy: CachePolicy? = CachePolicy(percent = 0.1, expiry = 14.days))

A client for interacting with the Metron API.

Parameters

baseUrl

The base url of the Metron API.

username

The username for authentication with the Metron API.

password

The password for authentication with the Metron API.

userAgent

The HTTP User-Agent sent with every request.

timeout

The maximum duration to wait for a HTTP request to complete before timing out.

maxRetries

The maximum number of retry attempts for requests that fail due to RateLimiting errors.

cache

A SQLiteCache instance for caching API responses.

policy

An optional CachePolicy that determines how long cached responses remain valid and when they should be refreshed. If null, cached responses are never marked stale.

Constructors

Link copied to clipboard
constructor(baseUrl: String = "https://metron.cloud/api", username: String, password: String, userAgent: String = "Kraken/", timeout: Duration = 30.seconds, maxRetries: Int = 5, cache: SQLiteCache, policy: CachePolicy? = CachePolicy(percent = 0.1, expiry = 14.days))

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun getArc(id: Long): Arc

Retrieves details of a specific Arc by its ID.

Link copied to clipboard

Retrieves details of a specific Character by its ID.

Link copied to clipboard

Retrieves details of a specific Creator by its ID.

Link copied to clipboard

Retrieves details of a specific Imprint by its ID.

Link copied to clipboard
fun getIssue(id: Long): Issue

Retrieves details of a specific Issue by its ID.

Link copied to clipboard

Retrieves details of a specific Publisher by its ID.

Link copied to clipboard

Retrieves details of a specific Series by its ID.

Link copied to clipboard
fun getTeam(id: Long): Team

Retrieves details of a specific Team by its ID.

Link copied to clipboard

Retrieves details of a specific Universe by its ID.

Link copied to clipboard
fun listArcs(params: Map<String, String> = emptyMap()): List<BaseResource>

Retrieves a list of Arcs from the Metron API.

Link copied to clipboard

Retrieves a list of Characters from the Metron API.

Link copied to clipboard

Retrieves a list of Creators from the Metron API.

Link copied to clipboard

Retrieves a list of Imprints from the Metron API.

Link copied to clipboard
fun listIssues(params: Map<String, String> = emptyMap()): List<BasicIssue>

Retrieves a list of Issues from the Metron API.

Link copied to clipboard

Retrieves a list of Publishers from the Metron API.

Link copied to clipboard
fun listRoles(params: Map<String, String> = emptyMap()): List<GenericItem>

Retrieves a list of Roles from the Metron API.

Link copied to clipboard
fun listSeries(params: Map<String, String> = emptyMap()): List<BasicSeries>

Retrieves a list of Series from the Metron API.

Link copied to clipboard

Retrieves a list of SeriesTypes from the Metron API.

Link copied to clipboard
fun listTeams(params: Map<String, String> = emptyMap()): List<BaseResource>

Retrieves a list of Teams from the Metron API.

Link copied to clipboard

Retrieves a list of Universes from the Metron API.