SHARE
TWEET

Untitled

a guest Jun 20th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fun apiMobileAPIGetProviderPost(disc: kotlin.Any, pageIndex: kotlin.Int, pageSize: kotlin.Int, sort: kotlin.String, order: kotlin.String) : kotlin.Array<ProviderData> {
  2.         val localVariableBody: kotlin.Any? = disc
  3.         val localVariableQuery: MultiValueMap = mapOf("pageIndex" to listOf("$pageIndex"), "pageSize" to listOf("$pageSize"), "sort" to listOf("$sort"), "order" to listOf("$order"))
  4.  
  5.         val contentHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
  6.         val acceptsHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Accept" to "application/json")
  7.         val localVariableHeaders: kotlin.collections.MutableMap<kotlin.String,kotlin.String> = mutableMapOf()
  8.         localVariableHeaders.putAll(contentHeaders)
  9.         localVariableHeaders.putAll(acceptsHeaders)
  10.  
  11.         val localVariableConfig = RequestConfig(
  12.             RequestMethod.POST,
  13.             "/api/MobileAPI/GetProvider",
  14.             query = localVariableQuery,
  15.             headers = localVariableHeaders
  16.         )
  17.         val response = request<kotlin.Array<ProviderData>>(
  18.             localVariableConfig,
  19.             localVariableBody
  20.         )
  21.  
  22.         return when (response.responseType) {
  23.             ResponseType.Success -> (response as Success<*>).data as kotlin.Array<ProviderData>
  24.             ResponseType.Informational -> TODO()
  25.             ResponseType.Redirection -> TODO()
  26.             ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
  27.             ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
  28.             else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
  29.         }
  30.     }
  31.      
  32. val params = HashMap<String, String>()
  33.         MobileAPIApi().apiMobileAPIGetProviderPost(params,0,50,null,null,
  34.             object : Response.Listener<List<ProviderData>>() {
  35.                 fun onResponse(response: List<ProviderData>?) {
  36.                     if (response != null && response.size != 0) {......}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top