-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
69 lines (61 loc) · 1.9 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
"""
Module main
"""
from estimates import (
ElectricityEstimateRequest,
Estimates,
FlightEstimateRequest,
FlightLeg,
FuelCombustionEstimateRequest,
ShippingEstimateRequest,
VehicleEstimateRequest,
)
from model import (
CabinClass,
Country,
DistanceUnit,
ElectricityUnit,
FuelSourceType,
FuelSourceUnit,
TransportMethod,
WeightUnit,
)
if __name__ == "__main__":
electric_request = ElectricityEstimateRequest(
country=Country.US, electricity_value=42, electricity_unit=ElectricityUnit.MWH
)
# print(electric_request.__json__())
print(Estimates.create_estimate_request(electric_request))
flight_request = FlightEstimateRequest(
passengers=2,
legs=[
FlightLeg("sfo", "yyz", CabinClass.ECONOMY),
FlightLeg("yyz", "sfo", CabinClass.ECONOMY),
],
distance_unit=DistanceUnit.KM,
)
# print(flight_request.__json__())
print(Estimates.create_estimate_request(flight_request))
shipping_request = ShippingEstimateRequest(
weight_unit=WeightUnit.GRAMS,
weight_value=200.0,
distance_unit=DistanceUnit.KM,
distance_value=2000,
transport_method=TransportMethod.TRUCK,
)
# print(shipping_request.__json__())
print(Estimates.create_estimate_request(shipping_request))
vehicle_request = VehicleEstimateRequest(
distance_unit=DistanceUnit.MI,
distance_value=100,
vehicle_model_id="7268a9b7-17e8-4c8d-acca-57059252afe9",
)
# print(vehicle_request.__json__())
print(Estimates.create_estimate_request(vehicle_request))
fuel_request = FuelCombustionEstimateRequest(
fuel_source_type=FuelSourceType.HOME_HEATING_DIESEL_FUEL,
fuel_source_unit=FuelSourceUnit.BTU,
fuel_source_value=2,
)
# print(fuel_request.__json__())
print(Estimates.create_estimate_request(fuel_request))