dart2.README.mustache Maven / Gradle / Ivy
# {{{pubName}}}
{{#appDescriptionWithNewLines}}
{{{.}}}
{{/appDescriptionWithNewLines}}
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: {{{appVersion}}}
{{#artifactVersion}}
- Package version: {{{.}}}
{{/artifactVersion}}
{{^hideGenerationTimestamp}}
- Build date: {{{generatedDate}}}
{{/hideGenerationTimestamp}}
- Generator version: {{generatorVersion}}
- Build package: {{{generatorClass}}}
{{#infoUrl}}
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
{{/infoUrl}}
## Requirements
Dart 2.12 or later
## Installation & Usage
### Github
If this Dart package is published to Github, add the following dependency to your pubspec.yaml
```
dependencies:
{{{pubName}}}:
git: https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
```
### Local
To use the package in your local drive, add the following dependency to your pubspec.yaml
```
dependencies:
{{{pubName}}}:
path: /path/to/{{{pubName}}}
```
## Tests
TODO
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```dart
import 'package:{{{pubName}}}/api.dart';
{{#apiInfo}}{{#apis}}{{#-first}}{{#operations}}{{#operation}}{{#-first}}
{{#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');
}
{{/-first}}{{/operation}}{{/operations}}{{/-first}}{{/apis}}{{/apiInfo}}
```
## Documentation for API Endpoints
All URIs are relative to *{{{basePath}}}*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{{classname}}}* | [**{{{operationId}}}**]({{{apiDocPath}}}/{{{classname}}}.md#{{{operationIdLowerCase}}}) | **{{{httpMethod}}}** {{{path}}} | {{{summary}}}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
## Documentation For Models
{{#models}}{{#model}} - [{{{classname}}}]({{{modelDocPath}}}/{{{classname}}}.md)
{{/model}}{{/models}}
## Documentation For Authorization
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
{{#authMethods}}
### {{{name}}}
{{#isApiKey}}- **Type**: API key
- **API key parameter name**: {{{keyParamName}}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
- **Type**: HTTP Basic authentication
{{/isBasicBasic}}
{{#isBasicBearer}}
- **Type**: HTTP Bearer authentication
{{/isBasicBearer}}
{{#isHttpSignature}}
- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{/isBasic}}
{{#isOAuth}}- **Type**: OAuth
- **Flow**: {{{flow}}}
- **Authorization URL**: {{{authorizationUrl}}}
- **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}} - **{{{scope}}}**: {{{description}}}
{{/scopes}}
{{/isOAuth}}
{{/authMethods}}
## Author
{{#apiInfo}}{{#apis}}{{#-last}}{{{infoEmail}}}
{{/-last}}{{/apis}}{{/apiInfo}}