Skip to content

Commit

Permalink
Put the credential data definitions in a central place for now (#68)
Browse files Browse the repository at this point in the history
* Put the credential data definitions in a central place for now

* Some notes about region and version

* Casing
  • Loading branch information
elffjs committed May 29, 2024
1 parent 126b9ff commit 05212fc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions sdtask/sdtask.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package sdtask

import (
"time"

"github.com/ethereum/go-ethereum/common"
)

type CredentialData struct {
TaskID string `json:"taskId"`
UserDeviceID string `json:"userDeviceId"`
IntegrationID string `json:"integrationId"`
AccessToken string `json:"accessToken"`
Expiry time.Time `json:"expiry"`
RefreshToken string `json:"refreshToken"`
// Version is an API version. Currently only used for Tesla: 1 is the old
// "Owner API" and 2 is the new "Fleet API".
Version int `json:"version,omitempty"`
// Region is a lowercase two-letter code for the region. Currently only used for
// Tesla, and can only be "na" or "eu".
Region string `json:"region,omitempty"`
SyntheticDevice *SyntheticDevice `json:"syntheticDevice,omitempty"`
}

type SyntheticDevice struct {
TokenID int `json:"tokenId"`
Address common.Address `json:"address"`
IntegrationTokenID int `json:"integrationTokenId"`
WalletChildNumber int `json:"walletChildNumber"`
VehicleTokenID int `json:"vehicleTokenId"`
}

0 comments on commit 05212fc

Please sign in to comment.