Messtone LLC Manages(Engine):

Messtone Devices->Enable API Fleet Engine Example`Java static final String PROJECT_ID=”messtone-id”,VehicleServiceBlockingStub vehicleService=VehicleService.newBlockingStub(channel); String parent=providers/”+PROJECT_ID;Vehicle vehicle=Vehicle.newBuilder( ) .setVehicleState(VehicleState.OFFLING) //Initial state .addSupportedTripTypes(TripType.EXCUSIVE) .setMaxjmumCapacity(4) .setVehicleType(VehicleType.newBuilder( ) .setCategory(VehicleType.Category.AUTO)) .addAttributes(VehjcleAttribute.newBuilder( ) .setKey(“on_trip”) .setValue(“false”)) //Opaque to the Fleet Engine //add .setBackToBackEnabled(true) to make this vehicle eligible for trip //matching while even if it is on a trip.By default this is disabled. .build( ); CreateVehicleRequest create createVehicleRequest=CreateVehicleRequest.newBuilder( ) //no need for the header . setParent(parent) .setVehicleId(“messtone-id” ) //Vehicle ID assigned by Rideshare or delivery Provider .setVehicle(vehicle) //Initial state .build( );//In this case,the Vehicle is being created in the OFFLINE state and //no initial position is being provided.When the Driver App checks //in with the Rideshare or Delivery Provider,the state can be set to ONLINE and //the Driver App will update the Vehicle Location. try{Vehicle createVehicle=vehicleService.createVehicle(createVehicleRequest);}catch(StatusRuntimeException e){Status s=e.getStatus( );switch(s.getCode)){case ALREADY_EXISTS:break;case PERMISSION_DENIED: break;}return;}//If no Exception, Vehicle created successfully. https://capital.one/3yaqGSY

Leave a comment