-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put the credential data definitions in a central place for now (#68)
* Put the credential data definitions in a central place for now * Some notes about region and version * Casing
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |