ApiEndpoint<T extends Object> constructor

ApiEndpoint<T extends Object>({
  1. required JsonDeserializer<T> deserializer,
  2. required String host,
  3. required JsonSerializer<T> serializer,
  4. HttpHeaders? headers,
  5. String path = '',
  6. HttpProtocol protocol = HttpProtocol.https,
  7. QueryParameters? queryParameters,
})

A factory constructor that returns a ApiEndpoint from the parameters.

  • deserializer deserializes JSON to an object of type T.
  • serializer serializes an object of type T to JSON.
  • host is the host part of the API endpoint request.
  • headers is a nullable hashmap of headers for the API endpoint request.
  • path is the path element for the API endpoint uri. Defaults to an empty String.
  • protocol is the HttpProtocol of the API endpoint.
  • queryParameters is a nullable hashmap of query parameters for the API endpoint request.

Implementation

factory ApiEndpoint(
        {required JsonDeserializer<T> deserializer,
        required String host,
        required JsonSerializer<T> serializer,
        HttpHeaders? headers,
        String path = '',
        HttpProtocol protocol = HttpProtocol.https,
        QueryParameters? queryParameters}) =>
    _ApiEndpointImpl(deserializer, headers, host, path, protocol,
        queryParameters, serializer);