$import method

Future<DynamiteResponse<Recipe, void>> $import({
  1. required Url $body,
})

Import a recipe using schema.org metadata from a website.

Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers. Throws a DynamiteApiException if the API call does not return an expected status code.

Status codes:

  • 200: Successfully imported recipe
  • 400: The URL to be imported was not inserted in the request or any other issue was rosen.
  • 409: There exists a recipe with that name already. Import was aborted.

See:

Implementation

Future<_i1.DynamiteResponse<Recipe, void>> $import({required Url $body}) async {
  final _request = $$import_Request(
    $body: $body,
  );
  final _streamedResponse = await _rootClient.httpClient.send(_request);
  final _response = await _i3.Response.fromStream(_streamedResponse);

  final _serializer = $$import_Serializer();
  return _i1.ResponseConverter<Recipe, void>(_serializer).convert(_response);
}