|
| 1 | +# {{pubName}} |
| 2 | +{{#appDescription}} |
| 3 | +{{{appDescription}}} |
| 4 | +{{/appDescription}} |
| 5 | + |
| 6 | +This Dart package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: |
| 7 | + |
| 8 | +- API version: {{appVersion}} |
| 9 | +{{#artifactVersion}} |
| 10 | +- Package version: {{artifactVersion}} |
| 11 | +{{/artifactVersion}} |
| 12 | +{{^hideGenerationTimestamp}} |
| 13 | +- Build date: {{generatedDate}} |
| 14 | +{{/hideGenerationTimestamp}} |
| 15 | +- Build package: {{generatorClass}} |
| 16 | +{{#infoUrl}} |
| 17 | +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) |
| 18 | +{{/infoUrl}} |
| 19 | + |
| 20 | +## Requirements |
| 21 | + |
| 22 | +Dart 1.20.0 or later OR Flutter 0.0.20 or later |
| 23 | + |
| 24 | +## Installation & Usage |
| 25 | + |
| 26 | +### Github |
| 27 | +If this Dart package is published to Github, please include the following in pubspec.yaml |
| 28 | +``` |
| 29 | +name: {{pubName}} |
| 30 | +version: {{pubVersion}} |
| 31 | +description: {{pubDescription}} |
| 32 | +dependencies: |
| 33 | + {{pubName}}: |
| 34 | + git: https://github.com/{{gitUserId}}/{{gitRepoId}}.git |
| 35 | + version: 'any' |
| 36 | +``` |
| 37 | + |
| 38 | +### Local |
| 39 | +To use the package in your local drive, please include the following in pubspec.yaml |
| 40 | +``` |
| 41 | +dependencies: |
| 42 | + {{pubName}}: |
| 43 | + path: /path/to/{{pubName}} |
| 44 | +``` |
| 45 | + |
| 46 | +## Tests |
| 47 | + |
| 48 | +TODO |
| 49 | + |
| 50 | +## Getting Started |
| 51 | + |
| 52 | +Please follow the [installation procedure](#installation--usage) and then run the following: |
| 53 | + |
| 54 | +```dart |
| 55 | +import 'package:{{pubName}}/api.dart'; |
| 56 | +{{#apiInfo}}{{#apis}}{{#@first}}{{#operations}}{{#operation}}{{#@first}} |
| 57 | +{{#hasAuthMethods}} |
| 58 | +{{#authMethods}} |
| 59 | +{{#isBasic}} |
| 60 | +// TODO Configure HTTP basic authorization: {{{name}}} |
| 61 | +//{{pubName}}.api.Configuration.username = 'YOUR_USERNAME'; |
| 62 | +//{{pubName}}.api.Configuration.password = 'YOUR_PASSWORD'; |
| 63 | +{{/isBasic}} |
| 64 | +{{#isApiKey}} |
| 65 | +// TODO Configure API key authorization: {{{name}}} |
| 66 | +//{{pubName}}.api.Configuration.apiKey{'{{{keyParamName}}}'} = 'YOUR_API_KEY'; |
| 67 | +// uncomment below to setup prefix (e.g. Bearer) for API key, if needed |
| 68 | +//{{pubName}}.api.Configuration.apiKeyPrefix{'{{{keyParamName}}}'} = "Bearer"; |
| 69 | +{{/isApiKey}} |
| 70 | +{{#isOAuth}} |
| 71 | +// TODO Configure OAuth2 access token for authorization: {{{name}}} |
| 72 | +//{{pubName}}.api.Configuration.accessToken = 'YOUR_ACCESS_TOKEN'; |
| 73 | +{{/isOAuth}} |
| 74 | +{{/authMethods}} |
| 75 | +{{/hasAuthMethods}} |
| 76 | + |
| 77 | +var api_instance = new {{classname}}(); |
| 78 | +{{#allParams}} |
| 79 | +var {{paramName}} = {{#isListContainer}}[{{/isListContainer}}{{#isBodyParam}}new {{dataType}}(){{/isBodyParam}}{{^isBodyParam}}{{{example}}}{{/isBodyParam}}{{#isListContainer}}]{{/isListContainer}}; // {{{dataType}}} | {{{description}}} |
| 80 | +{{/allParams}} |
| 81 | + |
| 82 | +try { |
| 83 | + {{#returnType}}var result = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); |
| 84 | + {{#returnType}} |
| 85 | + print(result); |
| 86 | + {{/returnType}} |
| 87 | +} catch (e) { |
| 88 | + print("Exception when calling {{classname}}->{{operationId}}: $e\n"); |
| 89 | +} |
| 90 | +{{/@first}}{{/operation}}{{/operations}}{{/@first}}{{/apis}}{{/apiInfo}} |
| 91 | +``` |
| 92 | + |
| 93 | +## Documentation for API Endpoints |
| 94 | + |
| 95 | +All URIs are relative to *{{basePath}}* |
| 96 | + |
| 97 | +Class | Method | HTTP request | Description |
| 98 | +------------ | ------------- | ------------- | ------------- |
| 99 | +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}/{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} |
| 100 | +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} |
| 101 | + |
| 102 | +## Documentation For Models |
| 103 | + |
| 104 | +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}/{{{classname}}}.md) |
| 105 | +{{/model}}{{/models}} |
| 106 | + |
| 107 | +## Documentation For Authorization |
| 108 | + |
| 109 | +{{^authMethods}} All endpoints do not require authorization. |
| 110 | +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} |
| 111 | +{{#authMethods}}## {{{name}}} |
| 112 | + |
| 113 | +{{#isApiKey}}- **Type**: API key |
| 114 | +- **API key parameter name**: {{{keyParamName}}} |
| 115 | +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} |
| 116 | +{{/isApiKey}} |
| 117 | +{{#isBasic}}- **Type**: HTTP basic authentication |
| 118 | +{{/isBasic}} |
| 119 | +{{#isOAuth}}- **Type**: OAuth |
| 120 | +- **Flow**: {{{flow}}} |
| 121 | +- **Authorization URL**: {{{authorizationUrl}}} |
| 122 | +- **Scopes**: {{^scopes}}N/A{{/scopes}} |
| 123 | +{{#scopes}} - **{{{scope}}}**: {{{description}}} |
| 124 | +{{/scopes}} |
| 125 | +{{/isOAuth}} |
| 126 | + |
| 127 | +{{/authMethods}} |
| 128 | + |
| 129 | +## Author |
| 130 | + |
| 131 | +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} |
| 132 | +{{/hasMore}}{{/apis}}{{/apiInfo}} |
0 commit comments