Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiXin18 committed Nov 5, 2024
2 parents 04449d8 + 25fc2dd commit d9f8b08
Show file tree
Hide file tree
Showing 110 changed files with 8,966 additions and 308 deletions.
69 changes: 0 additions & 69 deletions backend/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,75 +74,6 @@ export interface paths {
patch?: never;
trace?: never;
};
"/congested/{camera_id}/{groupby}": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/**
* Retrieve congestion duration for a specific camera for a given time range.
* @description Returns the total time in seconds (as a float) when the camera was "congested" according to a threshold, grouped by hour or day.
*/
get: {
parameters: {
query: {
/** @description Congestion rating level (between 0 and 1) that is considered "congested" */
threshold?: number;
/** @description Inclusive start of the time range (timestamp) to retrieve congestion duration. */
begin: string;
/** @description Exclusive end of the time range (timestamp) to retrieve congestion duration. */
end: string;
};
header?: never;
path: {
/** @description ID of the camera to retrieve congestion duration for */
camera_id: string;
/** @description Group congestion duration by hour or day */
groupby: "hour" | "day";
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Total congested time in seconds, grouped by the specified interval */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": number[];
};
};
/** @description Invalid request parameters */
400: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
/** @description Internal server error */
500: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["Error"];
};
};
};
};
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/route": {
parameters: {
query?: never;
Expand Down
1 change: 0 additions & 1 deletion flowmotion_api

This file was deleted.

41 changes: 41 additions & 0 deletions flowmotion_api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# See https://dart.dev/guides/libraries/private-files

# Files and directories created by pub
.dart_tool/
.buildlog
.packages
.project
.pub/
build/
**/packages/

# Files created by dart2js
# (Most Dart developers will use pub build to compile Dart, use/modify these
# rules if you intend to use dart2js directly
# Convention is to use extension '.dart.js' for Dart compiled to Javascript to
# differentiate from explicit Javascript files)
*.dart.js
*.part.js
*.js.deps
*.js.map
*.info.json

# Directory created by dartdoc
doc/api/

# Don't commit pubspec lock file
# (Library packages only! Remove pattern if developing an application package)
pubspec.lock

# Don’t commit files and directories created by other development environments.
# For example, if your development environment creates any of the following files,
# consider putting them in a global ignore file:

# IntelliJ
*.iml
*.ipr
*.iws
.idea/

# Mac
.DS_Store
23 changes: 23 additions & 0 deletions flowmotion_api/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
41 changes: 41 additions & 0 deletions flowmotion_api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.gitignore
README.md
analysis_options.yaml
doc/Address.md
doc/Camera.md
doc/Congestion.md
doc/CongestionApi.md
doc/Location.md
doc/Rating.md
doc/RoutePost200Response.md
doc/RoutePost200ResponseRoutesInner.md
doc/RoutePost200ResponseRoutesInnerStepsInner.md
doc/RoutePostRequest.md
doc/RoutePostRequestDest.md
doc/RoutePostRequestSrc.md
doc/RoutingApi.md
lib/flowmotion_api.dart
lib/src/api.dart
lib/src/api/congestion_api.dart
lib/src/api/routing_api.dart
lib/src/api_util.dart
lib/src/auth/api_key_auth.dart
lib/src/auth/auth.dart
lib/src/auth/basic_auth.dart
lib/src/auth/bearer_auth.dart
lib/src/auth/oauth.dart
lib/src/date_serializer.dart
lib/src/model/address.dart
lib/src/model/camera.dart
lib/src/model/congestion.dart
lib/src/model/date.dart
lib/src/model/location.dart
lib/src/model/rating.dart
lib/src/model/route_post200_response.dart
lib/src/model/route_post200_response_routes_inner.dart
lib/src/model/route_post200_response_routes_inner_steps_inner.dart
lib/src/model/route_post_request.dart
lib/src/model/route_post_request_dest.dart
lib/src/model/route_post_request_src.dart
lib/src/serializers.dart
pubspec.yaml
1 change: 1 addition & 0 deletions flowmotion_api/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unset
99 changes: 99 additions & 0 deletions flowmotion_api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# flowmotion_api (EXPERIMENTAL)
API exposed by the Flowmotion Backend Service.

This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 0.1.0
- Build package: org.openapitools.codegen.languages.DartDioClientCodegen

## Requirements

* Dart 2.15.0+ or Flutter 2.8.0+
* Dio 5.0.0+ (https://pub.dev/packages/dio)

## Installation & Usage

### pub.dev
To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml
```yaml
dependencies:
flowmotion_api: 1.0.0
```
### Github
If this Dart package is published to Github, please include the following in pubspec.yaml
```yaml
dependencies:
flowmotion_api:
git:
url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git
#ref: main
```

### Local development
To use the package from your local drive, please include the following in pubspec.yaml
```yaml
dependencies:
flowmotion_api:
path: /path/to/flowmotion_api
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```dart
import 'package:flowmotion_api/flowmotion_api.dart';


final api = FlowmotionApi().getCongestionApi();
final String cameraId = cameraId_example; // String | ID of the camera to retrieve congestion duration for
final String groupby = groupby_example; // String | Group congestion duration by hour or day
final DateTime begin = 2013-10-20T19:20:30+01:00; // DateTime | Inclusive start of the time range (timestamp) to retrieve congestion duration.
final DateTime end = 2013-10-20T19:20:30+01:00; // DateTime | Exclusive end of the time range (timestamp) to retrieve congestion duration.
final double threshold = 3.4; // double | Congestion rating level (between 0 and 1) that is considered \"congested\"

try {
final response = await api.congestedCameraIdGroupbyGet(cameraId, groupby, begin, end, threshold);
print(response);
} catch on DioException (e) {
print("Exception when calling CongestionApi->congestedCameraIdGroupbyGet: $e\n");
}

```

## Documentation for API Endpoints

All URIs are relative to *https://flowmotion-backend-210524342027.asia-southeast1.run.app*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
[*CongestionApi*](doc/CongestionApi.md) | [**congestedCameraIdGroupbyGet**](doc/CongestionApi.md#congestedcameraidgroupbyget) | **GET** /congested/{camera_id}/{groupby} | Retrieve congestion duration for a specific camera for a given time range.
[*CongestionApi*](doc/CongestionApi.md) | [**congestionsGet**](doc/CongestionApi.md#congestionsget) | **GET** /congestions | Retrieve congestion data
[*RoutingApi*](doc/RoutingApi.md) | [**routePost**](doc/RoutingApi.md#routepost) | **POST** /route | Retrieve recommended routes between source and destination


## Documentation For Models

- [Address](doc/Address.md)
- [Camera](doc/Camera.md)
- [Congestion](doc/Congestion.md)
- [Location](doc/Location.md)
- [Rating](doc/Rating.md)
- [RoutePost200Response](doc/RoutePost200Response.md)
- [RoutePost200ResponseRoutesInner](doc/RoutePost200ResponseRoutesInner.md)
- [RoutePost200ResponseRoutesInnerStepsInner](doc/RoutePost200ResponseRoutesInnerStepsInner.md)
- [RoutePostRequest](doc/RoutePostRequest.md)
- [RoutePostRequestDest](doc/RoutePostRequestDest.md)
- [RoutePostRequestSrc](doc/RoutePostRequestSrc.md)


## Documentation For Authorization

Endpoints do not require authorization.


## Author



9 changes: 9 additions & 0 deletions flowmotion_api/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
analyzer:
language:
strict-inference: true
strict-raw-types: true
strict-casts: false
exclude:
- test/*.dart
errors:
deprecated_member_use_from_same_package: ignore
16 changes: 16 additions & 0 deletions flowmotion_api/doc/Address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# flowmotion_api.model.Address

## Load the model package
```dart
import 'package:flowmotion_api/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**text** | **String** | Full address text |
**postcode** | **String** | Postal code of the source address |

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


19 changes: 19 additions & 0 deletions flowmotion_api/doc/Camera.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# flowmotion_api.model.Camera

## Load the model package
```dart
import 'package:flowmotion_api/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | |
**capturedOn** | [**DateTime**](DateTime.md) | |
**imageUrl** | **String** | |
**retrievedOn** | [**DateTime**](DateTime.md) | |
**location** | [**Location**](Location.md) | |

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


16 changes: 16 additions & 0 deletions flowmotion_api/doc/CameraLocation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# flowmotion_api.model.CameraLocation

## Load the model package
```dart
import 'package:flowmotion_api/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**longitude** | **num** | |
**latitude** | **num** | |

[[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 changes: 17 additions & 0 deletions flowmotion_api/doc/Congestion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# flowmotion_api.model.Congestion

## Load the model package
```dart
import 'package:flowmotion_api/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**camera** | [**Camera**](Camera.md) | |
**rating** | [**Rating**](Rating.md) | |
**updatedOn** | [**DateTime**](DateTime.md) | |

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


Loading

0 comments on commit d9f8b08

Please sign in to comment.