All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
dart-jaguar.api.mustache Maven / Gradle / Ivy
import 'package:jaguar_retrofit/annotations/annotations.dart';
import 'package:jaguar_retrofit/jaguar_retrofit.dart';
import 'package:jaguar_serializer/jaguar_serializer.dart';
import 'package:jaguar_mimetype/jaguar_mimetype.dart';
import 'dart:async';
{{#operations}}
{{#modelImports}}import 'package:{{pubName}}/model/{{.}}{{#protoFormat}}.pb{{/protoFormat}}.dart';
{{/modelImports}}
{{#fullImports}}import '{{.}}';
{{/fullImports}}
part '{{classFilename}}.jretro.dart';
@GenApiClient()
class {{classname}} extends ApiClient with _${{classname}}Client {
final Route base;
final Map converters;
final Duration timeout;
{{classname}}({this.base, this.converters, this.timeout = const Duration(minutes: 2)});
{{#operation}}
/// {{summary}}
///
/// {{notes}}
@{{httpMethod}}Req(path: "{{path}}"{{#hasAuthMethods}}, metadata: {"auth": [{{#authMethods}} {"type": "{{type}}", "name": "{{name}}"{{#isApiKey}}, "keyName": "{{keyParamName}}", "where": "{{#isKeyInQuery}}query{{/isKeyInQuery}}{{#isKeyInHeader}}header{{/isKeyInHeader}}"{{/isApiKey}} }{{^-last}}, {{/-last}}{{/authMethods}}]}{{/hasAuthMethods}})
Future<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {{nickname}}(
{{#pathParams}}
@PathParam("{{baseName}}") {{dataType}} {{paramName}}{{^-last}}, {{/-last}}
{{/pathParams}}
{{#headerParams}}
{{#-first}}{{#hasPathParams}},{{/hasPathParams}}{{/-first}}
@Header("{{baseName}}") {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}
{{/headerParams}}
{{#queryParams}}
{{#-first}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/-first}}
@QueryParam("{{baseName}}") {{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}
{{/queryParams}}
{{#vendorExtensions}}
{{#formParams}}
{{#-first}}{{#hasQueryParams}},{{/hasQueryParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/-first}}
{{#x-is-json}}@AsJson() {{/x-is-json}}{{#x-is-form}}@AsFormField() {{/x-is-form}}{{#x-is-multipart}}@AsMultipartField() {{/x-is-multipart}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}
{{/formParams}}
{{#bodyParam}}
{{#hasFormParams}},{{/hasFormParams}}{{^hasFormParams}}{{#hasQueryParams}},{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}
{{^x-is-proto}}{{^x-is-json}}{{^x-is-form}}{{^x-is-multipart}}@AsBody(){{/x-is-multipart}}{{/x-is-form}}{{/x-is-json}}{{/x-is-proto}} {{#x-is-proto}}@Serialized(MimeTypes.binary) {{/x-is-proto}}{{#x-is-json}}@AsJson() {{/x-is-json}}{{#x-is-form}}@AsForm() {{/x-is-form}}{{#x-is-multipart}}@AsMultipart() {{/x-is-multipart}}{{{dataType}}} {{paramName}}
{{/bodyParam}}
{{/vendorExtensions}}
) {
return super.{{nickname}}(
{{#pathParams}}
{{paramName}}{{^-last}}, {{/-last}}
{{/pathParams}}
{{#headerParams}}
{{#-first}}{{#hasPathParams}},{{/hasPathParams}}{{/-first}}
{{paramName}}{{^-last}}, {{/-last}}
{{/headerParams}}
{{#queryParams}}
{{#-first}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/-first}}
{{paramName}}{{^-last}}, {{/-last}}
{{/queryParams}}
{{#formParams}}
{{#-first}}{{#hasQueryParams}},{{/hasQueryParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/-first}}
{{paramName}}{{^-last}}, {{/-last}}
{{/formParams}}
{{#bodyParam}}
{{#hasFormParams}},{{/hasFormParams}}{{^hasFormParams}}{{#hasQueryParams}},{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{#hasHeaderParams}},{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}{{^hasFormParams}}{{^hasQueryParams}}{{^hasHeaderParams}}{{#hasPathParams}},{{/hasPathParams}}{{/hasHeaderParams}}{{/hasQueryParams}}{{/hasFormParams}}
{{paramName}}
{{/bodyParam}}
).timeout(timeout);
}
{{/operation}}
}
{{/operations}}