An open API service indexing awesome lists of open source software.

https://github.com/azurlane-api/azurlanekt

Wrapper for the unofficial azur lane json api in Kotlin
https://github.com/azurlane-api/azurlanekt

Last synced: 12 days ago
JSON representation

Wrapper for the unofficial azur lane json api in Kotlin

Awesome Lists containing this project

README

          

[![](https://jitpack.io/v/azurlane-api/AzurLaneKt.svg)](https://jitpack.io/#azurlane-api/AzurLaneKt)
[![](https://jitci.com/gh/KurozeroPB/AzurLaneKt/svg)](https://jitci.com/gh/KurozeroPB/AzurLaneKt)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/cd784d3ff0e2472eb429bcad34fbdd66)](https://www.codacy.com/manual/KurozeroPB/AzurLaneKt?utm_source=github.com&utm_medium=referral&utm_content=KurozeroPB/AzurLaneKt&utm_campaign=Badge_Grade)

# AzurLaneKt
Wrapper for the unofficial azur lane json api in Kotlin

## Add dependency

Gradle

```kotlin
repositories {
maven(url = "https://jitpack.io")
}
```

```kotlin
dependencies {
implementation("com.github.azurlane-api:AzurLaneKt:Tag")
}
```

Maven

```xml


jitpack.io
https://jitpack.io

```

```xml

com.github.azurlane-api
AzurLaneKt
Tag

```

## Example
Async request

```kotlin
package com.example

import com.github.azurlane_api.api.AzurLane
import com.github.azurlane_api.api.Category

object Example {

@JvmStatic
fun main(args: Array) {
val azurlane = AzurLane("custom_ua/v0.1.0")

val result = azurlane.getShips(Category.TYPE, "Destroyer").complete { result ->
val (ships, exception) = result
when (result) {
is Result.Success -> {
if (!ships.isNullOrEmpty())
ships.forEach { ship -> println("[${ship.id}]: (${ship.name})") }
}
is Result.Failure -> {
println(exception)
}
}
}
}

}
```

Blocking request

```kotlin
package com.example

import com.github.azurlane_api.api.AzurLane
import com.github.azurlane_api.api.Category

object Example {

@JvmStatic
fun main(args: Array) {
val azurlane = AzurLane("custom_ua/v0.1.0")

val result = azurlane.getShips(Category.RARITY, "Super Rare").complete()
val (ships, exception) = result
when (result) {
is Result.Success -> {
if (!ships.isNullOrEmpty())
ships.forEach { ship -> println("[${ship.id}]: (${ship.name})") }
}
is Result.Failure -> {
println(exception)
}
}
}

}
```

## Support
![discord](https://discordapp.com/api/v6/guilds/240059867744698368/widget.png?style=banner2)