mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-22 04:46:03 +03:00
Remove errs package, change logic for error processing (#48)
This commit is contained in:
parent
03fc70d679
commit
baddbe95b2
@ -1,75 +0,0 @@
|
|||||||
package errs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
|
||||||
"strconv"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Error returns the string representation of the error and satisfies the error interface.
|
|
||||||
func (f *Failure) Error() string {
|
|
||||||
if f != nil && f.runtimeErr != nil {
|
|
||||||
return f.runtimeErr.Error()
|
|
||||||
}
|
|
||||||
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// ApiError returns formatted string representation of the API error
|
|
||||||
func (f *Failure) ApiError() string {
|
|
||||||
if f != nil && f.apiErr != "" {
|
|
||||||
return fmt.Sprintf("%+v", f.apiErr)
|
|
||||||
}
|
|
||||||
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// ApiErrors returns array of formatted strings that represents API errors
|
|
||||||
func (f *Failure) ApiErrors() map[string]string {
|
|
||||||
if len(f.apiErrs) > 0 {
|
|
||||||
return f.apiErrs
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetRuntimeError set runtime error value
|
|
||||||
func (f *Failure) SetRuntimeError(e error) {
|
|
||||||
f.runtimeErr = e
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetApiError set api error value
|
|
||||||
func (f *Failure) SetApiError(e string) {
|
|
||||||
f.apiErr = e
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetApiErrors set api errors value
|
|
||||||
func (f *Failure) SetApiErrors(e map[string]string) {
|
|
||||||
f.apiErrs = e
|
|
||||||
}
|
|
||||||
|
|
||||||
// ErrorsHandler returns map
|
|
||||||
func ErrorsHandler(errs interface{}) map[string]string {
|
|
||||||
m := make(map[string]string)
|
|
||||||
|
|
||||||
switch errs.(type) {
|
|
||||||
case map[string]interface{}:
|
|
||||||
for idx, val := range errs.(map[string]interface{}) {
|
|
||||||
m[idx] = val.(string)
|
|
||||||
}
|
|
||||||
case []interface{}:
|
|
||||||
for idx, val := range errs.([]interface{}) {
|
|
||||||
m[strconv.Itoa(idx)] = val.(string)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
|
|
||||||
// ErrorResponse method
|
|
||||||
func ErrorResponse(data []byte) (FailureResponse, error) {
|
|
||||||
var resp FailureResponse
|
|
||||||
err := json.Unmarshal(data, &resp)
|
|
||||||
|
|
||||||
return resp, err
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
package errs
|
|
||||||
|
|
||||||
import (
|
|
||||||
"reflect"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestFailure_ApiErrorsSlice(t *testing.T) {
|
|
||||||
var err = Failure{}
|
|
||||||
b := []byte(`{"success": false, "errorMsg": "Failed to activate module", "errors": ["Your account has insufficient funds to activate integration module"]}`)
|
|
||||||
expected := map[string]string{
|
|
||||||
"0": "Your account has insufficient funds to activate integration module",
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, e := ErrorResponse(b)
|
|
||||||
err.SetRuntimeError(e)
|
|
||||||
err.SetApiError(resp.ErrorMsg)
|
|
||||||
|
|
||||||
if resp.Errors != nil {
|
|
||||||
err.SetApiErrors(ErrorsHandler(resp.Errors))
|
|
||||||
}
|
|
||||||
|
|
||||||
eq := reflect.DeepEqual(expected, err.ApiErrors())
|
|
||||||
|
|
||||||
if eq != true {
|
|
||||||
t.Errorf("%+v", eq)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestFailure_ApiErrorsMap(t *testing.T) {
|
|
||||||
var err = Failure{}
|
|
||||||
b := []byte(`{"success": false, "errorMsg": "Failed to activate module", "errors": {"id": "ID must be an integer"}}`)
|
|
||||||
expected := map[string]string{
|
|
||||||
"id": "ID must be an integer",
|
|
||||||
}
|
|
||||||
|
|
||||||
resp, e := ErrorResponse(b)
|
|
||||||
err.SetRuntimeError(e)
|
|
||||||
err.SetApiError(resp.ErrorMsg)
|
|
||||||
|
|
||||||
if resp.Errors != nil {
|
|
||||||
err.SetApiErrors(ErrorsHandler(resp.Errors))
|
|
||||||
}
|
|
||||||
|
|
||||||
eq := reflect.DeepEqual(expected, err.ApiErrors())
|
|
||||||
|
|
||||||
if eq != true {
|
|
||||||
t.Errorf("%+v", eq)
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
package errs
|
|
||||||
|
|
||||||
// Error implements generic error interface
|
|
||||||
type Error interface {
|
|
||||||
error
|
|
||||||
ApiError() string
|
|
||||||
ApiErrors() map[string]string
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
package errs
|
|
||||||
|
|
||||||
// Failure struct implode runtime & api errors
|
|
||||||
type Failure struct {
|
|
||||||
runtimeErr error
|
|
||||||
apiErr string
|
|
||||||
apiErrs map[string]string
|
|
||||||
}
|
|
||||||
|
|
||||||
// FailureResponse convert json error response into object
|
|
||||||
type FailureResponse struct {
|
|
||||||
ErrorMsg string `json:"errorMsg,omitempty"`
|
|
||||||
Errors interface{} `json:"errors,omitempty"`
|
|
||||||
}
|
|
1
go.mod
1
go.mod
@ -5,5 +5,6 @@ go 1.13
|
|||||||
require (
|
require (
|
||||||
github.com/google/go-querystring v1.1.0
|
github.com/google/go-querystring v1.1.0
|
||||||
github.com/joho/godotenv v1.3.0
|
github.com/joho/godotenv v1.3.0
|
||||||
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543
|
||||||
gopkg.in/h2non/gock.v1 v1.0.16
|
gopkg.in/h2non/gock.v1 v1.0.16
|
||||||
)
|
)
|
||||||
|
1306
v5/client.go
1306
v5/client.go
File diff suppressed because it is too large
Load Diff
1607
v5/client_test.go
1607
v5/client_test.go
File diff suppressed because it is too large
Load Diff
32
v5/error.go
Normal file
32
v5/error.go
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package v5
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
// APIErrorsList struct.
|
||||||
|
type APIErrorsList map[string]string
|
||||||
|
|
||||||
|
// APIError struct.
|
||||||
|
type APIError struct {
|
||||||
|
SuccessfulResponse
|
||||||
|
ErrorMsg string `json:"errorMsg,omitempty"`
|
||||||
|
Errors APIErrorsList `json:"errors,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *APIError) Error() string {
|
||||||
|
return e.ErrorMsg
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewAPIError(dataResponse []byte) error {
|
||||||
|
a := &APIError{}
|
||||||
|
|
||||||
|
if len(dataResponse) > 0 && dataResponse[0] == '<' {
|
||||||
|
a.ErrorMsg = "Account does not exist."
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := json.Unmarshal(dataResponse, a); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return a
|
||||||
|
}
|
54
v5/error_test.go
Normal file
54
v5/error_test.go
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
package v5
|
||||||
|
|
||||||
|
import (
|
||||||
|
"reflect"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"golang.org/x/xerrors"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFailure_ApiErrorsSlice(t *testing.T) {
|
||||||
|
b := []byte(`{"success": false,
|
||||||
|
"errorMsg": "Failed to activate module",
|
||||||
|
"errors": [
|
||||||
|
"Your account has insufficient funds to activate integration module",
|
||||||
|
"Test error"
|
||||||
|
]}`)
|
||||||
|
expected := APIErrorsList{
|
||||||
|
"0": "Your account has insufficient funds to activate integration module",
|
||||||
|
"1": "Test error",
|
||||||
|
}
|
||||||
|
|
||||||
|
var expEr *APIError
|
||||||
|
e := NewAPIError(b)
|
||||||
|
|
||||||
|
if xerrors.As(e, &expEr) {
|
||||||
|
if eq := reflect.DeepEqual(expEr.Errors, expected); eq != true {
|
||||||
|
t.Errorf("%+v", eq)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
t.Errorf("Error must be type of APIError: %v", e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestFailure_ApiErrorsMap(t *testing.T) {
|
||||||
|
b := []byte(`{"success": false,
|
||||||
|
"errorMsg": "Failed to activate module",
|
||||||
|
"errors": {"id": "ID must be an integer", "test": "Test error"}}`,
|
||||||
|
)
|
||||||
|
expected := APIErrorsList{
|
||||||
|
"id": "ID must be an integer",
|
||||||
|
"test": "Test error",
|
||||||
|
}
|
||||||
|
|
||||||
|
var expEr *APIError
|
||||||
|
e := NewAPIError(b)
|
||||||
|
|
||||||
|
if xerrors.As(e, &expEr) {
|
||||||
|
if eq := reflect.DeepEqual(expEr.Errors, expected); eq != true {
|
||||||
|
t.Errorf("%+v", eq)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
t.Errorf("Error must be type of APIError: %v", e)
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package v5
|
package v5
|
||||||
|
|
||||||
// CustomersFilter type
|
// CustomersFilter type.
|
||||||
type CustomersFilter struct {
|
type CustomersFilter struct {
|
||||||
Ids []string `url:"ids,omitempty,brackets"`
|
Ids []string `url:"ids,omitempty,brackets"`
|
||||||
ExternalIds []string `url:"externalIds,omitempty,brackets"`
|
ExternalIds []string `url:"externalIds,omitempty,brackets"`
|
||||||
@ -57,7 +57,7 @@ type CustomersFilter struct {
|
|||||||
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersFilter type
|
// CorporateCustomersFilter type.
|
||||||
type CorporateCustomersFilter struct {
|
type CorporateCustomersFilter struct {
|
||||||
ContragentName string `url:"contragentName,omitempty"`
|
ContragentName string `url:"contragentName,omitempty"`
|
||||||
ContragentInn string `url:"contragentInn,omitempty"`
|
ContragentInn string `url:"contragentInn,omitempty"`
|
||||||
@ -99,7 +99,7 @@ type CorporateCustomersFilter struct {
|
|||||||
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersNotesFilter type
|
// CorporateCustomersNotesFilter type.
|
||||||
type CorporateCustomersNotesFilter struct {
|
type CorporateCustomersNotesFilter struct {
|
||||||
Ids []string `url:"ids,omitempty,brackets"`
|
Ids []string `url:"ids,omitempty,brackets"`
|
||||||
CustomerIds []string `url:"ids,omitempty,brackets"`
|
CustomerIds []string `url:"ids,omitempty,brackets"`
|
||||||
@ -110,7 +110,7 @@ type CorporateCustomersNotesFilter struct {
|
|||||||
CreatedAtTo string `url:"createdAtTo,omitempty"`
|
CreatedAtTo string `url:"createdAtTo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerAddressesFilter type
|
// CorporateCustomerAddressesFilter type.
|
||||||
type CorporateCustomerAddressesFilter struct {
|
type CorporateCustomerAddressesFilter struct {
|
||||||
Ids []string `url:"ids,omitempty,brackets"`
|
Ids []string `url:"ids,omitempty,brackets"`
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty"`
|
||||||
@ -118,13 +118,13 @@ type CorporateCustomerAddressesFilter struct {
|
|||||||
Region string `url:"region,omitempty"`
|
Region string `url:"region,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IdentifiersPairFilter type
|
// IdentifiersPairFilter type.
|
||||||
type IdentifiersPairFilter struct {
|
type IdentifiersPairFilter struct {
|
||||||
Ids []string `url:"ids,omitempty,brackets"`
|
Ids []string `url:"ids,omitempty,brackets"`
|
||||||
ExternalIds []string `url:"externalIds,omitempty,brackets"`
|
ExternalIds []string `url:"externalIds,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomersHistoryFilter type
|
// CustomersHistoryFilter type.
|
||||||
type CustomersHistoryFilter struct {
|
type CustomersHistoryFilter struct {
|
||||||
CustomerID int `url:"customerId,omitempty"`
|
CustomerID int `url:"customerId,omitempty"`
|
||||||
SinceID int `url:"sinceId,omitempty"`
|
SinceID int `url:"sinceId,omitempty"`
|
||||||
@ -133,7 +133,7 @@ type CustomersHistoryFilter struct {
|
|||||||
EndDate string `url:"endDate,omitempty"`
|
EndDate string `url:"endDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersHistoryFilter type
|
// CorporateCustomersHistoryFilter type.
|
||||||
type CorporateCustomersHistoryFilter struct {
|
type CorporateCustomersHistoryFilter struct {
|
||||||
CustomerID int `url:"customerId,omitempty"`
|
CustomerID int `url:"customerId,omitempty"`
|
||||||
SinceID int `url:"sinceId,omitempty"`
|
SinceID int `url:"sinceId,omitempty"`
|
||||||
@ -143,7 +143,7 @@ type CorporateCustomersHistoryFilter struct {
|
|||||||
EndDate string `url:"endDate,omitempty"`
|
EndDate string `url:"endDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersFilter type
|
// OrdersFilter type.
|
||||||
type OrdersFilter struct {
|
type OrdersFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
ExternalIds []string `url:"externalIds,omitempty,brackets"`
|
ExternalIds []string `url:"externalIds,omitempty,brackets"`
|
||||||
@ -234,7 +234,7 @@ type OrdersFilter struct {
|
|||||||
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `url:"customFields,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersHistoryFilter type
|
// OrdersHistoryFilter type.
|
||||||
type OrdersHistoryFilter struct {
|
type OrdersHistoryFilter struct {
|
||||||
OrderID int `url:"orderId,omitempty"`
|
OrderID int `url:"orderId,omitempty"`
|
||||||
SinceID int `url:"sinceId,omitempty"`
|
SinceID int `url:"sinceId,omitempty"`
|
||||||
@ -243,7 +243,7 @@ type OrdersHistoryFilter struct {
|
|||||||
EndDate string `url:"endDate,omitempty"`
|
EndDate string `url:"endDate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UsersFilter type
|
// UsersFilter type.
|
||||||
type UsersFilter struct {
|
type UsersFilter struct {
|
||||||
Email string `url:"email,omitempty"`
|
Email string `url:"email,omitempty"`
|
||||||
Status string `url:"status,omitempty"`
|
Status string `url:"status,omitempty"`
|
||||||
@ -256,7 +256,7 @@ type UsersFilter struct {
|
|||||||
Groups []string `url:"groups,omitempty,brackets"`
|
Groups []string `url:"groups,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TasksFilter type
|
// TasksFilter type.
|
||||||
type TasksFilter struct {
|
type TasksFilter struct {
|
||||||
OrderNumber string `url:"orderNumber,omitempty"`
|
OrderNumber string `url:"orderNumber,omitempty"`
|
||||||
Status string `url:"status,omitempty"`
|
Status string `url:"status,omitempty"`
|
||||||
@ -268,7 +268,7 @@ type TasksFilter struct {
|
|||||||
Performers []int `url:"performers,omitempty,brackets"`
|
Performers []int `url:"performers,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotesFilter type
|
// NotesFilter type.
|
||||||
type NotesFilter struct {
|
type NotesFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
CustomerIds []int `url:"customerIds,omitempty,brackets"`
|
CustomerIds []int `url:"customerIds,omitempty,brackets"`
|
||||||
@ -279,7 +279,7 @@ type NotesFilter struct {
|
|||||||
CreatedAtTo string `url:"createdAtTo,omitempty"`
|
CreatedAtTo string `url:"createdAtTo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SegmentsFilter type
|
// SegmentsFilter type.
|
||||||
type SegmentsFilter struct {
|
type SegmentsFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
Active int `url:"active,omitempty"`
|
Active int `url:"active,omitempty"`
|
||||||
@ -291,7 +291,7 @@ type SegmentsFilter struct {
|
|||||||
DateTo string `url:"dateTo,omitempty"`
|
DateTo string `url:"dateTo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PacksFilter type
|
// PacksFilter type.
|
||||||
type PacksFilter struct {
|
type PacksFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
Stores []string `url:"stores,omitempty"`
|
Stores []string `url:"stores,omitempty"`
|
||||||
@ -306,7 +306,7 @@ type PacksFilter struct {
|
|||||||
DeliveryNoteNumber string `url:"deliveryNoteNumber,omitempty"`
|
DeliveryNoteNumber string `url:"deliveryNoteNumber,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InventoriesFilter type
|
// InventoriesFilter type.
|
||||||
type InventoriesFilter struct {
|
type InventoriesFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
ProductExternalID string `url:"productExternalId,omitempty"`
|
ProductExternalID string `url:"productExternalId,omitempty"`
|
||||||
@ -319,7 +319,7 @@ type InventoriesFilter struct {
|
|||||||
Sites []string `url:"sites,omitempty,brackets"`
|
Sites []string `url:"sites,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsGroupsFilter type
|
// ProductsGroupsFilter type.
|
||||||
type ProductsGroupsFilter struct {
|
type ProductsGroupsFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
Sites []string `url:"sites,omitempty,brackets"`
|
Sites []string `url:"sites,omitempty,brackets"`
|
||||||
@ -327,7 +327,7 @@ type ProductsGroupsFilter struct {
|
|||||||
ParentGroupID string `url:"parentGroupId,omitempty"`
|
ParentGroupID string `url:"parentGroupId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsFilter type
|
// ProductsFilter type.
|
||||||
type ProductsFilter struct {
|
type ProductsFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
OfferIds []int `url:"offerIds,omitempty,brackets"`
|
OfferIds []int `url:"offerIds,omitempty,brackets"`
|
||||||
@ -355,14 +355,14 @@ type ProductsFilter struct {
|
|||||||
Properties map[string]string `url:"properties,omitempty,brackets"`
|
Properties map[string]string `url:"properties,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsPropertiesFilter type
|
// ProductsPropertiesFilter type.
|
||||||
type ProductsPropertiesFilter struct {
|
type ProductsPropertiesFilter struct {
|
||||||
Code string `url:"code,omitempty"`
|
Code string `url:"code,omitempty"`
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty"`
|
||||||
Sites []string `url:"sites,omitempty,brackets"`
|
Sites []string `url:"sites,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShipmentFilter type
|
// ShipmentFilter type.
|
||||||
type ShipmentFilter struct {
|
type ShipmentFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
ExternalID string `url:"externalId,omitempty"`
|
ExternalID string `url:"externalId,omitempty"`
|
||||||
@ -375,7 +375,7 @@ type ShipmentFilter struct {
|
|||||||
Statuses []string `url:"statuses,omitempty,brackets"`
|
Statuses []string `url:"statuses,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostsFilter type
|
// CostsFilter type.
|
||||||
type CostsFilter struct {
|
type CostsFilter struct {
|
||||||
MinSumm string `url:"minSumm,omitempty"`
|
MinSumm string `url:"minSumm,omitempty"`
|
||||||
MaxSumm string `url:"maxSumm,omitempty"`
|
MaxSumm string `url:"maxSumm,omitempty"`
|
||||||
@ -395,7 +395,7 @@ type CostsFilter struct {
|
|||||||
OrderExternalIds []string `url:"orderIds,omitempty,brackets"`
|
OrderExternalIds []string `url:"orderIds,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FilesFilter type
|
// FilesFilter type.
|
||||||
type FilesFilter struct {
|
type FilesFilter struct {
|
||||||
Ids []int `url:"ids,omitempty,brackets"`
|
Ids []int `url:"ids,omitempty,brackets"`
|
||||||
OrderIds []int `url:"orderIds,omitempty,brackets"`
|
OrderIds []int `url:"orderIds,omitempty,brackets"`
|
||||||
@ -412,7 +412,7 @@ type FilesFilter struct {
|
|||||||
Sites []string `url:"sites,omitempty,brackets"`
|
Sites []string `url:"sites,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomFieldsFilter type
|
// CustomFieldsFilter type.
|
||||||
type CustomFieldsFilter struct {
|
type CustomFieldsFilter struct {
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty"`
|
||||||
Code string `url:"code,omitempty"`
|
Code string `url:"code,omitempty"`
|
||||||
@ -422,7 +422,7 @@ type CustomFieldsFilter struct {
|
|||||||
DisplayArea string `url:"displayArea,omitempty"`
|
DisplayArea string `url:"displayArea,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomDictionariesFilter type
|
// CustomDictionariesFilter type.
|
||||||
type CustomDictionariesFilter struct {
|
type CustomDictionariesFilter struct {
|
||||||
Name string `url:"name,omitempty"`
|
Name string `url:"name,omitempty"`
|
||||||
Code string `url:"code,omitempty"`
|
Code string `url:"code,omitempty"`
|
||||||
|
@ -1,7 +1,35 @@
|
|||||||
package v5
|
package v5
|
||||||
|
|
||||||
import "encoding/json"
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
func (t Tag) MarshalJSON() ([]byte, error) {
|
func (t Tag) MarshalJSON() ([]byte, error) {
|
||||||
return json.Marshal(t.Name)
|
return json.Marshal(t.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *APIErrorsList) UnmarshalJSON(data []byte) error {
|
||||||
|
var i interface{}
|
||||||
|
var m map[string]string
|
||||||
|
if err := json.Unmarshal(data, &i); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
switch e := i.(type) {
|
||||||
|
case map[string]interface{}:
|
||||||
|
m = make(map[string]string, len(e))
|
||||||
|
for idx, val := range e {
|
||||||
|
m[idx] = fmt.Sprint(val)
|
||||||
|
}
|
||||||
|
case []interface{}:
|
||||||
|
m = make(map[string]string, len(e))
|
||||||
|
for idx, val := range e {
|
||||||
|
m[strconv.Itoa(idx)] = fmt.Sprint(val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*a = m
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
@ -1,33 +1,33 @@
|
|||||||
package v5
|
package v5
|
||||||
|
|
||||||
// CustomerRequest type
|
// CustomerRequest type.
|
||||||
type CustomerRequest struct {
|
type CustomerRequest struct {
|
||||||
By string `url:"by,omitempty"`
|
By string `url:"by,omitempty"`
|
||||||
Site string `url:"site,omitempty"`
|
Site string `url:"site,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomersRequest type
|
// CustomersRequest type.
|
||||||
type CustomersRequest struct {
|
type CustomersRequest struct {
|
||||||
Filter CustomersFilter `url:"filter,omitempty"`
|
Filter CustomersFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersRequest type
|
// CorporateCustomersRequest type.
|
||||||
type CorporateCustomersRequest struct {
|
type CorporateCustomersRequest struct {
|
||||||
Filter CorporateCustomersFilter `url:"filter,omitempty"`
|
Filter CorporateCustomersFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersNotesRequest type
|
// CorporateCustomersNotesRequest type.
|
||||||
type CorporateCustomersNotesRequest struct {
|
type CorporateCustomersNotesRequest struct {
|
||||||
Filter CorporateCustomersNotesFilter `url:"filter,omitempty"`
|
Filter CorporateCustomersNotesFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerAddressesRequest type
|
// CorporateCustomerAddressesRequest type.
|
||||||
type CorporateCustomerAddressesRequest struct {
|
type CorporateCustomerAddressesRequest struct {
|
||||||
Filter CorporateCustomerAddressesFilter `url:"filter,omitempty"`
|
Filter CorporateCustomerAddressesFilter `url:"filter,omitempty"`
|
||||||
By string `url:"by,omitempty"`
|
By string `url:"by,omitempty"`
|
||||||
@ -36,7 +36,7 @@ type CorporateCustomerAddressesRequest struct {
|
|||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IdentifiersPairRequest type
|
// IdentifiersPairRequest type.
|
||||||
type IdentifiersPairRequest struct {
|
type IdentifiersPairRequest struct {
|
||||||
Filter IdentifiersPairFilter `url:"filter,omitempty"`
|
Filter IdentifiersPairFilter `url:"filter,omitempty"`
|
||||||
By string `url:"by,omitempty"`
|
By string `url:"by,omitempty"`
|
||||||
@ -45,135 +45,135 @@ type IdentifiersPairRequest struct {
|
|||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomersUploadRequest type
|
// CustomersUploadRequest type.
|
||||||
type CustomersUploadRequest struct {
|
type CustomersUploadRequest struct {
|
||||||
Customers []Customer `url:"customers,omitempty,brackets"`
|
Customers []Customer `url:"customers,omitempty,brackets"`
|
||||||
Site string `url:"site,omitempty"`
|
Site string `url:"site,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomersHistoryRequest type
|
// CustomersHistoryRequest type.
|
||||||
type CustomersHistoryRequest struct {
|
type CustomersHistoryRequest struct {
|
||||||
Filter CustomersHistoryFilter `url:"filter,omitempty"`
|
Filter CustomersHistoryFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersHistoryRequest type
|
// CorporateCustomersHistoryRequest type.
|
||||||
type CorporateCustomersHistoryRequest struct {
|
type CorporateCustomersHistoryRequest struct {
|
||||||
Filter CorporateCustomersHistoryFilter `url:"filter,omitempty"`
|
Filter CorporateCustomersHistoryFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderRequest type
|
// OrderRequest type.
|
||||||
type OrderRequest struct {
|
type OrderRequest struct {
|
||||||
By string `url:"by,omitempty"`
|
By string `url:"by,omitempty"`
|
||||||
Site string `url:"site,omitempty"`
|
Site string `url:"site,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersRequest type
|
// OrdersRequest type.
|
||||||
type OrdersRequest struct {
|
type OrdersRequest struct {
|
||||||
Filter OrdersFilter `url:"filter,omitempty"`
|
Filter OrdersFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersStatusesRequest type
|
// OrdersStatusesRequest type.
|
||||||
type OrdersStatusesRequest struct {
|
type OrdersStatusesRequest struct {
|
||||||
IDs []int `url:"ids,omitempty,brackets"`
|
IDs []int `url:"ids,omitempty,brackets"`
|
||||||
ExternalIDs []string `url:"externalIds,omitempty,brackets"`
|
ExternalIDs []string `url:"externalIds,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersUploadRequest type
|
// OrdersUploadRequest type.
|
||||||
type OrdersUploadRequest struct {
|
type OrdersUploadRequest struct {
|
||||||
Orders []Order `url:"orders,omitempty,brackets"`
|
Orders []Order `url:"orders,omitempty,brackets"`
|
||||||
Site string `url:"site,omitempty"`
|
Site string `url:"site,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersHistoryRequest type
|
// OrdersHistoryRequest type.
|
||||||
type OrdersHistoryRequest struct {
|
type OrdersHistoryRequest struct {
|
||||||
Filter OrdersHistoryFilter `url:"filter,omitempty"`
|
Filter OrdersHistoryFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PacksRequest type
|
// PacksRequest type.
|
||||||
type PacksRequest struct {
|
type PacksRequest struct {
|
||||||
Filter PacksFilter `url:"filter,omitempty"`
|
Filter PacksFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PacksHistoryRequest type
|
// PacksHistoryRequest type.
|
||||||
type PacksHistoryRequest struct {
|
type PacksHistoryRequest struct {
|
||||||
Filter OrdersHistoryFilter `url:"filter,omitempty"`
|
Filter OrdersHistoryFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UsersRequest type
|
// UsersRequest type.
|
||||||
type UsersRequest struct {
|
type UsersRequest struct {
|
||||||
Filter UsersFilter `url:"filter,omitempty"`
|
Filter UsersFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserGroupsRequest type
|
// UserGroupsRequest type.
|
||||||
type UserGroupsRequest struct {
|
type UserGroupsRequest struct {
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TasksRequest type
|
// TasksRequest type.
|
||||||
type TasksRequest struct {
|
type TasksRequest struct {
|
||||||
Filter TasksFilter `url:"filter,omitempty"`
|
Filter TasksFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotesRequest type
|
// NotesRequest type.
|
||||||
type NotesRequest struct {
|
type NotesRequest struct {
|
||||||
Filter NotesFilter `url:"filter,omitempty"`
|
Filter NotesFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SegmentsRequest type
|
// SegmentsRequest type.
|
||||||
type SegmentsRequest struct {
|
type SegmentsRequest struct {
|
||||||
Filter SegmentsFilter `url:"filter,omitempty"`
|
Filter SegmentsFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InventoriesRequest type
|
// InventoriesRequest type.
|
||||||
type InventoriesRequest struct {
|
type InventoriesRequest struct {
|
||||||
Filter InventoriesFilter `url:"filter,omitempty"`
|
Filter InventoriesFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsGroupsRequest type
|
// ProductsGroupsRequest type.
|
||||||
type ProductsGroupsRequest struct {
|
type ProductsGroupsRequest struct {
|
||||||
Filter ProductsGroupsFilter `url:"filter,omitempty"`
|
Filter ProductsGroupsFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsRequest type
|
// ProductsRequest type.
|
||||||
type ProductsRequest struct {
|
type ProductsRequest struct {
|
||||||
Filter ProductsFilter `url:"filter,omitempty"`
|
Filter ProductsFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsPropertiesRequest type
|
// ProductsPropertiesRequest type.
|
||||||
type ProductsPropertiesRequest struct {
|
type ProductsPropertiesRequest struct {
|
||||||
Filter ProductsPropertiesFilter `url:"filter,omitempty"`
|
Filter ProductsPropertiesFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryTrackingRequest type
|
// DeliveryTrackingRequest type.
|
||||||
type DeliveryTrackingRequest struct {
|
type DeliveryTrackingRequest struct {
|
||||||
DeliveryID string `json:"deliveryId,omitempty"`
|
DeliveryID string `json:"deliveryId,omitempty"`
|
||||||
TrackNumber string `json:"trackNumber,omitempty"`
|
TrackNumber string `json:"trackNumber,omitempty"`
|
||||||
@ -181,35 +181,35 @@ type DeliveryTrackingRequest struct {
|
|||||||
ExtraData map[string]string `json:"extraData,omitempty,brackets"`
|
ExtraData map[string]string `json:"extraData,omitempty,brackets"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryShipmentsRequest type
|
// DeliveryShipmentsRequest type.
|
||||||
type DeliveryShipmentsRequest struct {
|
type DeliveryShipmentsRequest struct {
|
||||||
Filter ShipmentFilter `url:"filter,omitempty"`
|
Filter ShipmentFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostsRequest type
|
// CostsRequest type.
|
||||||
type CostsRequest struct {
|
type CostsRequest struct {
|
||||||
Filter CostsFilter `url:"filter,omitempty"`
|
Filter CostsFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FilesRequest type
|
// FilesRequest type.
|
||||||
type FilesRequest struct {
|
type FilesRequest struct {
|
||||||
Filter FilesFilter `url:"filter,omitempty"`
|
Filter FilesFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomFieldsRequest type
|
// CustomFieldsRequest type.
|
||||||
type CustomFieldsRequest struct {
|
type CustomFieldsRequest struct {
|
||||||
Filter CustomFieldsFilter `url:"filter,omitempty"`
|
Filter CustomFieldsFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
Page int `url:"page,omitempty"`
|
Page int `url:"page,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomDictionariesRequest type
|
// CustomDictionariesRequest type.
|
||||||
type CustomDictionariesRequest struct {
|
type CustomDictionariesRequest struct {
|
||||||
Filter CustomDictionariesFilter `url:"filter,omitempty"`
|
Filter CustomDictionariesFilter `url:"filter,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
|
282
v5/response.go
282
v5/response.go
@ -1,495 +1,495 @@
|
|||||||
package v5
|
package v5
|
||||||
|
|
||||||
// SuccessfulResponse type
|
// SuccessfulResponse type.
|
||||||
type SuccessfulResponse struct {
|
type SuccessfulResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateResponse type
|
// CreateResponse type.
|
||||||
type CreateResponse struct {
|
type CreateResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderCreateResponse type
|
// OrderCreateResponse type.
|
||||||
type OrderCreateResponse struct {
|
type OrderCreateResponse struct {
|
||||||
CreateResponse
|
CreateResponse
|
||||||
Order Order `json:"order,omitempty"`
|
Order Order `json:"order,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OperationResponse type
|
// OperationResponse type.
|
||||||
type OperationResponse struct {
|
type OperationResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Errors map[string]string `json:"errors,omitempty,brackets"`
|
Errors map[string]string `json:"errors,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// VersionResponse return available API versions
|
// VersionResponse return available API versions.
|
||||||
type VersionResponse struct {
|
type VersionResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
Versions []string `json:"versions,brackets,omitempty"`
|
Versions []string `json:"versions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CredentialResponse return available API methods
|
// CredentialResponse return available API methods.
|
||||||
type CredentialResponse struct {
|
type CredentialResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
Credentials []string `json:"credentials,brackets,omitempty"`
|
Credentials []string `json:"credentials,omitempty"`
|
||||||
SiteAccess string `json:"siteAccess,omitempty"`
|
SiteAccess string `json:"siteAccess,omitempty"`
|
||||||
SitesAvailable []string `json:"sitesAvailable,brackets,omitempty"`
|
SitesAvailable []string `json:"sitesAvailable,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomerResponse type
|
// CustomerResponse type.
|
||||||
type CustomerResponse struct {
|
type CustomerResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Customer *Customer `json:"customer,omitempty,brackets"`
|
Customer *Customer `json:"customer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerResponse type
|
// CorporateCustomerResponse type.
|
||||||
type CorporateCustomerResponse struct {
|
type CorporateCustomerResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
CorporateCustomer *CorporateCustomer `json:"customerCorporate,omitempty,brackets"`
|
CorporateCustomer *CorporateCustomer `json:"customerCorporate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomersResponse type
|
// CustomersResponse type.
|
||||||
type CustomersResponse struct {
|
type CustomersResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Customers []Customer `json:"customers,omitempty,brackets"`
|
Customers []Customer `json:"customers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersResponse type
|
// CorporateCustomersResponse type.
|
||||||
type CorporateCustomersResponse struct {
|
type CorporateCustomersResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
CustomersCorporate []CorporateCustomer `json:"customersCorporate,omitempty,brackets"`
|
CustomersCorporate []CorporateCustomer `json:"customersCorporate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersNotesResponse type
|
// CorporateCustomersNotesResponse type.
|
||||||
type CorporateCustomersNotesResponse struct {
|
type CorporateCustomersNotesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Notes []Note `json:"notes,omitempty,brackets"`
|
Notes []Note `json:"notes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersAddressesResponse type
|
// CorporateCustomersAddressesResponse type.
|
||||||
type CorporateCustomersAddressesResponse struct {
|
type CorporateCustomersAddressesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Addresses []CorporateCustomerAddress `json:"addresses"`
|
Addresses []CorporateCustomerAddress `json:"addresses"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerCompaniesResponse type
|
// CorporateCustomerCompaniesResponse type.
|
||||||
type CorporateCustomerCompaniesResponse struct {
|
type CorporateCustomerCompaniesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Companies []Company `json:"companies"`
|
Companies []Company `json:"companies"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerContactsResponse type
|
// CorporateCustomerContactsResponse type.
|
||||||
type CorporateCustomerContactsResponse struct {
|
type CorporateCustomerContactsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Contacts []CorporateCustomerContact `json:"contacts"`
|
Contacts []CorporateCustomerContact `json:"contacts"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomerChangeResponse type
|
// CustomerChangeResponse type.
|
||||||
type CustomerChangeResponse struct {
|
type CustomerChangeResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
State string `json:"state,omitempty"`
|
State string `json:"state,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerChangeResponse type
|
// CorporateCustomerChangeResponse type.
|
||||||
type CorporateCustomerChangeResponse CustomerChangeResponse
|
type CorporateCustomerChangeResponse CustomerChangeResponse
|
||||||
|
|
||||||
// CustomersUploadResponse type
|
// CustomersUploadResponse type.
|
||||||
type CustomersUploadResponse struct {
|
type CustomersUploadResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
UploadedCustomers []IdentifiersPair `json:"uploadedCustomers,omitempty,brackets"`
|
UploadedCustomers []IdentifiersPair `json:"uploadedCustomers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersUploadResponse type
|
// CorporateCustomersUploadResponse type.
|
||||||
type CorporateCustomersUploadResponse CustomersUploadResponse
|
type CorporateCustomersUploadResponse CustomersUploadResponse
|
||||||
|
|
||||||
// CustomersHistoryResponse type
|
// CustomersHistoryResponse type.
|
||||||
type CustomersHistoryResponse struct {
|
type CustomersHistoryResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
GeneratedAt string `json:"generatedAt,omitempty"`
|
GeneratedAt string `json:"generatedAt,omitempty"`
|
||||||
History []CustomerHistoryRecord `json:"history,omitempty,brackets"`
|
History []CustomerHistoryRecord `json:"history,omitempty"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomersHistoryResponse type
|
// CorporateCustomersHistoryResponse type.
|
||||||
type CorporateCustomersHistoryResponse struct {
|
type CorporateCustomersHistoryResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
GeneratedAt string `json:"generatedAt,omitempty"`
|
GeneratedAt string `json:"generatedAt,omitempty"`
|
||||||
History []CorporateCustomerHistoryRecord `json:"history,omitempty,brackets"`
|
History []CorporateCustomerHistoryRecord `json:"history,omitempty"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderResponse type
|
// OrderResponse type.
|
||||||
type OrderResponse struct {
|
type OrderResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Order *Order `json:"order,omitempty,brackets"`
|
Order *Order `json:"order,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersResponse type
|
// OrdersResponse type.
|
||||||
type OrdersResponse struct {
|
type OrdersResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Orders []Order `json:"orders,omitempty,brackets"`
|
Orders []Order `json:"orders,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersStatusesResponse type
|
// OrdersStatusesResponse type.
|
||||||
type OrdersStatusesResponse struct {
|
type OrdersStatusesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Orders []OrdersStatus `json:"orders"`
|
Orders []OrdersStatus `json:"orders"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersUploadResponse type
|
// OrdersUploadResponse type.
|
||||||
type OrdersUploadResponse struct {
|
type OrdersUploadResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
UploadedOrders []IdentifiersPair `json:"uploadedOrders,omitempty,brackets"`
|
UploadedOrders []IdentifiersPair `json:"uploadedOrders,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersHistoryResponse type
|
// OrdersHistoryResponse type.
|
||||||
type OrdersHistoryResponse struct {
|
type OrdersHistoryResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
GeneratedAt string `json:"generatedAt,omitempty"`
|
GeneratedAt string `json:"generatedAt,omitempty"`
|
||||||
History []OrdersHistoryRecord `json:"history,omitempty,brackets"`
|
History []OrdersHistoryRecord `json:"history,omitempty"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackResponse type
|
// PackResponse type.
|
||||||
type PackResponse struct {
|
type PackResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pack *Pack `json:"pack,omitempty,brackets"`
|
Pack *Pack `json:"pack,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PacksResponse type
|
// PacksResponse type.
|
||||||
type PacksResponse struct {
|
type PacksResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Packs []Pack `json:"packs,omitempty,brackets"`
|
Packs []Pack `json:"packs,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PacksHistoryResponse type
|
// PacksHistoryResponse type.
|
||||||
type PacksHistoryResponse struct {
|
type PacksHistoryResponse struct {
|
||||||
Success bool `json:"success,omitempty"`
|
Success bool `json:"success,omitempty"`
|
||||||
GeneratedAt string `json:"generatedAt,omitempty"`
|
GeneratedAt string `json:"generatedAt,omitempty"`
|
||||||
History []PacksHistoryRecord `json:"history,omitempty,brackets"`
|
History []PacksHistoryRecord `json:"history,omitempty"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserResponse type
|
// UserResponse type.
|
||||||
type UserResponse struct {
|
type UserResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
User *User `json:"user,omitempty,brackets"`
|
User *User `json:"user,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UsersResponse type
|
// UsersResponse type.
|
||||||
type UsersResponse struct {
|
type UsersResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Users []User `json:"users,omitempty,brackets"`
|
Users []User `json:"users,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserGroupsResponse type
|
// UserGroupsResponse type.
|
||||||
type UserGroupsResponse struct {
|
type UserGroupsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Groups []UserGroup `json:"groups,omitempty,brackets"`
|
Groups []UserGroup `json:"groups,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TaskResponse type
|
// TaskResponse type.
|
||||||
type TaskResponse struct {
|
type TaskResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Task *Task `json:"task,omitempty,brackets"`
|
Task *Task `json:"task,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TasksResponse type
|
// TasksResponse type.
|
||||||
type TasksResponse struct {
|
type TasksResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Tasks []Task `json:"tasks,omitempty,brackets"`
|
Tasks []Task `json:"tasks,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotesResponse type
|
// NotesResponse type.
|
||||||
type NotesResponse struct {
|
type NotesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Notes []Note `json:"notes,omitempty,brackets"`
|
Notes []Note `json:"notes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SegmentsResponse type
|
// SegmentsResponse type.
|
||||||
type SegmentsResponse struct {
|
type SegmentsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Segments []Segment `json:"segments,omitempty,brackets"`
|
Segments []Segment `json:"segments,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SettingsResponse type
|
// SettingsResponse type.
|
||||||
type SettingsResponse struct {
|
type SettingsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Settings Settings `json:"settings,omitempty,brackets"`
|
Settings Settings `json:"settings,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CountriesResponse type
|
// CountriesResponse type.
|
||||||
type CountriesResponse struct {
|
type CountriesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
CountriesIso []string `json:"countriesIso,omitempty,brackets"`
|
CountriesIso []string `json:"countriesIso,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostGroupsResponse type
|
// CostGroupsResponse type.
|
||||||
type CostGroupsResponse struct {
|
type CostGroupsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
CostGroups []CostGroup `json:"costGroups,omitempty,brackets"`
|
CostGroups []CostGroup `json:"costGroups,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostItemsResponse type
|
// CostItemsResponse type.
|
||||||
type CostItemsResponse struct {
|
type CostItemsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
CostItems []CostItem `json:"costItems,omitempty,brackets"`
|
CostItems []CostItem `json:"costItems,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CouriersResponse type
|
// CouriersResponse type.
|
||||||
type CouriersResponse struct {
|
type CouriersResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Couriers []Courier `json:"couriers,omitempty,brackets"`
|
Couriers []Courier `json:"couriers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryServiceResponse type
|
// DeliveryServiceResponse type.
|
||||||
type DeliveryServiceResponse struct {
|
type DeliveryServiceResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
DeliveryServices map[string]DeliveryService `json:"deliveryServices,omitempty,brackets"`
|
DeliveryServices map[string]DeliveryService `json:"deliveryServices,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryTypesResponse type
|
// DeliveryTypesResponse type.
|
||||||
type DeliveryTypesResponse struct {
|
type DeliveryTypesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
DeliveryTypes map[string]DeliveryType `json:"deliveryTypes,omitempty,brackets"`
|
DeliveryTypes map[string]DeliveryType `json:"deliveryTypes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LegalEntitiesResponse type
|
// LegalEntitiesResponse type.
|
||||||
type LegalEntitiesResponse struct {
|
type LegalEntitiesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
LegalEntities []LegalEntity `json:"legalEntities,omitempty,brackets"`
|
LegalEntities []LegalEntity `json:"legalEntities,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderMethodsResponse type
|
// OrderMethodsResponse type.
|
||||||
type OrderMethodsResponse struct {
|
type OrderMethodsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
OrderMethods map[string]OrderMethod `json:"orderMethods,omitempty,brackets"`
|
OrderMethods map[string]OrderMethod `json:"orderMethods,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderTypesResponse type
|
// OrderTypesResponse type.
|
||||||
type OrderTypesResponse struct {
|
type OrderTypesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
OrderTypes map[string]OrderType `json:"orderTypes,omitempty,brackets"`
|
OrderTypes map[string]OrderType `json:"orderTypes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaymentStatusesResponse type
|
// PaymentStatusesResponse type.
|
||||||
type PaymentStatusesResponse struct {
|
type PaymentStatusesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
PaymentStatuses map[string]PaymentStatus `json:"paymentStatuses,omitempty,brackets"`
|
PaymentStatuses map[string]PaymentStatus `json:"paymentStatuses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaymentTypesResponse type
|
// PaymentTypesResponse type.
|
||||||
type PaymentTypesResponse struct {
|
type PaymentTypesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
PaymentTypes map[string]PaymentType `json:"paymentTypes,omitempty,brackets"`
|
PaymentTypes map[string]PaymentType `json:"paymentTypes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PriceTypesResponse type
|
// PriceTypesResponse type.
|
||||||
type PriceTypesResponse struct {
|
type PriceTypesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
PriceTypes []PriceType `json:"priceTypes,omitempty,brackets"`
|
PriceTypes []PriceType `json:"priceTypes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductStatusesResponse type
|
// ProductStatusesResponse type.
|
||||||
type ProductStatusesResponse struct {
|
type ProductStatusesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
ProductStatuses map[string]ProductStatus `json:"productStatuses,omitempty,brackets"`
|
ProductStatuses map[string]ProductStatus `json:"productStatuses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StatusesResponse type
|
// StatusesResponse type.
|
||||||
type StatusesResponse struct {
|
type StatusesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Statuses map[string]Status `json:"statuses,omitempty,brackets"`
|
Statuses map[string]Status `json:"statuses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StatusGroupsResponse type
|
// StatusGroupsResponse type.
|
||||||
type StatusGroupsResponse struct {
|
type StatusGroupsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
StatusGroups map[string]StatusGroup `json:"statusGroups,omitempty,brackets"`
|
StatusGroups map[string]StatusGroup `json:"statusGroups,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// SitesResponse type
|
// SitesResponse type.
|
||||||
type SitesResponse struct {
|
type SitesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Sites map[string]Site `json:"sites,omitempty,brackets"`
|
Sites map[string]Site `json:"sites,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StoresResponse type
|
// StoresResponse type.
|
||||||
type StoresResponse struct {
|
type StoresResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Stores []Store `json:"stores,omitempty,brackets"`
|
Stores []Store `json:"stores,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InventoriesResponse type
|
// InventoriesResponse type.
|
||||||
type InventoriesResponse struct {
|
type InventoriesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Offers []Offer `json:"offers,omitempty"`
|
Offers []Offer `json:"offers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StoreUploadResponse type
|
// StoreUploadResponse type.
|
||||||
type StoreUploadResponse struct {
|
type StoreUploadResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
ProcessedOffersCount int `json:"processedOffersCount,omitempty"`
|
ProcessedOffersCount int `json:"processedOffersCount,omitempty"`
|
||||||
NotFoundOffers []Offer `json:"notFoundOffers,omitempty"`
|
NotFoundOffers []Offer `json:"notFoundOffers,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsGroupsResponse type
|
// ProductsGroupsResponse type.
|
||||||
type ProductsGroupsResponse struct {
|
type ProductsGroupsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
ProductGroup []ProductGroup `json:"productGroup,omitempty,brackets"`
|
ProductGroup []ProductGroup `json:"productGroup,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsResponse type
|
// ProductsResponse type.
|
||||||
type ProductsResponse struct {
|
type ProductsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Products []Product `json:"products,omitempty,brackets"`
|
Products []Product `json:"products,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductsPropertiesResponse type
|
// ProductsPropertiesResponse type.
|
||||||
type ProductsPropertiesResponse struct {
|
type ProductsPropertiesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Properties []Property `json:"properties,omitempty,brackets"`
|
Properties []Property `json:"properties,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryShipmentsResponse type
|
// DeliveryShipmentsResponse type.
|
||||||
type DeliveryShipmentsResponse struct {
|
type DeliveryShipmentsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
DeliveryShipments []DeliveryShipment `json:"deliveryShipments,omitempty,brackets"`
|
DeliveryShipments []DeliveryShipment `json:"deliveryShipments,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryShipmentResponse type
|
// DeliveryShipmentResponse type.
|
||||||
type DeliveryShipmentResponse struct {
|
type DeliveryShipmentResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
DeliveryShipment *DeliveryShipment `json:"deliveryShipment,omitempty,brackets"`
|
DeliveryShipment *DeliveryShipment `json:"deliveryShipment,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryShipmentUpdateResponse type
|
// DeliveryShipmentUpdateResponse type.
|
||||||
type DeliveryShipmentUpdateResponse struct {
|
type DeliveryShipmentUpdateResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
Status string `json:"status,omitempty"`
|
Status string `json:"status,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IntegrationModuleResponse type
|
// IntegrationModuleResponse type.
|
||||||
type IntegrationModuleResponse struct {
|
type IntegrationModuleResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
IntegrationModule *IntegrationModule `json:"integrationModule,omitempty"`
|
IntegrationModule *IntegrationModule `json:"integrationModule,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IntegrationModuleEditResponse type
|
// IntegrationModuleEditResponse type.
|
||||||
type IntegrationModuleEditResponse struct {
|
type IntegrationModuleEditResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Info ResponseInfo `json:"info,omitempty,brackets"`
|
Info ResponseInfo `json:"info,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResponseInfo type
|
// ResponseInfo type.
|
||||||
type ResponseInfo struct {
|
type ResponseInfo struct {
|
||||||
MgTransportInfo MgInfo `json:"mgTransport,omitempty,brackets"`
|
MgTransportInfo MgInfo `json:"mgTransport,omitempty"`
|
||||||
MgBotInfo MgInfo `json:"mgBot,omitempty,brackets"`
|
MgBotInfo MgInfo `json:"mgBot,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MgInfo type
|
// MgInfo type.
|
||||||
type MgInfo struct {
|
type MgInfo struct {
|
||||||
EndpointUrl string `json:"endpointUrl"`
|
EndpointUrl string `json:"endpointUrl"`
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostsResponse type
|
// CostsResponse type.
|
||||||
type CostsResponse struct {
|
type CostsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Costs []Cost `json:"costs,omitempty,brackets"`
|
Costs []Cost `json:"costs,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostsUploadResponse type
|
// CostsUploadResponse type.
|
||||||
type CostsUploadResponse struct {
|
type CostsUploadResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
UploadedCosts []int `json:"uploadedCosts,omitempty,brackets"`
|
UploadedCosts []int `json:"uploadedCosts,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostsDeleteResponse type
|
// CostsDeleteResponse type.
|
||||||
type CostsDeleteResponse struct {
|
type CostsDeleteResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Count int `json:"count,omitempty,brackets"`
|
Count int `json:"count,omitempty"`
|
||||||
NotRemovedIds []int `json:"notRemovedIds,omitempty,brackets"`
|
NotRemovedIds []int `json:"notRemovedIds,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostResponse type
|
// CostResponse type.
|
||||||
type CostResponse struct {
|
type CostResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Cost *Cost `json:"cost,omitempty,brackets"`
|
Cost *Cost `json:"cost,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FilesResponse type
|
// FilesResponse type.
|
||||||
type FilesResponse struct {
|
type FilesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
Files []File `json:"files,omitempty"`
|
Files []File `json:"files,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileUpload response
|
// FileUpload response.
|
||||||
type FileUploadResponse struct {
|
type FileUploadResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
File *File `json:"file,omitempty"`
|
File *File `json:"file,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// FileResponse type
|
// FileResponse type.
|
||||||
type FileResponse struct {
|
type FileResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
File *File `json:"file,omitempty"`
|
File *File `json:"file,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomFieldsResponse type
|
// CustomFieldsResponse type.
|
||||||
type CustomFieldsResponse struct {
|
type CustomFieldsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
CustomFields []CustomFields `json:"customFields,omitempty,brackets"`
|
CustomFields []CustomFields `json:"customFields,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomDictionariesResponse type
|
// CustomDictionariesResponse type.
|
||||||
type CustomDictionariesResponse struct {
|
type CustomDictionariesResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Pagination *Pagination `json:"pagination,omitempty"`
|
Pagination *Pagination `json:"pagination,omitempty"`
|
||||||
CustomDictionaries *[]CustomDictionary `json:"customDictionaries,omitempty,brackets"`
|
CustomDictionaries *[]CustomDictionary `json:"customDictionaries,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomResponse type
|
// CustomResponse type.
|
||||||
type CustomResponse struct {
|
type CustomResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomDictionaryResponse type
|
// CustomDictionaryResponse type.
|
||||||
type CustomDictionaryResponse struct {
|
type CustomDictionaryResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
CustomDictionary *CustomDictionary `json:"CustomDictionary,omitempty,brackets"`
|
CustomDictionary *CustomDictionary `json:"CustomDictionary,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomFieldResponse type
|
// CustomFieldResponse type.
|
||||||
type CustomFieldResponse struct {
|
type CustomFieldResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
CustomField CustomFields `json:"customField,omitempty,brackets"`
|
CustomField CustomFields `json:"customField,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnitsResponse type
|
// UnitsResponse type.
|
||||||
type UnitsResponse struct {
|
type UnitsResponse struct {
|
||||||
Success bool `json:"success"`
|
Success bool `json:"success"`
|
||||||
Units *[]Unit `json:"units,omitempty,brackets"`
|
Units *[]Unit `json:"units,omitempty"`
|
||||||
}
|
}
|
||||||
|
284
v5/types.go
284
v5/types.go
@ -7,13 +7,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ByID is "id" constant to use as `by` property in methods
|
// ByID is "id" constant to use as `by` property in methods.
|
||||||
const ByID = "id"
|
const ByID = "id"
|
||||||
|
|
||||||
// ByExternalId is "externalId" constant to use as `by` property in methods
|
// ByExternalId is "externalId" constant to use as `by` property in methods.
|
||||||
const ByExternalID = "externalId"
|
const ByExternalID = "externalId"
|
||||||
|
|
||||||
// Client type
|
// Client type.
|
||||||
type Client struct {
|
type Client struct {
|
||||||
URL string
|
URL string
|
||||||
Key string
|
Key string
|
||||||
@ -21,7 +21,7 @@ type Client struct {
|
|||||||
httpClient *http.Client
|
httpClient *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pagination type
|
// Pagination type.
|
||||||
type Pagination struct {
|
type Pagination struct {
|
||||||
Limit int `json:"limit,omitempty"`
|
Limit int `json:"limit,omitempty"`
|
||||||
TotalCount int `json:"totalCount,omitempty"`
|
TotalCount int `json:"totalCount,omitempty"`
|
||||||
@ -29,7 +29,7 @@ type Pagination struct {
|
|||||||
TotalPageCount int `json:"totalPageCount,omitempty"`
|
TotalPageCount int `json:"totalPageCount,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Address type
|
// Address type.
|
||||||
type Address struct {
|
type Address struct {
|
||||||
Index string `json:"index,omitempty"`
|
Index string `json:"index,omitempty"`
|
||||||
CountryIso string `json:"countryIso,omitempty"`
|
CountryIso string `json:"countryIso,omitempty"`
|
||||||
@ -51,7 +51,7 @@ type Address struct {
|
|||||||
Text string `json:"text,omitempty"`
|
Text string `json:"text,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GeoHierarchyRow type
|
// GeoHierarchyRow type.
|
||||||
type GeoHierarchyRow struct {
|
type GeoHierarchyRow struct {
|
||||||
Country string `json:"country,omitempty"`
|
Country string `json:"country,omitempty"`
|
||||||
Region string `json:"region,omitempty"`
|
Region string `json:"region,omitempty"`
|
||||||
@ -60,7 +60,7 @@ type GeoHierarchyRow struct {
|
|||||||
CityID int `json:"cityId,omitempty"`
|
CityID int `json:"cityId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Source type
|
// Source type.
|
||||||
type Source struct {
|
type Source struct {
|
||||||
Source string `json:"source,omitempty"`
|
Source string `json:"source,omitempty"`
|
||||||
Medium string `json:"medium,omitempty"`
|
Medium string `json:"medium,omitempty"`
|
||||||
@ -69,7 +69,7 @@ type Source struct {
|
|||||||
Content string `json:"content,omitempty"`
|
Content string `json:"content,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Contragent type
|
// Contragent type.
|
||||||
type Contragent struct {
|
type Contragent struct {
|
||||||
ContragentType string `json:"contragentType,omitempty"`
|
ContragentType string `json:"contragentType,omitempty"`
|
||||||
LegalName string `json:"legalName,omitempty"`
|
LegalName string `json:"legalName,omitempty"`
|
||||||
@ -88,26 +88,26 @@ type Contragent struct {
|
|||||||
BankAccount string `json:"bankAccount,omitempty"`
|
BankAccount string `json:"bankAccount,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// APIKey type
|
// APIKey type.
|
||||||
type APIKey struct {
|
type APIKey struct {
|
||||||
Current bool `json:"current,omitempty"`
|
Current bool `json:"current,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Property type
|
// Property type.
|
||||||
type Property struct {
|
type Property struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Value string `json:"value,omitempty"`
|
Value string `json:"value,omitempty"`
|
||||||
Sites []string `json:"Sites,omitempty,brackets"`
|
Sites []string `json:"Sites,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IdentifiersPair type
|
// IdentifiersPair type.
|
||||||
type IdentifiersPair struct {
|
type IdentifiersPair struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryTime type
|
// DeliveryTime type.
|
||||||
type DeliveryTime struct {
|
type DeliveryTime struct {
|
||||||
From string `json:"from,omitempty"`
|
From string `json:"from,omitempty"`
|
||||||
To string `json:"to,omitempty"`
|
To string `json:"to,omitempty"`
|
||||||
@ -118,7 +118,7 @@ type DeliveryTime struct {
|
|||||||
Customer related types
|
Customer related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Customer type
|
// Customer type.
|
||||||
type Customer struct {
|
type Customer struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -127,7 +127,7 @@ type Customer struct {
|
|||||||
Patronymic string `json:"patronymic,omitempty"`
|
Patronymic string `json:"patronymic,omitempty"`
|
||||||
Sex string `json:"sex,omitempty"`
|
Sex string `json:"sex,omitempty"`
|
||||||
Email string `json:"email,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
Phones []Phone `json:"phones,brackets,omitempty"`
|
Phones []Phone `json:"phones,omitempty"`
|
||||||
Address *Address `json:"address,omitempty"`
|
Address *Address `json:"address,omitempty"`
|
||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
Birthday string `json:"birthday,omitempty"`
|
Birthday string `json:"birthday,omitempty"`
|
||||||
@ -153,11 +153,11 @@ type Customer struct {
|
|||||||
BrowserID string `json:"browserId,omitempty"`
|
BrowserID string `json:"browserId,omitempty"`
|
||||||
MgCustomerID string `json:"mgCustomerId,omitempty"`
|
MgCustomerID string `json:"mgCustomerId,omitempty"`
|
||||||
PhotoURL string `json:"photoUrl,omitempty"`
|
PhotoURL string `json:"photoUrl,omitempty"`
|
||||||
CustomFields map[string]string `json:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `json:"customFields,omitempty"`
|
||||||
Tags []Tag `json:"tags,brackets,omitempty"`
|
Tags []Tag `json:"tags,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomer type
|
// CorporateCustomer type.
|
||||||
type CorporateCustomer struct {
|
type CorporateCustomer struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -165,7 +165,7 @@ type CorporateCustomer struct {
|
|||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
Vip bool `json:"vip,omitempty"`
|
Vip bool `json:"vip,omitempty"`
|
||||||
Bad bool `json:"bad,omitempty"`
|
Bad bool `json:"bad,omitempty"`
|
||||||
CustomFields map[string]string `json:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `json:"customFields,omitempty"`
|
||||||
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
|
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
|
||||||
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
|
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
|
||||||
ManagerID int `json:"managerId,omitempty"`
|
ManagerID int `json:"managerId,omitempty"`
|
||||||
@ -226,22 +226,22 @@ type Company struct {
|
|||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
Contragent *Contragent `json:"contragent,omitempty"`
|
Contragent *Contragent `json:"contragent,omitempty"`
|
||||||
Address *IdentifiersPair `json:"address,omitempty"`
|
Address *IdentifiersPair `json:"address,omitempty"`
|
||||||
CustomFields map[string]string `json:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `json:"customFields,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerNote type
|
// CorporateCustomerNote type.
|
||||||
type CorporateCustomerNote struct {
|
type CorporateCustomerNote struct {
|
||||||
ManagerID int `json:"managerId,omitempty"`
|
ManagerID int `json:"managerId,omitempty"`
|
||||||
Text string `json:"text,omitempty"`
|
Text string `json:"text,omitempty"`
|
||||||
Customer *IdentifiersPair `json:"customer,omitempty"`
|
Customer *IdentifiersPair `json:"customer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phone type
|
// Phone type.
|
||||||
type Phone struct {
|
type Phone struct {
|
||||||
Number string `json:"number,omitempty"`
|
Number string `json:"number,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomerHistoryRecord type
|
// CustomerHistoryRecord type.
|
||||||
type CustomerHistoryRecord struct {
|
type CustomerHistoryRecord struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
@ -249,12 +249,12 @@ type CustomerHistoryRecord struct {
|
|||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
Source string `json:"source,omitempty"`
|
Source string `json:"source,omitempty"`
|
||||||
Field string `json:"field,omitempty"`
|
Field string `json:"field,omitempty"`
|
||||||
User *User `json:"user,omitempty,brackets"`
|
User *User `json:"user,omitempty"`
|
||||||
APIKey *APIKey `json:"apiKey,omitempty,brackets"`
|
APIKey *APIKey `json:"apiKey,omitempty"`
|
||||||
Customer *Customer `json:"customer,omitempty,brackets"`
|
Customer *Customer `json:"customer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CorporateCustomerHistoryRecord type
|
// CorporateCustomerHistoryRecord type.
|
||||||
type CorporateCustomerHistoryRecord struct {
|
type CorporateCustomerHistoryRecord struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
@ -262,16 +262,16 @@ type CorporateCustomerHistoryRecord struct {
|
|||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
Source string `json:"source,omitempty"`
|
Source string `json:"source,omitempty"`
|
||||||
Field string `json:"field,omitempty"`
|
Field string `json:"field,omitempty"`
|
||||||
User *User `json:"user,omitempty,brackets"`
|
User *User `json:"user,omitempty"`
|
||||||
APIKey *APIKey `json:"apiKey,omitempty,brackets"`
|
APIKey *APIKey `json:"apiKey,omitempty"`
|
||||||
CorporateCustomer *CorporateCustomer `json:"corporateCustomer,omitempty,brackets"`
|
CorporateCustomer *CorporateCustomer `json:"corporateCustomer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Order related types
|
Order related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Order type
|
// Order type.
|
||||||
type Order struct {
|
type Order struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -319,12 +319,12 @@ type Order struct {
|
|||||||
Customer *Customer `json:"customer,omitempty"`
|
Customer *Customer `json:"customer,omitempty"`
|
||||||
Delivery *OrderDelivery `json:"delivery,omitempty"`
|
Delivery *OrderDelivery `json:"delivery,omitempty"`
|
||||||
Marketplace *OrderMarketplace `json:"marketplace,omitempty"`
|
Marketplace *OrderMarketplace `json:"marketplace,omitempty"`
|
||||||
Items []OrderItem `json:"items,omitempty,brackets"`
|
Items []OrderItem `json:"items,omitempty"`
|
||||||
CustomFields map[string]string `json:"customFields,omitempty,brackets"`
|
CustomFields map[string]string `json:"customFields,omitempty"`
|
||||||
Payments map[string]OrderPayment `json:"payments,omitempty,brackets"`
|
Payments map[string]OrderPayment `json:"payments,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersStatus type
|
// OrdersStatus type.
|
||||||
type OrdersStatus struct {
|
type OrdersStatus struct {
|
||||||
ID int `json:"id"`
|
ID int `json:"id"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -332,7 +332,7 @@ type OrdersStatus struct {
|
|||||||
Group string `json:"group"`
|
Group string `json:"group"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderDelivery type
|
// OrderDelivery type.
|
||||||
type OrderDelivery struct {
|
type OrderDelivery struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
IntegrationCode string `json:"integrationCode,omitempty"`
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
||||||
@ -346,21 +346,21 @@ type OrderDelivery struct {
|
|||||||
Data *OrderDeliveryData `json:"data,omitempty"`
|
Data *OrderDeliveryData `json:"data,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderDeliveryTime type
|
// OrderDeliveryTime type.
|
||||||
type OrderDeliveryTime struct {
|
type OrderDeliveryTime struct {
|
||||||
From string `json:"from,omitempty"`
|
From string `json:"from,omitempty"`
|
||||||
To string `json:"to,omitempty"`
|
To string `json:"to,omitempty"`
|
||||||
Custom string `json:"custom,omitempty"`
|
Custom string `json:"custom,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderDeliveryService type
|
// OrderDeliveryService type.
|
||||||
type OrderDeliveryService struct {
|
type OrderDeliveryService struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Active bool `json:"active,omitempty"`
|
Active bool `json:"active,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderDeliveryDataBasic type
|
// OrderDeliveryDataBasic type.
|
||||||
type OrderDeliveryDataBasic struct {
|
type OrderDeliveryDataBasic struct {
|
||||||
TrackNumber string `json:"trackNumber,omitempty"`
|
TrackNumber string `json:"trackNumber,omitempty"`
|
||||||
Status string `json:"status,omitempty"`
|
Status string `json:"status,omitempty"`
|
||||||
@ -368,13 +368,13 @@ type OrderDeliveryDataBasic struct {
|
|||||||
PayerType string `json:"payerType,omitempty"`
|
PayerType string `json:"payerType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderDeliveryData type
|
// OrderDeliveryData type.
|
||||||
type OrderDeliveryData struct {
|
type OrderDeliveryData struct {
|
||||||
OrderDeliveryDataBasic
|
OrderDeliveryDataBasic
|
||||||
AdditionalFields map[string]interface{}
|
AdditionalFields map[string]interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnmarshalJSON method
|
// UnmarshalJSON method.
|
||||||
func (v *OrderDeliveryData) UnmarshalJSON(b []byte) error {
|
func (v *OrderDeliveryData) UnmarshalJSON(b []byte) error {
|
||||||
var additionalData map[string]interface{}
|
var additionalData map[string]interface{}
|
||||||
json.Unmarshal(b, &additionalData)
|
json.Unmarshal(b, &additionalData)
|
||||||
@ -396,7 +396,7 @@ func (v *OrderDeliveryData) UnmarshalJSON(b []byte) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON method
|
// MarshalJSON method.
|
||||||
func (v OrderDeliveryData) MarshalJSON() ([]byte, error) {
|
func (v OrderDeliveryData) MarshalJSON() ([]byte, error) {
|
||||||
result := map[string]interface{}{}
|
result := map[string]interface{}{}
|
||||||
data, _ := json.Marshal(v.OrderDeliveryDataBasic)
|
data, _ := json.Marshal(v.OrderDeliveryDataBasic)
|
||||||
@ -409,13 +409,13 @@ func (v OrderDeliveryData) MarshalJSON() ([]byte, error) {
|
|||||||
return json.Marshal(result)
|
return json.Marshal(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderMarketplace type
|
// OrderMarketplace type.
|
||||||
type OrderMarketplace struct {
|
type OrderMarketplace struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
OrderID string `json:"orderId,omitempty"`
|
OrderID string `json:"orderId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderPayment type
|
// OrderPayment type.
|
||||||
type OrderPayment struct {
|
type OrderPayment struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -426,7 +426,7 @@ type OrderPayment struct {
|
|||||||
Comment string `json:"comment,omitempty"`
|
Comment string `json:"comment,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderItem type
|
// OrderItem type.
|
||||||
type OrderItem struct {
|
type OrderItem struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
InitialPrice float32 `json:"initialPrice,omitempty"`
|
InitialPrice float32 `json:"initialPrice,omitempty"`
|
||||||
@ -442,11 +442,11 @@ type OrderItem struct {
|
|||||||
Comment string `json:"comment,omitempty"`
|
Comment string `json:"comment,omitempty"`
|
||||||
IsCanceled bool `json:"isCanceled,omitempty"`
|
IsCanceled bool `json:"isCanceled,omitempty"`
|
||||||
Offer Offer `json:"offer,omitempty"`
|
Offer Offer `json:"offer,omitempty"`
|
||||||
Properties map[string]Property `json:"properties,omitempty,brackets"`
|
Properties map[string]Property `json:"properties,omitempty"`
|
||||||
PriceType *PriceType `json:"priceType,omitempty"`
|
PriceType *PriceType `json:"priceType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrdersHistoryRecord type
|
// OrdersHistoryRecord type.
|
||||||
type OrdersHistoryRecord struct {
|
type OrdersHistoryRecord struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
@ -454,12 +454,12 @@ type OrdersHistoryRecord struct {
|
|||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
Source string `json:"source,omitempty"`
|
Source string `json:"source,omitempty"`
|
||||||
Field string `json:"field,omitempty"`
|
Field string `json:"field,omitempty"`
|
||||||
User *User `json:"user,omitempty,brackets"`
|
User *User `json:"user,omitempty"`
|
||||||
APIKey *APIKey `json:"apiKey,omitempty,brackets"`
|
APIKey *APIKey `json:"apiKey,omitempty"`
|
||||||
Order *Order `json:"order,omitempty,brackets"`
|
Order *Order `json:"order,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pack type
|
// Pack type.
|
||||||
type Pack struct {
|
type Pack struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||||
@ -473,14 +473,14 @@ type Pack struct {
|
|||||||
Unit *Unit `json:"unit,omitempty"`
|
Unit *Unit `json:"unit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PackItem type
|
// PackItem type.
|
||||||
type PackItem struct {
|
type PackItem struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
Order *Order `json:"order,omitempty"`
|
Order *Order `json:"order,omitempty"`
|
||||||
Offer *Offer `json:"offer,omitempty"`
|
Offer *Offer `json:"offer,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PacksHistoryRecord type
|
// PacksHistoryRecord type.
|
||||||
type PacksHistoryRecord struct {
|
type PacksHistoryRecord struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
CreatedAt string `json:"createdAt,omitempty"`
|
CreatedAt string `json:"createdAt,omitempty"`
|
||||||
@ -488,11 +488,11 @@ type PacksHistoryRecord struct {
|
|||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
Source string `json:"source,omitempty"`
|
Source string `json:"source,omitempty"`
|
||||||
Field string `json:"field,omitempty"`
|
Field string `json:"field,omitempty"`
|
||||||
User *User `json:"user,omitempty,brackets"`
|
User *User `json:"user,omitempty"`
|
||||||
Pack *Pack `json:"pack,omitempty,brackets"`
|
Pack *Pack `json:"pack,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Offer type
|
// Offer type.
|
||||||
type Offer struct {
|
type Offer struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -507,21 +507,21 @@ type Offer struct {
|
|||||||
Width float32 `json:"width,omitempty"`
|
Width float32 `json:"width,omitempty"`
|
||||||
Length float32 `json:"length,omitempty"`
|
Length float32 `json:"length,omitempty"`
|
||||||
Weight float32 `json:"weight,omitempty"`
|
Weight float32 `json:"weight,omitempty"`
|
||||||
Stores []Inventory `json:"stores,omitempty,brackets"`
|
Stores []Inventory `json:"stores,omitempty"`
|
||||||
Properties map[string]string `json:"properties,omitempty,brackets"`
|
Properties map[string]string `json:"properties,omitempty"`
|
||||||
Prices []OfferPrice `json:"prices,omitempty,brackets"`
|
Prices []OfferPrice `json:"prices,omitempty"`
|
||||||
Images []string `json:"images,omitempty,brackets"`
|
Images []string `json:"images,omitempty"`
|
||||||
Unit *Unit `json:"unit,omitempty,brackets"`
|
Unit *Unit `json:"unit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inventory type
|
// Inventory type.
|
||||||
type Inventory struct {
|
type Inventory struct {
|
||||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||||
Quantity float32 `json:"quantity,omitempty"`
|
Quantity float32 `json:"quantity,omitempty"`
|
||||||
Store string `json:"store,omitempty"`
|
Store string `json:"store,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InventoryUpload type
|
// InventoryUpload type.
|
||||||
type InventoryUpload struct {
|
type InventoryUpload struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -529,21 +529,21 @@ type InventoryUpload struct {
|
|||||||
Stores []InventoryUploadStore `json:"stores,omitempty"`
|
Stores []InventoryUploadStore `json:"stores,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// InventoryUploadStore type
|
// InventoryUploadStore type.
|
||||||
type InventoryUploadStore struct {
|
type InventoryUploadStore struct {
|
||||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||||
Available float32 `json:"available,omitempty"`
|
Available float32 `json:"available,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OfferPrice type
|
// OfferPrice type.
|
||||||
type OfferPrice struct {
|
type OfferPrice struct {
|
||||||
Price float32 `json:"price,omitempty"`
|
Price float32 `json:"price,omitempty"`
|
||||||
Ordering int `json:"ordering,omitempty"`
|
Ordering int `json:"ordering,omitempty"`
|
||||||
PriceType string `json:"priceType,omitempty"`
|
PriceType string `json:"priceType,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OfferPriceUpload type
|
// OfferPriceUpload type.
|
||||||
type OfferPriceUpload struct {
|
type OfferPriceUpload struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -552,13 +552,13 @@ type OfferPriceUpload struct {
|
|||||||
Prices []PriceUpload `json:"prices,omitempty"`
|
Prices []PriceUpload `json:"prices,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PriceUpload type
|
// PriceUpload type.
|
||||||
type PriceUpload struct {
|
type PriceUpload struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Price float32 `json:"price,omitempty"`
|
Price float32 `json:"price,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unit type
|
// Unit type.
|
||||||
type Unit struct {
|
type Unit struct {
|
||||||
Code string `json:"code"`
|
Code string `json:"code"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@ -571,7 +571,7 @@ type Unit struct {
|
|||||||
User related types
|
User related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// User type
|
// User type.
|
||||||
type User struct {
|
type User struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
FirstName string `json:"firstName,omitempty"`
|
FirstName string `json:"firstName,omitempty"`
|
||||||
@ -585,30 +585,30 @@ type User struct {
|
|||||||
Email string `json:"email,omitempty"`
|
Email string `json:"email,omitempty"`
|
||||||
Phone string `json:"phone,omitempty"`
|
Phone string `json:"phone,omitempty"`
|
||||||
Status string `json:"status,omitempty"`
|
Status string `json:"status,omitempty"`
|
||||||
Groups []UserGroup `json:"groups,omitempty,brackets"`
|
Groups []UserGroup `json:"groups,omitempty"`
|
||||||
MgUserId uint64 `json:"mgUserId,omitempty"`
|
MgUserId uint64 `json:"mgUserId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserGroup type
|
// UserGroup type.
|
||||||
type UserGroup struct {
|
type UserGroup struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
SignatureTemplate string `json:"signatureTemplate,omitempty"`
|
SignatureTemplate string `json:"signatureTemplate,omitempty"`
|
||||||
IsManager bool `json:"isManager,omitempty"`
|
IsManager bool `json:"isManager,omitempty"`
|
||||||
IsDeliveryMen bool `json:"isDeliveryMen,omitempty"`
|
IsDeliveryMen bool `json:"isDeliveryMen,omitempty"`
|
||||||
DeliveryTypes []string `json:"deliveryTypes,omitempty,brackets"`
|
DeliveryTypes []string `json:"deliveryTypes,omitempty"`
|
||||||
BreakdownOrderTypes []string `json:"breakdownOrderTypes,omitempty,brackets"`
|
BreakdownOrderTypes []string `json:"breakdownOrderTypes,omitempty"`
|
||||||
BreakdownSites []string `json:"breakdownSites,omitempty,brackets"`
|
BreakdownSites []string `json:"breakdownSites,omitempty"`
|
||||||
BreakdownOrderMethods []string `json:"breakdownOrderMethods,omitempty,brackets"`
|
BreakdownOrderMethods []string `json:"breakdownOrderMethods,omitempty"`
|
||||||
GrantedOrderTypes []string `json:"grantedOrderTypes,omitempty,brackets"`
|
GrantedOrderTypes []string `json:"grantedOrderTypes,omitempty"`
|
||||||
GrantedSites []string `json:"grantedSites,omitempty,brackets"`
|
GrantedSites []string `json:"grantedSites,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Task related types
|
Task related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Task type
|
// Task type.
|
||||||
type Task struct {
|
type Task struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
PerformerID int `json:"performerId,omitempty"`
|
PerformerID int `json:"performerId,omitempty"`
|
||||||
@ -629,7 +629,7 @@ type Task struct {
|
|||||||
Notes related types
|
Notes related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Note type
|
// Note type.
|
||||||
type Note struct {
|
type Note struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ManagerID int `json:"managerId,omitempty"`
|
ManagerID int `json:"managerId,omitempty"`
|
||||||
@ -642,7 +642,7 @@ type Note struct {
|
|||||||
Payments related types
|
Payments related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Payment type
|
// Payment type.
|
||||||
type Payment struct {
|
type Payment struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ExternalID string `json:"externalId,omitempty"`
|
ExternalID string `json:"externalId,omitempty"`
|
||||||
@ -658,7 +658,7 @@ type Payment struct {
|
|||||||
Segment related types
|
Segment related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Segment type
|
// Segment type.
|
||||||
type Segment struct {
|
type Segment struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -690,7 +690,7 @@ type Settings struct {
|
|||||||
Reference related types
|
Reference related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// CostGroup type
|
// CostGroup type.
|
||||||
type CostGroup struct {
|
type CostGroup struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -699,7 +699,7 @@ type CostGroup struct {
|
|||||||
Ordering int `json:"ordering,omitempty"`
|
Ordering int `json:"ordering,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CostItem type
|
// CostItem type.
|
||||||
type CostItem struct {
|
type CostItem struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -712,7 +712,7 @@ type CostItem struct {
|
|||||||
Source *Source `json:"source,omitempty"`
|
Source *Source `json:"source,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Courier type
|
// Courier type.
|
||||||
type Courier struct {
|
type Courier struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
FirstName string `json:"firstName,omitempty"`
|
FirstName string `json:"firstName,omitempty"`
|
||||||
@ -724,14 +724,14 @@ type Courier struct {
|
|||||||
Phone *Phone `json:"phone,omitempty"`
|
Phone *Phone `json:"phone,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryService type
|
// DeliveryService type.
|
||||||
type DeliveryService struct {
|
type DeliveryService struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Active bool `json:"active,omitempty"`
|
Active bool `json:"active,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryType type
|
// DeliveryType type.
|
||||||
type DeliveryType struct {
|
type DeliveryType struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -746,7 +746,7 @@ type DeliveryType struct {
|
|||||||
PaymentTypes []string `json:"paymentTypes,omitempty"`
|
PaymentTypes []string `json:"paymentTypes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LegalEntity type
|
// LegalEntity type.
|
||||||
type LegalEntity struct {
|
type LegalEntity struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
VatRate string `json:"vatRate,omitempty"`
|
VatRate string `json:"vatRate,omitempty"`
|
||||||
@ -768,7 +768,7 @@ type LegalEntity struct {
|
|||||||
BankAccount string `json:"bankAccount,omitempty"`
|
BankAccount string `json:"bankAccount,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderMethod type
|
// OrderMethod type.
|
||||||
type OrderMethod struct {
|
type OrderMethod struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -777,7 +777,7 @@ type OrderMethod struct {
|
|||||||
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// OrderType type
|
// OrderType type.
|
||||||
type OrderType struct {
|
type OrderType struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -786,7 +786,7 @@ type OrderType struct {
|
|||||||
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaymentStatus type
|
// PaymentStatus type.
|
||||||
type PaymentStatus struct {
|
type PaymentStatus struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -796,10 +796,10 @@ type PaymentStatus struct {
|
|||||||
PaymentComplete bool `json:"paymentComplete,omitempty"`
|
PaymentComplete bool `json:"paymentComplete,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
Ordering int `json:"ordering,omitempty"`
|
Ordering int `json:"ordering,omitempty"`
|
||||||
PaymentTypes []string `json:"paymentTypes,omitempty,brackets"`
|
PaymentTypes []string `json:"paymentTypes,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PaymentType type
|
// PaymentType type.
|
||||||
type PaymentType struct {
|
type PaymentType struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -807,11 +807,11 @@ type PaymentType struct {
|
|||||||
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
DefaultForCRM bool `json:"defaultForCrm,omitempty"`
|
||||||
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
DefaultForAPI bool `json:"defaultForApi,omitempty"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
DeliveryTypes []string `json:"deliveryTypes,omitempty,brackets"`
|
DeliveryTypes []string `json:"deliveryTypes,omitempty"`
|
||||||
PaymentStatuses []string `json:"PaymentStatuses,omitempty,brackets"`
|
PaymentStatuses []string `json:"PaymentStatuses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PriceType type
|
// PriceType type.
|
||||||
type PriceType struct {
|
type PriceType struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -821,11 +821,11 @@ type PriceType struct {
|
|||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
FilterExpression string `json:"filterExpression,omitempty"`
|
FilterExpression string `json:"filterExpression,omitempty"`
|
||||||
Ordering int `json:"ordering,omitempty"`
|
Ordering int `json:"ordering,omitempty"`
|
||||||
Groups []string `json:"groups,omitempty,brackets"`
|
Groups []string `json:"groups,omitempty"`
|
||||||
Geo []GeoHierarchyRow `json:"geo,omitempty,brackets"`
|
Geo []GeoHierarchyRow `json:"geo,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductStatus type
|
// ProductStatus type.
|
||||||
type ProductStatus struct {
|
type ProductStatus struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -837,7 +837,7 @@ type ProductStatus struct {
|
|||||||
OrderStatusForProductStatus string `json:"orderStatusForProductStatus,omitempty"`
|
OrderStatusForProductStatus string `json:"orderStatusForProductStatus,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status type
|
// Status type.
|
||||||
type Status struct {
|
type Status struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -846,17 +846,17 @@ type Status struct {
|
|||||||
Group string `json:"group,omitempty"`
|
Group string `json:"group,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StatusGroup type
|
// StatusGroup type.
|
||||||
type StatusGroup struct {
|
type StatusGroup struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Active bool `json:"active,omitempty"`
|
Active bool `json:"active,omitempty"`
|
||||||
Ordering int `json:"ordering,omitempty"`
|
Ordering int `json:"ordering,omitempty"`
|
||||||
Process bool `json:"process,omitempty"`
|
Process bool `json:"process,omitempty"`
|
||||||
Statuses []string `json:"statuses,omitempty,brackets"`
|
Statuses []string `json:"statuses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Site type
|
// Site type.
|
||||||
type Site struct {
|
type Site struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -873,7 +873,7 @@ type Site struct {
|
|||||||
Contragent *LegalEntity `json:"contragent,omitempty"`
|
Contragent *LegalEntity `json:"contragent,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store type
|
// Store type.
|
||||||
type Store struct {
|
type Store struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -888,7 +888,7 @@ type Store struct {
|
|||||||
Address *Address `json:"address,omitempty"`
|
Address *Address `json:"address,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ProductGroup type
|
// ProductGroup type.
|
||||||
type ProductGroup struct {
|
type ProductGroup struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
ParentID int `json:"parentId,omitempty"`
|
ParentID int `json:"parentId,omitempty"`
|
||||||
@ -897,7 +897,7 @@ type ProductGroup struct {
|
|||||||
Active bool `json:"active,omitempty"`
|
Active bool `json:"active,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Product type
|
// Product type.
|
||||||
type Product struct {
|
type Product struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
MaxPrice float32 `json:"maxPrice,omitempty"`
|
MaxPrice float32 `json:"maxPrice,omitempty"`
|
||||||
@ -915,19 +915,19 @@ type Product struct {
|
|||||||
Recommended bool `json:"recommended,omitempty"`
|
Recommended bool `json:"recommended,omitempty"`
|
||||||
Active bool `json:"active,omitempty"`
|
Active bool `json:"active,omitempty"`
|
||||||
Quantity float32 `json:"quantity,omitempty"`
|
Quantity float32 `json:"quantity,omitempty"`
|
||||||
Offers []Offer `json:"offers,omitempty,brackets"`
|
Offers []Offer `json:"offers,omitempty"`
|
||||||
Groups []ProductGroup `json:"groups,omitempty,brackets"`
|
Groups []ProductGroup `json:"groups,omitempty"`
|
||||||
Properties map[string]string `json:"properties,omitempty,brackets"`
|
Properties map[string]string `json:"properties,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryHistoryRecord type
|
// DeliveryHistoryRecord type.
|
||||||
type DeliveryHistoryRecord struct {
|
type DeliveryHistoryRecord struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
UpdatedAt string `json:"updatedAt,omitempty"`
|
UpdatedAt string `json:"updatedAt,omitempty"`
|
||||||
Comment string `json:"comment,omitempty"`
|
Comment string `json:"comment,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryShipment type
|
// DeliveryShipment type.
|
||||||
type DeliveryShipment struct {
|
type DeliveryShipment struct {
|
||||||
IntegrationCode string `json:"integrationCode,omitempty"`
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
@ -940,11 +940,11 @@ type DeliveryShipment struct {
|
|||||||
Time *DeliveryTime `json:"time,omitempty"`
|
Time *DeliveryTime `json:"time,omitempty"`
|
||||||
LunchTime string `json:"lunchTime,omitempty"`
|
LunchTime string `json:"lunchTime,omitempty"`
|
||||||
Comment string `json:"comment,omitempty"`
|
Comment string `json:"comment,omitempty"`
|
||||||
Orders []Order `json:"orders,omitempty,brackets"`
|
Orders []Order `json:"orders,omitempty"`
|
||||||
ExtraData map[string]string `json:"extraData,omitempty,brackets"`
|
ExtraData map[string]string `json:"extraData,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// IntegrationModule type
|
// IntegrationModule type.
|
||||||
type IntegrationModule struct {
|
type IntegrationModule struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
IntegrationCode string `json:"integrationCode,omitempty"`
|
IntegrationCode string `json:"integrationCode,omitempty"`
|
||||||
@ -961,7 +961,7 @@ type IntegrationModule struct {
|
|||||||
Integrations *Integrations `json:"integrations,omitempty"`
|
Integrations *Integrations `json:"integrations,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Integrations type
|
// Integrations type.
|
||||||
type Integrations struct {
|
type Integrations struct {
|
||||||
Telephony *Telephony `json:"telephony,omitempty"`
|
Telephony *Telephony `json:"telephony,omitempty"`
|
||||||
Delivery *Delivery `json:"delivery,omitempty"`
|
Delivery *Delivery `json:"delivery,omitempty"`
|
||||||
@ -970,11 +970,11 @@ type Integrations struct {
|
|||||||
MgBot *MgBot `json:"mgBot,omitempty"`
|
MgBot *MgBot `json:"mgBot,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delivery type
|
// Delivery type.
|
||||||
type Delivery struct {
|
type Delivery struct {
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
Actions map[string]string `json:"actions,omitempty,brackets"`
|
Actions map[string]string `json:"actions,omitempty"`
|
||||||
PayerType []string `json:"payerType,omitempty,brackets"`
|
PayerType []string `json:"payerType,omitempty"`
|
||||||
PlatePrintLimit int `json:"platePrintLimit,omitempty"`
|
PlatePrintLimit int `json:"platePrintLimit,omitempty"`
|
||||||
RateDeliveryCost bool `json:"rateDeliveryCost,omitempty"`
|
RateDeliveryCost bool `json:"rateDeliveryCost,omitempty"`
|
||||||
AllowPackages bool `json:"allowPackages,omitempty"`
|
AllowPackages bool `json:"allowPackages,omitempty"`
|
||||||
@ -989,20 +989,20 @@ type Delivery struct {
|
|||||||
ShipmentDataFieldList []DeliveryDataField `json:"shipmentDataFieldList,omitempty"`
|
ShipmentDataFieldList []DeliveryDataField `json:"shipmentDataFieldList,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryStatus type
|
// DeliveryStatus type.
|
||||||
type DeliveryStatus struct {
|
type DeliveryStatus struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
IsEditable bool `json:"isEditable,omitempty"`
|
IsEditable bool `json:"isEditable,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plate type
|
// Plate type.
|
||||||
type Plate struct {
|
type Plate struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Label string `json:"label,omitempty"`
|
Label string `json:"label,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeliveryDataField type
|
// DeliveryDataField type.
|
||||||
type DeliveryDataField struct {
|
type DeliveryDataField struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Label string `json:"label,omitempty"`
|
Label string `json:"label,omitempty"`
|
||||||
@ -1015,7 +1015,7 @@ type DeliveryDataField struct {
|
|||||||
Editable bool `json:"editable,omitempty"`
|
Editable bool `json:"editable,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Telephony type
|
// Telephony type.
|
||||||
type Telephony struct {
|
type Telephony struct {
|
||||||
MakeCallURL string `json:"makeCallUrl,omitempty"`
|
MakeCallURL string `json:"makeCallUrl,omitempty"`
|
||||||
AllowEdit bool `json:"allowEdit,omitempty"`
|
AllowEdit bool `json:"allowEdit,omitempty"`
|
||||||
@ -1023,47 +1023,47 @@ type Telephony struct {
|
|||||||
OutputEventSupported bool `json:"outputEventSupported,omitempty"`
|
OutputEventSupported bool `json:"outputEventSupported,omitempty"`
|
||||||
HangupEventSupported bool `json:"hangupEventSupported,omitempty"`
|
HangupEventSupported bool `json:"hangupEventSupported,omitempty"`
|
||||||
ChangeUserStatusURL string `json:"changeUserStatusUrl,omitempty"`
|
ChangeUserStatusURL string `json:"changeUserStatusUrl,omitempty"`
|
||||||
AdditionalCodes []AdditionalCode `json:"additionalCodes,omitempty,brackets"`
|
AdditionalCodes []AdditionalCode `json:"additionalCodes,omitempty"`
|
||||||
ExternalPhones []ExternalPhone `json:"externalPhones,omitempty,brackets"`
|
ExternalPhones []ExternalPhone `json:"externalPhones,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdditionalCode type
|
// AdditionalCode type.
|
||||||
type AdditionalCode struct {
|
type AdditionalCode struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
UserID string `json:"userId,omitempty"`
|
UserID string `json:"userId,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExternalPhone type
|
// ExternalPhone type.
|
||||||
type ExternalPhone struct {
|
type ExternalPhone struct {
|
||||||
SiteCode string `json:"siteCode,omitempty"`
|
SiteCode string `json:"siteCode,omitempty"`
|
||||||
ExternalPhone string `json:"externalPhone,omitempty"`
|
ExternalPhone string `json:"externalPhone,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Warehouse type
|
// Warehouse type.
|
||||||
type Warehouse struct {
|
type Warehouse struct {
|
||||||
Actions []Action `json:"actions,omitempty,brackets"`
|
Actions []Action `json:"actions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action type
|
// Action type.
|
||||||
type Action struct {
|
type Action struct {
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
URL string `json:"url,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
CallPoints []string `json:"callPoints,omitempty"`
|
CallPoints []string `json:"callPoints,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MgTransport type
|
// MgTransport type.
|
||||||
type MgTransport struct {
|
type MgTransport struct {
|
||||||
WebhookUrl string `json:"webhookUrl,omitempty"`
|
WebhookUrl string `json:"webhookUrl,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MgBot type
|
// MgBot type.
|
||||||
type MgBot struct{}
|
type MgBot struct{}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Cost related types
|
Cost related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// CostRecord type
|
// CostRecord type.
|
||||||
type CostRecord struct {
|
type CostRecord struct {
|
||||||
Source *Source `json:"source,omitempty"`
|
Source *Source `json:"source,omitempty"`
|
||||||
Comment string `json:"comment,omitempty"`
|
Comment string `json:"comment,omitempty"`
|
||||||
@ -1073,10 +1073,10 @@ type CostRecord struct {
|
|||||||
CostItem string `json:"costItem,omitempty"`
|
CostItem string `json:"costItem,omitempty"`
|
||||||
UserId int `json:"userId,omitempty"`
|
UserId int `json:"userId,omitempty"`
|
||||||
Order *Order `json:"order,omitempty"`
|
Order *Order `json:"order,omitempty"`
|
||||||
Sites []string `json:"sites,omitempty,brackets"`
|
Sites []string `json:"sites,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cost type
|
// Cost type.
|
||||||
type Cost struct {
|
type Cost struct {
|
||||||
Source *Source `json:"source,omitempty"`
|
Source *Source `json:"source,omitempty"`
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
@ -1089,10 +1089,10 @@ type Cost struct {
|
|||||||
CreatedBy string `json:"createdBy,omitempty"`
|
CreatedBy string `json:"createdBy,omitempty"`
|
||||||
Order *Order `json:"order,omitempty"`
|
Order *Order `json:"order,omitempty"`
|
||||||
UserId int `json:"userId,omitempty"`
|
UserId int `json:"userId,omitempty"`
|
||||||
Sites []string `json:"sites,omitempty,brackets"`
|
Sites []string `json:"sites,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// File type
|
// File type.
|
||||||
type File struct {
|
type File struct {
|
||||||
ID int `json:"id,omitempty"`
|
ID int `json:"id,omitempty"`
|
||||||
Filename string `json:"filename,omitempty"`
|
Filename string `json:"filename,omitempty"`
|
||||||
@ -1102,13 +1102,13 @@ type File struct {
|
|||||||
Attachment []Attachment `json:"attachment,omitempty"`
|
Attachment []Attachment `json:"attachment,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attachment type
|
// Attachment type.
|
||||||
type Attachment struct {
|
type Attachment struct {
|
||||||
Customer *Customer `json:"customer,omitempty"`
|
Customer *Customer `json:"customer,omitempty"`
|
||||||
Order *Order `json:"order,omitempty"`
|
Order *Order `json:"order,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CustomFields type
|
// CustomFields type.
|
||||||
type CustomFields struct {
|
type CustomFields struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
@ -1129,27 +1129,27 @@ type CustomFields struct {
|
|||||||
CustomDictionaries related types
|
CustomDictionaries related types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// CustomDictionary type
|
// CustomDictionary type.
|
||||||
type CustomDictionary struct {
|
type CustomDictionary struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Elements []Element `json:"elements,omitempty,brackets"`
|
Elements []Element `json:"elements,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Element type
|
// Element type.
|
||||||
type Element struct {
|
type Element struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Code string `json:"code,omitempty"`
|
Code string `json:"code,omitempty"`
|
||||||
Ordering int `json:"ordering,omitempty"`
|
Ordering int `json:"ordering,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Activity struct
|
// Activity struct.
|
||||||
type Activity struct {
|
type Activity struct {
|
||||||
Active bool `json:"active"`
|
Active bool `json:"active"`
|
||||||
Freeze bool `json:"freeze"`
|
Freeze bool `json:"freeze"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tag struct
|
// Tag struct.
|
||||||
type Tag struct {
|
type Tag struct {
|
||||||
Name string `json:"name,omitempty"`
|
Name string `json:"name,omitempty"`
|
||||||
Color string `json:"color,omitempty"`
|
Color string `json:"color,omitempty"`
|
||||||
|
Loading…
Reference in New Issue
Block a user