addAntiPersistentRoadblockByArea static method
- required GeographicArea area,
- required DateTime startTime,
- required DateTime expireTime,
- required RouteTransportMode transportMode,
- required String id,
Add an user persistent anti-area roadblock to collection
Parameters
- IN area The geographic area not affected by the roadblock, i.e. the anti-area ( world wide - area ) is the roadblock
- IN startTime The roadblock start time
- IN expireTime The roadblock expire time
- IN transportMode The transport mode for which the roadblock applies
- IN id The user roadblock id. Can be used to get / delete a defined roadblock
Returns
- The TrafficEvent object and GemError.success if successful
- Null together with the error code if failed:
- GemError.activation means roadblocks are disabled from preferences
- GemError.invalidInput means the given parameters are invalid
- GemError.exist means the roadblock already exist
- GemError.inUse means the roadblock id is already in use
Throws
- An exception if it fails
Implementation
static Pair<TrafficEvent?, GemError> addAntiPersistentRoadblockByArea(
{required GeographicArea area,
required DateTime startTime,
required DateTime expireTime,
required RouteTransportMode transportMode,
required String id}) {
final OperationResult resultString = staticMethod(
'TrafficService',
'addPersistentAntiRoadblockArea',
args: <String, dynamic>{
'area': area,
'startUTC': startTime.millisecondsSinceEpoch,
'expireUTC': expireTime.millisecondsSinceEpoch,
'transportMode': transportMode.id,
'id': id,
},
);
final GemError error =
GemErrorExtension.fromCode(resultString['result']['second']);
if (error != GemError.success) {
return Pair<TrafficEvent?, GemError>(null, error);
}
return Pair<TrafficEvent, GemError>(
TrafficEvent.init(resultString['result']['first']),
error,
);
}