All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dart2.api_doc.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
# {{{pubName}}}.api.{{{classname}}}{{#description}}
{{{.}}}{{/description}}

## Load the API package
```dart
import 'package:{{{pubName}}}/api.dart';
```

All URIs are relative to *{{{basePath}}}*

Method | HTTP request | Description
------------- | ------------- | -------------
{{#operations}}{{#operation}}[**{{{operationId}}}**]({{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}}
{{/operation}}{{/operations}}

{{#operations}}
{{#operation}}
# **{{{operationId}}}**
> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})

{{{summary}}}{{#notes}}

{{{.}}}{{/notes}}

### Example
```dart
import 'package:{{{pubName}}}/api.dart';
{{#hasAuthMethods}}
{{#authMethods}}
{{#isBasic}}
{{#isBasicBasic}}
// TODO Configure HTTP basic authorization: {{{name}}}
//defaultApiClient.getAuthentication('{{{name}}}').username = 'YOUR_USERNAME'
//defaultApiClient.getAuthentication('{{{name}}}').password = 'YOUR_PASSWORD';
{{/isBasicBasic}}
{{#isBasicBearer}}
// TODO Configure HTTP Bearer authorization: {{{name}}}
// Case 1. Use String Token
//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication('{{{name}}}').setAccessToken(yourTokenGeneratorFunction);
{{/isBasicBearer}}
{{/isBasic}}
{{#isApiKey}}
// TODO Configure API key authorization: {{{name}}}
//defaultApiClient.getAuthentication('{{{name}}}').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication('{{{name}}}').apiKeyPrefix = 'Bearer';
{{/isApiKey}}
{{#isOAuth}}
// TODO Configure OAuth2 access token for authorization: {{{name}}}
//defaultApiClient.getAuthentication('{{{name}}}').accessToken = 'YOUR_ACCESS_TOKEN';
{{/isOAuth}}
{{/authMethods}}
{{/hasAuthMethods}}

final api_instance = {{{classname}}}();
{{#allParams}}
final {{{paramName}}} = {{#isArray}}[{{/isArray}}{{#isBodyParam}}{{{dataType}}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isArray}}]{{/isArray}}; // {{{dataType}}} | {{{description}}}
{{/allParams}}

try {
    {{#returnType}}final result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});
    {{#returnType}}
    print(result);
    {{/returnType}}
} catch (e) {
    print('Exception when calling {{{classname}}}->{{{operationId}}}: $e\n');
}
```

### Parameters
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
{{#allParams}} **{{{paramName}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{{dataType}}}**]({{{baseType}}}.md){{/isPrimitiveType}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
{{/allParams}}

### Return type

{{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{{returnBaseType}}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}

### Authorization

{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}}

### HTTP request headers

 - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}}
 - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}}

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

{{/operation}}
{{/operations}}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy