| POST | /production-data-sync |
|---|
import 'package:servicestack/servicestack.dart';
enum ProductionSourceType
{
undefined,
Solar,
Wind,
Hybrid,
}
class ProductioDataSyncRequest implements IConvertible
{
int? coordId;
ProductionSourceType? sourceType;
int? month;
ProductioDataSyncRequest({this.coordId,this.sourceType,this.month});
ProductioDataSyncRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
coordId = json['coordId'];
sourceType = JsonConverters.fromJson(json['sourceType'],'ProductionSourceType',context!);
month = json['month'];
return this;
}
Map<String, dynamic> toJson() => {
'coordId': coordId,
'sourceType': JsonConverters.toJson(sourceType,'ProductionSourceType',context!),
'month': month
};
getTypeName() => "ProductioDataSyncRequest";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'catalog_jobs_dev.power.dev', types: <String, TypeInfo> {
'ProductionSourceType': TypeInfo(TypeOf.Enum, enumValues:ProductionSourceType.values),
'ProductioDataSyncRequest': TypeInfo(TypeOf.Class, create:() => ProductioDataSyncRequest()),
});
Dart ProductioDataSyncRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /production-data-sync HTTP/1.1
Host: catalog-jobs-dev.power.dev
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"coordId":0,"sourceType":"undefined","month":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length
{}