Metron

class Metron(username: String, password: String, val cache: SQLiteCache? = null, timeout: Duration = Duration.ofSeconds(30), var maxRetries: Int = 5)

A client for interacting with the Metron API.

Parameters

username

The username for authentication with the Metron API.

password

The password for authentication with the Metron API.

cache

An optional SQLiteCache instance for caching API responses. Defaults to null (no caching).

timeout

The maximum duration for HTTP connections. Defaults to 30 seconds.

maxRetries

The maximum number of retries for requests that fail due to rate-limiting. Defaults to 5.

Constructors

Link copied to clipboard
constructor(username: String, password: String, cache: SQLiteCache? = null, timeout: Duration = Duration.ofSeconds(30), maxRetries: Int = 5)

Creates a new instance of the Metron client.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val cache: SQLiteCache? = null

The optional cache instance used for storing and retrieving cached API responses.

Link copied to clipboard

The maximum number of retries allowed for rate-limited requests.

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
fun listCharacters(params: Map<String, String> = emptyMap()): List<BaseResource>

Retrieves a list of Characters from the Metron API.

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

Retrieves a list of Creators from the Metron API.

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

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
fun listPublishers(params: Map<String, String> = emptyMap()): List<BaseResource>

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
fun listSeriesTypes(params: Map<String, String> = emptyMap()): List<GenericItem>

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
fun listUniverses(params: Map<String, String> = emptyMap()): List<BaseResource>

Retrieves a list of Universes from the Metron API.