Logging
Enable logging by setting theTELNYX_LOG environment variable to info:
debug for more verbose logging:
logLevel method:
ProGuard and R8
Although the SDK uses reflection, it is still usable with ProGuard and R8 becausetelnyx-core is published with a configuration file containing keep rules.
ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.
Jackson
The SDK depends on Jackson for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default. The SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config). If the SDK threw an exception, but you’re certain the version is compatible, then disable the version check using thecheckJacksonVersionCompatibility on TelnyxOkHttpClient or TelnyxOkHttpClientAsync.
[!CAUTION] We make no guarantee that the SDK works correctly when the Jackson version check is disabled.Also note that there are bugs in older Jackson versions that can affect the SDK. We don’t work around all Jackson bugs (example) and expect users to upgrade Jackson for those instead.
Undocumented API functionality
The SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.Parameters
To set undocumented parameters, call theputAdditionalHeader, putAdditionalQueryParam, or putAdditionalBodyProperty methods on any Params class:
_additionalHeaders(), _additionalQueryParams(), and _additionalBodyProperties() methods.
To set undocumented parameters on nested headers, query params, or body classes, call the putAdditionalProperty method on the nested class:
_additionalProperties() method.
To set a documented parameter or property to an undocumented or not yet supported value, pass a JsonValue object to its setter:
JsonValue is using its from(...) method:
Builder class’s build method will throw IllegalStateException if any required parameter or property is unset.
To forcibly omit a required parameter or property, pass JsonMissing:
Response properties
To access undocumented response properties, call the_additionalProperties() method:
_ prefixed method:
Response validation
In rare cases, the API may return a response that doesn’t match the expected type. For example, the SDK may expect a property to contain aString, but the API could return something else.
By default, the SDK will not throw an exception in this case. It will throw TelnyxInvalidDataException only if you directly access the property.
Validating the response is not forwards compatible with new types from the API for existing fields.
If you would still prefer to check that the response is completely well-typed upfront, then either call validate():
responseValidation method:
Proxies
To route requests through a proxy, configure the client using theproxy method:
407 Proxy Authentication Required, supply credentials by also configuring proxyAuthenticator: