Skip to content

Commit eb57c0d

Browse files
committed
feat: add flowmotion_api client to flutter project
Squashed commit of the following: commit 36e562129cfed8ca1404f8ba36cfb10c7c09f22b Author: Zhu Zhanyan <program.nom@gmail.com> Date: Fri Oct 25 08:13:25 2024 +0800 feawt: add flowmotion_api client to flutter project commit cf04287228a33dd24f710c02caf8cd4edb9b969a Author: Zhu Zhanyan <program.nom@gmail.com> Date: Fri Oct 25 08:11:00 2024 +0800 build: add class stub used to codegen flowmotion_api client commit a70213a41b635cb8fd2eaa7122f5dfa03084550a Author: Zhu Zhanyan <program.nom@gmail.com> Date: Fri Oct 25 07:24:26 2024 +0800 build: add openapi_generator & openapi_generator_annotations to pubspec.yaml
1 parent 566103e commit eb57c0d

File tree

76 files changed

+6199
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+6199
-22
lines changed

lib/api_codegen.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Openapi Generator last run: : 2024-10-25T08:05:17.988600
2+
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
3+
4+
@Openapi(
5+
useNextGen: true,
6+
additionalProperties: DioProperties(
7+
pubName: 'flowmotion_api',
8+
),
9+
inputSpecFile: "",
10+
inputSpec: InputSpec(
11+
path:
12+
'schema/flowmotion_api.yaml'),
13+
generatorName: Generator.dio,
14+
runSourceGenOnOutput: true,
15+
outputDirectory: 'packages/flowmotion_api',
16+
)
17+
class FlowmotionAPI {}

packages/flowmotion_api/.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://dart.dev/guides/libraries/private-files
2+
3+
# Files and directories created by pub
4+
.dart_tool/
5+
.buildlog
6+
.packages
7+
.project
8+
.pub/
9+
build/
10+
**/packages/
11+
12+
# Files created by dart2js
13+
# (Most Dart developers will use pub build to compile Dart, use/modify these
14+
# rules if you intend to use dart2js directly
15+
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
16+
# differentiate from explicit Javascript files)
17+
*.dart.js
18+
*.part.js
19+
*.js.deps
20+
*.js.map
21+
*.info.json
22+
23+
# Directory created by dartdoc
24+
doc/api/
25+
26+
# Don't commit pubspec lock file
27+
# (Library packages only! Remove pattern if developing an application package)
28+
pubspec.lock
29+
30+
# Don’t commit files and directories created by other development environments.
31+
# For example, if your development environment creates any of the following files,
32+
# consider putting them in a global ignore file:
33+
34+
# IntelliJ
35+
*.iml
36+
*.ipr
37+
*.iws
38+
.idea/
39+
40+
# Mac
41+
.DS_Store
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.gitignore
2+
.openapi-generator-ignore
3+
README.md
4+
analysis_options.yaml
5+
doc/Address.md
6+
doc/Camera.md
7+
doc/CameraLocation.md
8+
doc/Congestion.md
9+
doc/CongestionApi.md
10+
doc/Location.md
11+
doc/Rating.md
12+
doc/RoutePost200Response.md
13+
doc/RoutePost200ResponseRoutesInner.md
14+
doc/RoutePost200ResponseRoutesInnerStepsInner.md
15+
doc/RoutePostRequest.md
16+
doc/RoutePostRequestDest.md
17+
doc/RoutePostRequestSrc.md
18+
doc/RoutingApi.md
19+
lib/flowmotion_api.dart
20+
lib/src/api.dart
21+
lib/src/api/congestion_api.dart
22+
lib/src/api/routing_api.dart
23+
lib/src/api_util.dart
24+
lib/src/auth/api_key_auth.dart
25+
lib/src/auth/auth.dart
26+
lib/src/auth/basic_auth.dart
27+
lib/src/auth/bearer_auth.dart
28+
lib/src/auth/oauth.dart
29+
lib/src/date_serializer.dart
30+
lib/src/model/address.dart
31+
lib/src/model/camera.dart
32+
lib/src/model/camera_location.dart
33+
lib/src/model/congestion.dart
34+
lib/src/model/date.dart
35+
lib/src/model/location.dart
36+
lib/src/model/rating.dart
37+
lib/src/model/route_post200_response.dart
38+
lib/src/model/route_post200_response_routes_inner.dart
39+
lib/src/model/route_post200_response_routes_inner_steps_inner.dart
40+
lib/src/model/route_post_request.dart
41+
lib/src/model/route_post_request_dest.dart
42+
lib/src/model/route_post_request_src.dart
43+
lib/src/serializers.dart
44+
pubspec.yaml
45+
test/address_test.dart
46+
test/camera_location_test.dart
47+
test/camera_test.dart
48+
test/congestion_api_test.dart
49+
test/congestion_test.dart
50+
test/location_test.dart
51+
test/rating_test.dart
52+
test/route_post200_response_routes_inner_steps_inner_test.dart
53+
test/route_post200_response_routes_inner_test.dart
54+
test/route_post200_response_test.dart
55+
test/route_post_request_dest_test.dart
56+
test/route_post_request_src_test.dart
57+
test/route_post_request_test.dart
58+
test/routing_api_test.dart
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
unset

packages/flowmotion_api/README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# flowmotion_api
2+
API exposed by the Flowmotion Backend Service.
3+
4+
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5+
6+
- API version: 0.1.0
7+
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen
8+
9+
## Requirements
10+
11+
* Dart 2.15.0+ or Flutter 2.8.0+
12+
* Dio 5.0.0+ (https://pub.dev/packages/dio)
13+
14+
## Installation & Usage
15+
16+
### pub.dev
17+
To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
18+
```yaml
19+
dependencies:
20+
flowmotion_api: 1.0.0
21+
```
22+
23+
### Github
24+
If this Dart package is published to Github, please include the following in pubspec.yaml
25+
```yaml
26+
dependencies:
27+
flowmotion_api:
28+
git:
29+
url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
30+
#ref: main
31+
```
32+
33+
### Local development
34+
To use the package from your local drive, please include the following in pubspec.yaml
35+
```yaml
36+
dependencies:
37+
flowmotion_api:
38+
path: /path/to/flowmotion_api
39+
```
40+
41+
## Getting Started
42+
43+
Please follow the [installation procedure](#installation--usage) and then run the following:
44+
45+
```dart
46+
import 'package:flowmotion_api/flowmotion_api.dart';
47+
48+
49+
final api = FlowmotionApi().getCongestionApi();
50+
final String cameraId = cameraId_example; // String | ID of the camera to retrieve congestion duration for
51+
final String groupby = groupby_example; // String | Group congestion duration by hour or day
52+
final double threshold = 3.4; // double | Congestion rating level (between 0 and 1) that is considered \"congested\"
53+
54+
try {
55+
final response = await api.congestedCameraIdGroupbyGet(cameraId, groupby, threshold);
56+
print(response);
57+
} catch on DioException (e) {
58+
print("Exception when calling CongestionApi->congestedCameraIdGroupbyGet: $e\n");
59+
}
60+
61+
```
62+
63+
## Documentation for API Endpoints
64+
65+
All URIs are relative to *http://localhost*
66+
67+
Class | Method | HTTP request | Description
68+
------------ | ------------- | ------------- | -------------
69+
[*CongestionApi*](doc/CongestionApi.md) | [**congestedCameraIdGroupbyGet**](doc/CongestionApi.md#congestedcameraidgroupbyget) | **GET** /congested/{camera_id}/{groupby} | Retrieve congestion duration for a specific camera
70+
[*CongestionApi*](doc/CongestionApi.md) | [**congestionsGet**](doc/CongestionApi.md#congestionsget) | **GET** /congestions | Retrieve congestion data
71+
[*RoutingApi*](doc/RoutingApi.md) | [**routePost**](doc/RoutingApi.md#routepost) | **POST** /route | Retrieve recommended routes between source and destination
72+
73+
74+
## Documentation For Models
75+
76+
- [Address](doc/Address.md)
77+
- [Camera](doc/Camera.md)
78+
- [CameraLocation](doc/CameraLocation.md)
79+
- [Congestion](doc/Congestion.md)
80+
- [Location](doc/Location.md)
81+
- [Rating](doc/Rating.md)
82+
- [RoutePost200Response](doc/RoutePost200Response.md)
83+
- [RoutePost200ResponseRoutesInner](doc/RoutePost200ResponseRoutesInner.md)
84+
- [RoutePost200ResponseRoutesInnerStepsInner](doc/RoutePost200ResponseRoutesInnerStepsInner.md)
85+
- [RoutePostRequest](doc/RoutePostRequest.md)
86+
- [RoutePostRequestDest](doc/RoutePostRequestDest.md)
87+
- [RoutePostRequestSrc](doc/RoutePostRequestSrc.md)
88+
89+
90+
## Documentation For Authorization
91+
92+
Endpoints do not require authorization.
93+
94+
95+
## Author
96+
97+
98+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
analyzer:
2+
language:
3+
strict-inference: true
4+
strict-raw-types: true
5+
strict-casts: false
6+
exclude:
7+
- test/*.dart
8+
errors:
9+
deprecated_member_use_from_same_package: ignore
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# flowmotion_api.model.Address
2+
3+
## Load the model package
4+
```dart
5+
import 'package:flowmotion_api/api.dart';
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**text** | **String** | Full address text |
12+
**postcode** | **String** | Postal code of the source address |
13+
14+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# flowmotion_api.model.Camera
2+
3+
## Load the model package
4+
```dart
5+
import 'package:flowmotion_api/api.dart';
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**id** | **String** | |
12+
**capturedOn** | [**DateTime**](DateTime.md) | |
13+
**retrievedOn** | [**DateTime**](DateTime.md) | |
14+
**location** | [**CameraLocation**](CameraLocation.md) | |
15+
16+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
17+
18+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# flowmotion_api.model.CameraLocation
2+
3+
## Load the model package
4+
```dart
5+
import 'package:flowmotion_api/api.dart';
6+
```
7+
8+
## Properties
9+
Name | Type | Description | Notes
10+
------------ | ------------- | ------------- | -------------
11+
**longitude** | **num** | |
12+
**latitude** | **num** | |
13+
14+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+

0 commit comments

Comments
 (0)