HueStubClient

A stubbed out client used for testing delegation

Functions

Link copied to clipboard
open suspend override fun <REQUEST, RESPONSE> sendRequest(method: String, pathSegments: Array<out String>, responseSerializer: KSerializer<HueResponse<RESPONSE>>, body: REQUEST?, requestSerializer: KSerializer<REQUEST>?): RESPONSE

Make a request to the hue bridge

Link copied to clipboard
open suspend override fun <REQUEST, RESPONSE> sendV1Request(method: String, pathSegments: Array<out String>, responseSerializer: KSerializer<List<V1HueResponse<RESPONSE>>>, body: REQUEST?, requestSerializer: KSerializer<REQUEST>?): RESPONSE

Make a request to the hue bridge as a V1 endpoint.

Extensions

Link copied to clipboard
inline suspend fun <T> HueHttpClient.deleteData(vararg pathSegments: String): T

Make a DELETE request to the hue bridge.@author

Link copied to clipboard
inline suspend fun <T> HueHttpClient.getData(vararg pathSegments: String): T

Make a GET request to the hue bridge.

Link copied to clipboard
inline suspend fun <REQUEST, RESPONSE> HueHttpClient.postData(body: REQUEST, vararg pathSegments: String): RESPONSE

Make a POST request to the hue bridge.

Link copied to clipboard
inline suspend fun <REQUEST, RESPONSE> HueHttpClient.putData(body: REQUEST, vararg pathSegments: String): RESPONSE

Make a PUT request to the hue bridge.