All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.baulsupp.oksocial.services.tfl.TflAuthServiceDefinition.kt Maven / Gradle / Ivy

The newest version!
package com.baulsupp.oksocial.services.tfl

import com.baulsupp.oksocial.services.AbstractServiceDefinition

object TflAuthServiceDefinition : AbstractServiceDefinition("api.tfl.gov.uk", "TFL API", "tfl",
  "https://api-portal.tfl.gov.uk/docs", "https://api-portal.tfl.gov.uk/admin/applications/") {

  override fun parseCredentialsString(s: String): TflCredentials {
    val parts = s.split(":".toRegex(), 2)
    return TflCredentials(parts[0], parts[1])
  }

  override fun formatCredentialsString(credentials: TflCredentials) =
    "${credentials.appId}:${credentials.apiKey}"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy