dynamic_call library

Classes

Authorization
Represents a kind of HTTP Authorization.
BasicCredential
A HTTP Basic Credential for the Authorization header.
BearerCredential
A HTTP Bearer Credential for the Authorization header.
Credential
Abstract Credential for HttpRequest.
DataCallHttp
Represents a HttpCall to request data.
DataHandler<T>
Base class for DataSource and DataReceiver.
DataReceiver<T>
Represents a data receiver, that can store or process data.
DataReceiverDynCall<T>
A DataReceiver based in a DynCall for requests.
DataReceiverExecutor<E, T>
A DataReceiver based in a DynCallExecutor for requests.
DataReceiverHttp<T>
A DataReceiver based in a DataCallHttp for requests.
DataRepository<T>
Represents simultaneously a DataSource and a DataReceiver.
DataRepositoryHttp<T>
A DataRepository based in a DataCallHttp for requests.
DataRepositoryWrapper<T>
Represents a DataRepository that wraps a DataSource instance and a DataReceiver instance
DataSource<T>
Represents a Data source
DataSourceCall<T>
DataSourceDynCall<T>
A DataSource based in a DynCall for requests.
DataSourceExecutor<E, T>
A DataSource based in a DynCallExecutor for requests.
DataSourceHttp<T>
A DataSource based in a DataCallHttp for requests.
DataSourceOperationHttp<T>
DataSourceResolver<T>
Wrapper to resolve a DataSource.
DataSourceResponse<T>
DynCall<E, O>
A Dynamic Call specification
DynCallCredential
Abstract class for credentials.
DynCallCredentialHTTP
A HTTP Credential.
DynCallExecutor<E>
Abstract class for the executor implementation.
DynCallFunctionExecutor<R, T>
A DynCallExecutor that calls a DynCallFunction for results.
DynCallHttpClient
A HTTP Client for DynCallHttpExecutor calls.
DynCallHttpExecutor<E>
A DynCallExecutor for HTTP calls.
DynCallHttpExecutorFactory
A Factory that helps to define/attach HTTP executors to calls.
DynCallHttpExecutorFactory_builder<E, O>
The Builder returned by Factory call(...) method.
DynCallStaticExecutor<E>
Static DynCallExecutor, with predefined results.
HttpBlob<B>
HttpBody
A wrapper for multiple types of data body.
HttpCache
A cache for HttpClient. Request originated from this cache are stored in memory.
HttpCall<R>
Represents a simple HTTP call that can be called many times.
HttpClient
Mercury HTTP Client.
HttpClientInterceptor
An interceptor that can be used to filter requests and responses.
HttpClientRequester
Abstract HttpClient requester. This should implement the actual request process.
HttpClientRequesterSimulation
A Simulated HttpClientRequester. Useful for tests and mocks.
HttpError
Represents a response Error.
HTTPOutputInterceptorWrapper<E>
HttpRequest
Represents the HTTP request.
HttpRequestBody
Represents a body content, used by HttpRequest.
HttpRequester
A Class able to do a HTTP request based in properties:
HttpResponse
The response of a HttpRequest.
HttpStatus
Represents a HTTP Status with helpers. Base for HttpResponse and HttpError.
JSONBodyCredential
A Credential that injects a JSON in the HttpRequest body.
QueryStringCredential
A Credential that injects fields in the Query parameters.

Enums

DataSourceOperation
Enum for type of DataSource operation.
DynCallType
HttpMethod
HTTP Method
OnHttpErrorAnswer
Specify an HTTP error.

Properties

DEFAULT_DATA_SOURCE_BASE_URL String?
getter/setter pair

Functions

buildURLWithQueryParameters(String url, Map<String, String?> parameters, {bool removeFragment = false}) String
Builds an URL with Query parameters adding the map parameters to current Query parameters.
canHttpMethodHaveBody(HttpMethod method) bool
contentTypeToDecoder(MimeType mimeType) Converter<List<int>, String>
Returns de decoder for a Content-Type at parameter mimeType and charset.
createHttpBlob(List content, MimeType? mimeType) HttpBlob?
createHttpClientRequester() HttpClientRequester
Creates a HttpClientRequester based in imported platform.
doDataSourceOperation<T>(DataSource<T> dataSource, DataSourceOperation operation, Map<String, String>? parameters, [List<T>? dataList]) Future<List<T?>?>
Performs a DataSourceOperation over dataSource instance.
doTransformFrom<T>(T? data, DataTransformerFrom<T>? transformerFrom) → dynamic
doTransformFromList<T>(List<T>? list, DataTransformerFrom<T>? transformerFrom, DataTransformerFromList<T>? transformerFromList) → dynamic
doTransformTo<T>(Object? o, DataTransformerTo<T>? transformerTo) → T?
doTransformToList<T>(Object? o, DataTransformerTo<T>? transformerTo, DataTransformerToList<T>? transformerToList) List<T>?
getDataSourceOperation(String? name) DataSourceOperation?
Returns a DataSourceOperation by name.
getDataSourceOperationName(DataSourceOperation? operation) String?
getHttpClientRuntimeUri() Uri
Returns the base runtime Uri for the platform.
getHttpMethod(String? method, [HttpMethod? def]) HttpMethod?
Returns HttpMethod instance for method parameter.
getHttpMethodName(HttpMethod? method, [HttpMethod? def]) String?
Returns method name.
isHttpBlob(Object o) bool
methodAcceptsQueryString(HttpMethod method) bool
resolveDataSourceBaseURL(String url) String
transformToList<T>(Object? o) List<T>
transformToType<T>(Object? o) → T?

Typedefs

AuthorizationInterceptor = void Function(Authorization? authorization)
AuthorizationProvider = Future<Credential?> Function(HttpClient client, HttpError? lastError)
BodyBuilderFunctionDynamic = dynamic Function(Map<String, String?>? callParameters, Map<String, String?>? requestParameters)
BodyBuilderFunctionSimpleDynamic = dynamic Function()
BodyBuilderFunctionSimpleString = String Function()
BodyBuilderFunctionString = String Function(Map<String, String?>? callParameters, Map<String, String?>? requestParameters)
DataTransformerFrom<T> = dynamic Function(T? data)
DataTransformerFromList<T> = dynamic Function(List<T>? dataList)
DataTransformerTo<T> = T? Function(Object? o)
DataTransformerToList<T> = List<T>? Function(Object? o)
DynCallCredentialParser<E> = DynCallCredential? Function(String? output, String? outputFiltered, Map<String, String?>? parameters, Map<String, String?>? requestParameters)
DynCallFunction<R, T> = Future<R> Function(DynCall<R, T>? dynCall, Map<String, String?>? parameters)
ExecutorWrapper = DynCallExecutor Function(DynCallExecutor executor)
HttpBodyBuilder = dynamic Function(Map<String, String?> parameters)
Function to dynamically build a HTTP body.
HttpBodyBuilderTyped = dynamic Function(Map<String, String?> parameters, String? type)
HttpClientURLFilter = String Function(String url, Map<String, String?>? queryParameters)
HTTPJSONOutputFilter = dynamic Function(dynamic json, Map<String, String?>? callParameters, Map<String, String?>? requestParameters)
HTTPOutputFilter = String Function(String? output, Map<String, String?>? callParameters, Map<String, String?>? requestParameters)
HTTPOutputInterceptor<E> = void Function(DynCallExecutor<E?> executor, String? outputOriginal, bool outputValid, String? outputFiltered, Map<String, String?>? callParameters, Map<String, String?>? requestParameters)
HTTPOutputValidator = bool Function(String? output, Map<String, String?>? callParameters, Map<String, String?>? requestParameters)
OnCachedResponse = void Function(HttpResponse cachedResponse)
OnHttpError = OnHttpErrorAnswer Function(HttpError? error)
ParameterProvider = String Function(String key)
ProgressListener = void Function(HttpRequest request, int? loaded, int? total, double? ratio, bool upload)
RequestHeadersBuilder = Map<String, String> Function(HttpClient client, String url)
ResponseHeaderGetter = String? Function(String headerKey)
ResponseProcessor = void Function(HttpClient client, Object request, HttpResponse response)
SimulateResponse = dynamic Function(String url, Map<String, String?>? queryParameters)
SysCallCallback<O> = void Function(O output, Map<String, dynamic>? parameters)
Callback function.
SysCallOutputFilter<O, E> = O Function(E output)
SysProgressListener<O> = void Function(int? loaded, int? total, double? ratio, bool upload)
Progress function.