You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
633 B
33 lines
633 B
package vins
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"net/http"
|
|
)
|
|
|
|
type SearchRequest struct {
|
|
AccountID uint64 `url:"accountId,omitempty"`
|
|
RGID uint64 `url:"rgId,omitempty"`
|
|
Name string `url:"name,omitempty"`
|
|
ShowAll bool `url:"show_all,omitempty"`
|
|
}
|
|
|
|
func (v VINS) Search(ctx context.Context, req SearchRequest) (VINSList, error) {
|
|
url := "/cloudapi/vins/search"
|
|
|
|
VINSListRaw, err := v.client.DecortApiCall(ctx, http.MethodPost, url, req)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
VINSList := VINSList{}
|
|
err = json.Unmarshal(VINSListRaw, &VINSList)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return VINSList, nil
|
|
|
|
}
|