Package zendesk.core

Class CustomNetworkConfig



  • public abstract class CustomNetworkConfig
    extends java.lang.Object
    Abstract class for customising network configuration, to be used by Zendesk SDKs in conjunction with RestServiceProvider#createRestService(Class, CustomNetworkConfig).

    It provides a way to add custom configuration to the OkHttpClient and Retrofit objects used to power a generated Retrofit service API class, through implementing the configuration methods. Both are empty by default.

    This class should not be used directly by integrators.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void configureOkHttpClient(OkHttpClient.Builder builder)
      Add custom configuration to the OkHttpClient.Builder which will be used by the object returned by RestServiceProvider#createRestService(Class, CustomNetworkConfig).
      void configureRetrofit(Retrofit.Builder builder)
      Add custom configuration to the Retrofit.Builder which will be used by the object returned by RestServiceProvider#createRestService(Class, CustomNetworkConfig).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CustomNetworkConfig

        public CustomNetworkConfig()
    • Method Detail

      • configureOkHttpClient

        public void configureOkHttpClient(OkHttpClient.Builder builder)
        Add custom configuration to the OkHttpClient.Builder which will be used by the object returned by RestServiceProvider#createRestService(Class, CustomNetworkConfig).
        Parameters:
        builder - a OkHttpClient.Builder with starting configuration from the Zendesk Core SDK.
      • configureRetrofit

        public void configureRetrofit(Retrofit.Builder builder)
        Add custom configuration to the Retrofit.Builder which will be used by the object returned by RestServiceProvider#createRestService(Class, CustomNetworkConfig).
        Parameters:
        builder - a Retrofit.Builder with starting configuration from the Zendesk Core SDK.