kpler_request.go 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package models
  2. // KplerLocation represents a location with ID and name
  3. type KplerExcelLocation struct {
  4. ID string `json:"id"`
  5. Name string `json:"name"`
  6. }
  7. // KplerProduct represents a product with ID and name
  8. type KplerExcelProduct struct {
  9. ID string `json:"id"`
  10. Name string `json:"name"`
  11. }
  12. // KplerFlowsRequest represents the request structure for Kpler flows API
  13. type KplerFlowsRequest struct {
  14. Platform string `json:"platform"`
  15. Origins []KplerExcelLocation `json:"origins"`
  16. Destinations []KplerExcelLocation `json:"destinations"`
  17. FromInstallations []KplerExcelLocation `json:"fromInstallations"`
  18. ToInstallations []KplerExcelLocation `json:"toInstallations"`
  19. FlowDirection string `json:"flowDirection"`
  20. Products []KplerExcelProduct `json:"products"`
  21. Unit string `json:"unit"`
  22. IsProductEstimation bool `json:"isProductEstimation"`
  23. IsIntracountry bool `json:"isIntracountry"`
  24. IsIntraRegion bool `json:"isIntraRegion"`
  25. IsWithForecast bool `json:"isWithForecast"`
  26. Granularity string `json:"granularity"`
  27. VesselClassification string `json:"vesselClassification"`
  28. VesselsTypes []string `json:"vesselsTypes"`
  29. Split string `json:"split"`
  30. IsFreightView bool `json:"isFreightView"`
  31. IsWithPeriodEndTime bool `json:"isWithPeriodEndTime"`
  32. Projection string `json:"projection"`
  33. SelectedPreset string `json:"selectedPreset"`
  34. StartDate *string `json:"startDate"`
  35. EndDate *string `json:"endDate"`
  36. }
  37. // ZoneInfo represents a geographical zone in Kpler API
  38. type ZoneInfo struct {
  39. ID string `json:"id"`
  40. Name string `json:"name"`
  41. }
  42. // ProductInfo represents a product in Kpler API
  43. type ProductInfo struct {
  44. ID string `json:"id"`
  45. Name string `json:"name"`
  46. }
  47. // KplerDataPoint represents a single data point with end date and value
  48. type KplerDataPoint struct {
  49. EndDate string `json:"end_date"`
  50. Value string `json:"val"`
  51. }
  52. // KplerExcelIndexData represents a single index data from Excel
  53. type KplerExcelIndexData struct {
  54. Title string
  55. Name string
  56. DataPoints []KplerDataPoint
  57. Request string
  58. }
  59. // KplerFlowsExcelRequest is an alias for KplerFlowsRequest
  60. type KplerFlowsExcelRequest = KplerFlowsRequest
  61. // Process data rows
  62. type DataPoint struct {
  63. Value string
  64. Row int
  65. }