NanoleafClient
public final class NanoleafClient
An API client that sends requests to Nanoleaf devices.
-
Declaration
Swift
public let session: HTTPSession
-
Initialize a new
NanoleafClient
instance.Declaration
Swift
public required init(session: HTTPSession)
Parameters
session
A
HTTPSession
instance.
-
execute(request:
Asynchronous) Execute a request.
Throws
An error of typeAPIError
.Declaration
Swift
public func execute<T>(request: T) async throws -> T.ResponseObject where T : HTTPRequest
Return Value
The HTTPRequest’s response object.
-
Declaration
Swift
public static func main( session: HTTPSession = URLSession(configuration: .default) ) -> Self