GiphyApiImpl
internal class GiphyApiImpl(authenticatedNetworkClient: AuthenticatedNetworkClient, mediaNetworkClient: UnboundNetworkClient) : GiphyApi
The proxy route is the same on every API version, so one implementation serves all of them. mediaNetworkClient must be unauthenticated: GIF files come from Giphy's CDN, never from the Wire backend.
Constructors
Link copied to clipboard
constructor(authenticatedNetworkClient: AuthenticatedNetworkClient, mediaNetworkClient: UnboundNetworkClient)
Functions
Link copied to clipboard
open suspend override fun downloadGif(url: String, maxSizeInBytes: Long, sink: Sink): NetworkResponse<Long>
Downloads a GIF from Giphy's CDN into sink, without Wire credentials. Fails unless url and the final address after redirects are HTTPS giphy.com addresses, and stops reading once the body exceeds maxSizeInBytes.
Link copied to clipboard
open suspend override fun search(query: String, limit: Int, offset: Int, rating: String, language: String?): NetworkResponse<GiphyGifsResponseDTO>
Link copied to clipboard
open suspend override fun searchSuggestions(query: String): NetworkResponse<GiphySearchSuggestionsResponseDTO>
Link copied to clipboard
open suspend override fun trending(limit: Int, offset: Int, rating: String): NetworkResponse<GiphyGifsResponseDTO>