Package zendesk.core

Interface RestServiceProvider



  • public interface RestServiceProvider
    A Provider which is used to create RestApis for sub-SDKs. This is used internally by the Zendesk SDKs and should not be used directly by integrators.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      <E> E createRestService(java.lang.Class<E> clazz, java.lang.String sdkVersion, java.lang.String sdkVariant)
      Create a RestApi from the provided class.
      <E> E createRestService(java.lang.Class<E> clazz, java.lang.String sdkVersion, java.lang.String sdkVariant, CustomNetworkConfig customNetworkConfig)
      Create a RestApi from the provided class, with a configuration class for custom network needs.
      <E> E createUnauthenticatedRestService(java.lang.Class<E> clazz, java.lang.String sdkVersion, java.lang.String sdkVariant, CustomNetworkConfig customNetworkConfig)
      Create a RestApi from the provided class to send unauthenticated requests, with a configuration class for custom network needs.
      OkHttpClient getCoreOkHttpClient()
      Gets an OkHttpClient that's not doing zendesk auth and is not caching responses.
      OkHttpClient getMediaOkHttpClient()
      Gets an OkHttpClient that's doing zendesk auth and is heavily caching responses.
    • Method Detail

      • createRestService

        <E> E createRestService(java.lang.Class<E> clazz,
                                java.lang.String sdkVersion,
                                java.lang.String sdkVariant)
        Create a RestApi from the provided class.
        Uses the internal retrofit2.Retrofit instance to create requested API.
        This should not be used directly by integrators of the Zendesk SDKs.
        Type Parameters:
        E - type of the returned api
        Parameters:
        clazz - the Retrofit service interface to create an implementation of
      • createRestService

        <E> E createRestService(java.lang.Class<E> clazz,
                                java.lang.String sdkVersion,
                                java.lang.String sdkVariant,
                                CustomNetworkConfig customNetworkConfig)
        Create a RestApi from the provided class, with a configuration class for custom network needs.
        Uses the internal link retrofit2.Retrofit instance to create the requested API.
        This should not be used directly by integrators of the Zendesdk SDKs.
        Type Parameters:
        E - type of the returned API
        Parameters:
        clazz - the Retrofit service interface to create an implementation of
        customNetworkConfig - a function object which can be used to add custom configuration to the OkHttpClient and Retrofit instances used for the returned API.
        Returns:
        an instance of a Retrofit service, with the provided customisation applied to its underlying OkHttpClient and Retrofit instances.
      • createUnauthenticatedRestService

        <E> E createUnauthenticatedRestService(java.lang.Class<E> clazz,
                                               java.lang.String sdkVersion,
                                               java.lang.String sdkVariant,
                                               CustomNetworkConfig customNetworkConfig)
        Create a RestApi from the provided class to send unauthenticated requests, with a configuration class for custom network needs.
        Uses the internal link retrofit2.Retrofit instance to create the requested API.
        This should not be used directly by integrators of the Zendesdk SDKs.
        Type Parameters:
        E - type of the returned API
        Parameters:
        clazz - the Retrofit service interface to create an implementation of
        sdkVersion - the version of SDK
        sdkVariant - the variant of SDK
        customNetworkConfig - a function object which can be used to add custom configuration to the OkHttpClient and Retrofit instances used for the returned API.
        Returns:
        an instance of a Retrofit service, with the provided customisation applied to its * underlying OkHttpClient and Retrofit instances.
      • getMediaOkHttpClient

        OkHttpClient getMediaOkHttpClient()
        Gets an OkHttpClient that's doing zendesk auth and is heavily caching responses.
      • getCoreOkHttpClient

        OkHttpClient getCoreOkHttpClient()
        Gets an OkHttpClient that's not doing zendesk auth and is not caching responses.