sdk-common / com.tomtom.online.sdk.common.service / NativeService

NativeService

abstract class NativeService<ResponseType : ServiceResponse!, QueryType : NativeObject!> : Service<ResponseType, QueryType>

Base class for native REST services.

Constructors

<init>

NativeService(server: String!, apiVersion: String!, apiKey: String!, sdkVersion: String!, applicationClientId: String!, applicationClientVersion: String!)

Creates an an instance of NativeService using the provided parameters.

Properties

apiKey

val apiKey: String!

apiVersion

val apiVersion: String!

applicationClientId

val applicationClientId: String!

applicationClientVersion

val applicationClientVersion: String!

sdkVersion

val sdkVersion: String!

server

val server: String!

Functions

cancel

open fun cancel(): Unitabstract fun cancel(handle: Long): Unit

Cancels a REST request in progress.

construct

abstract fun construct(server: String!, apiVersion: String!, apiKey: String!): Long

Creates an instance of the native REST service handler.

destruct

abstract fun destruct(handle: Long): Unit

Destroys the native object.

getApiKey

open fun getApiKey(): String!

Returns the TomTom API Key.

getApiVersion

open fun getApiVersion(): String!

Returns the version of the TomTom API to perform requests against.

getApplicationClientId

open fun getApplicationClientId(): String!

Returns the client id used for STE analytics.

getApplicationClientVersion

open fun getApplicationClientVersion(): String!

Returns the client version used for STE analytics.

getSdkVersion

open fun getSdkVersion(): String!

Returns the version of the TomTom SDK used.

getServer

open fun getServer(): String!

Returns the URI of the server.

initializeAnalytics

abstract fun initializeAnalytics(nativeHandle: Long, sdkVersion: String!, applicationClientId: String!, applicationClientVersion: String!): Unit

Initializes STE analytics.

query

open fun query(query: QueryType): Single<ResponseType>!

requestSync

abstract fun <ResponseType : Any!> requestSync(handle: Long, queryHandle: Long): ResponseType

Makes a REST service request.

tryQuery

open fun tryQuery(query: QueryType): Try<ResponseType>!