Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOAuth2Config ¶ added in v0.4.0
func NewOAuth2Config(clientID, clientSecret, refreshToken string) *clientcredentials.Config
NewOAuth2Config creates a new OAuth2 config for the Abax API.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client to the Abax management APIs.
func NewClient ¶
func NewClient(ctx context.Context, opts ...ClientOption) (*Client, error)
NewClient creates a new Abax API client.
func (*Client) ListVehicles ¶ added in v0.4.0
func (c *Client) ListVehicles(ctx context.Context, request *ListVehiclesRequest) (*ListVehiclesResponse, error)
ListVehicles lists all vehicles in the current organization.
Required scopes: - abax_profile - open_api - open_api.vehicles
type ClientConfig ¶
type ClientConfig struct {
// contains filtered or unexported fields
}
ClientConfig configures a Client.
type ClientOption ¶
type ClientOption func(*ClientConfig)
ClientOption is a configuration option for a Client.
func WithAccessToken ¶ added in v0.4.0
func WithAccessToken(accessToken string) ClientOption
WithAccessToken sets the access token for the client.
func WithClientID ¶ added in v0.4.0
func WithClientID(clientID string) ClientOption
WithClientID sets the client ID for the client.
func WithClientSecret ¶ added in v0.4.0
func WithClientSecret(clientSecret string) ClientOption
WithClientSecret sets the client secret for the client.
func WithRefreshToken ¶
func WithRefreshToken(refreshToken string) ClientOption
WithRefreshToken sets the refresh token for the client.
type Error ¶ added in v0.4.0
type Error struct {
// Status is the HTTP status code of the response.
Status string `json:"code"`
}
Error is an error returned by the Abax API.
type ListVehiclesRequest ¶ added in v0.4.0
type ListVehiclesRequest struct {
Page int32 `json:"page,omitempty"`
PageSize int32 `json:"pageSize,omitempty"`
}
ListVehiclesRequest is the request for the Client.ListVehicles method.
type ListVehiclesResponse ¶ added in v0.4.0
type ListVehiclesResponse struct {
Page int32 `json:"page"`
PageSize int32 `json:"pageSize"`
Vehicles []*abaxv1.Vehicle `json:"items"`
}
ListVehiclesResponse is the response for the Client.ListVehicles method.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
oapi/abaxoapi
Package abaxoapi provides primitives to interact with the openapi HTTP API.
|
Package abaxoapi provides primitives to interact with the openapi HTTP API. |