Skip to content

Instantly share code, notes, and snippets.

View diegolucasb's full-sized avatar
🎯
Focusing

Lucas Diego diegolucasb

🎯
Focusing
View GitHub Profile

For SDK Builder on Kotlin, Swift and Web plataforms, how do we:

...Instanciate the SDK?

  • Kotlin
  val sdk = SlingSDK.Builder().build()
  
  //with parameters
  val sdk = SlingSDK.Builder()
          .setUrl("url.com/v0")
val sdk = SlingSDK.build {
url = "https://url.com.br/v0/"
authenticationToken = token
affiliationCode = stoneCode
headers = mapOf()
}
sdk.merchant.contact.list(
success = { Log.i("SDK", it?.data?.forEach { it.toString() }.toString())},
error = { Log.e("SDK", it.toString()) }
package stone.com.br.slingkotlinsdk.builderpattern
/**
* Created by diegolucasb on 09/07/18.
* Copyright (c) Stone Co. All rights reserved.
* lucas.amaral@stone.com.br
*/
class SlingSDK(
url: String,
headers: Map<String, String>? = null,