Skip to content

Commit

Permalink
feat: Add opendatasoft v2 API models
Browse files Browse the repository at this point in the history
Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Dec 26, 2023
1 parent 2a382c0 commit eede7fc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/emissions/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,19 @@ type nationalRealTimeResponse struct {
Records []nationalRealTimeRecord `json:"records"`
}

// Opendatasoft API v2
// Ref: https://reseaux-energies-rte.opendatasoft.com/api/explore/v2.1/console
// Ref: https://help.opendatasoft.com/apis/ods-explore-v2/
type nationalRealTimeFieldsV2 struct {
TauxCo2 int64 `json:"taux_co2"`
DateHeure string `json:"date_heure"`
}

type nationalRealTimeResponseV2 struct {
TotalCount int `json:"total_count"`
Results []nationalRealTimeFieldsV2 `json:"results"`
}

// code carbon global energy data mix interface
type energyMixDataFields struct {
BioFuel float64 `json:"biofuel_TWh"`
Expand Down

0 comments on commit eede7fc

Please sign in to comment.