Make fields optional in method params (#62)
This commit is contained in:
@@ -165,7 +165,7 @@ type GetStocksOnWarehousesParams struct {
|
|||||||
Offset int64 `json:"offset"`
|
Offset int64 `json:"offset"`
|
||||||
|
|
||||||
// Warehouse type filter:
|
// Warehouse type filter:
|
||||||
WarehouseType WarehouseType `json:"warehouse_type"`
|
WarehouseType WarehouseType `json:"warehouse_type" default:"ALL"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetStocksOnWarehousesResponse struct {
|
type GetStocksOnWarehousesResponse struct {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ type CancellationInfoState struct {
|
|||||||
|
|
||||||
// Method for getting information about a rFBS cancellation request
|
// Method for getting information about a rFBS cancellation request
|
||||||
func (c Cancellations) GetInfo(ctx context.Context, params *GetCancellationInfoParams) (*GetCancellationInfoResponse, error) {
|
func (c Cancellations) GetInfo(ctx context.Context, params *GetCancellationInfoParams) (*GetCancellationInfoResponse, error) {
|
||||||
url := "/v1/delivery-method/list"
|
url := "/v1/conditional-cancellation/get"
|
||||||
|
|
||||||
resp := &GetCancellationInfoResponse{}
|
resp := &GetCancellationInfoResponse{}
|
||||||
|
|
||||||
@@ -98,17 +98,17 @@ func (c Cancellations) GetInfo(ctx context.Context, params *GetCancellationInfoP
|
|||||||
|
|
||||||
type ListCancellationsParams struct {
|
type ListCancellationsParams struct {
|
||||||
// Filters
|
// Filters
|
||||||
Filter ListCancellationsFilter `json:"filter"`
|
Filter *ListCancellationsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Number of cancellation requests in the response
|
// Number of cancellation requests in the response
|
||||||
Limit int32 `json:"limit"`
|
Limit int32 `json:"limit,omitempty"`
|
||||||
|
|
||||||
// Number of elements that will be skipped in the response.
|
// Number of elements that will be skipped in the response.
|
||||||
// For example, if offset=10, the response will start with the 11th element found
|
// For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset int32 `json:"offset"`
|
Offset int32 `json:"offset,omitempty"`
|
||||||
|
|
||||||
// Additional information
|
// Additional information
|
||||||
With ListCancellationWith `json:"with"`
|
With *ListCancellationWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListCancellationsFilter struct {
|
type ListCancellationsFilter struct {
|
||||||
@@ -173,7 +173,7 @@ type ApproveRejectCancellationsParams struct {
|
|||||||
CancellationId int64 `json:"cancellation_id"`
|
CancellationId int64 `json:"cancellation_id"`
|
||||||
|
|
||||||
// Comment
|
// Comment
|
||||||
Comment string `json:"comment"`
|
Comment string `json:"comment,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApproveRejectCancellationsResponse struct {
|
type ApproveRejectCancellationsResponse struct {
|
||||||
|
|||||||
@@ -98,13 +98,13 @@ func TestListCancellations(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&ListCancellationsParams{
|
&ListCancellationsParams{
|
||||||
Filter: ListCancellationsFilter{
|
Filter: &ListCancellationsFilter{
|
||||||
CancellationInitiator: []string{"CLIENT"},
|
CancellationInitiator: []string{"CLIENT"},
|
||||||
State: "ALL",
|
State: "ALL",
|
||||||
},
|
},
|
||||||
Limit: 2,
|
Limit: 2,
|
||||||
Offset: 0,
|
Offset: 0,
|
||||||
With: ListCancellationWith{
|
With: &ListCancellationWith{
|
||||||
Counters: true,
|
Counters: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ type GetCategoryAttributesParams struct {
|
|||||||
DescriptionCategoryId int64 `json:"description_category_id"`
|
DescriptionCategoryId int64 `json:"description_category_id"`
|
||||||
|
|
||||||
// Response language
|
// Response language
|
||||||
Language Language `json:"language"`
|
Language Language `json:"language,omitempty"`
|
||||||
|
|
||||||
// Product type identifier
|
// Product type identifier
|
||||||
TypeId int64 `json:"type_id"`
|
TypeId int64 `json:"type_id"`
|
||||||
@@ -158,7 +158,7 @@ type GetAttributeDictionaryParams struct {
|
|||||||
DescriptionCategoryId int64 `json:"description_category_id"`
|
DescriptionCategoryId int64 `json:"description_category_id"`
|
||||||
|
|
||||||
// Response language
|
// Response language
|
||||||
Language Language `json:"language"`
|
Language Language `json:"language,omitempty"`
|
||||||
|
|
||||||
// Identifier of the directory to start the response with.
|
// Identifier of the directory to start the response with.
|
||||||
// If `last_value_id` is 10, the response will contain directories starting from the 11th
|
// If `last_value_id` is 10, the response will contain directories starting from the 11th
|
||||||
@@ -168,7 +168,7 @@ type GetAttributeDictionaryParams struct {
|
|||||||
//
|
//
|
||||||
// - maximum—5000,
|
// - maximum—5000,
|
||||||
// - minimum—1.
|
// - minimum—1.
|
||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit,omitempty"`
|
||||||
|
|
||||||
// Product type identifier
|
// Product type identifier
|
||||||
TypeId int64 `json:"type_id"`
|
TypeId int64 `json:"type_id"`
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ type ListOfCertifiedCategoriesResultCert struct {
|
|||||||
|
|
||||||
// List of certified categories
|
// List of certified categories
|
||||||
func (c Certificates) ListOfCertifiedCategories(ctx context.Context, params *ListOfCertifiedCategoriesParams) (*ListOfCertifiedCategoriesResponse, error) {
|
func (c Certificates) ListOfCertifiedCategories(ctx context.Context, params *ListOfCertifiedCategoriesParams) (*ListOfCertifiedCategoriesResponse, error) {
|
||||||
url := "/v1/product/certificate/types"
|
url := "/v1/product/certification/list"
|
||||||
|
|
||||||
resp := &ListOfCertifiedCategoriesResponse{}
|
resp := &ListOfCertifiedCategoriesResponse{}
|
||||||
|
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ type Chats struct {
|
|||||||
|
|
||||||
type ListChatsParams struct {
|
type ListChatsParams struct {
|
||||||
// Chats filter
|
// Chats filter
|
||||||
Filter ListChatsFilter `json:"filter"`
|
Filter *ListChatsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Number of values in the response. The default value is 30. The maximum value is 1000
|
// Number of values in the response. The default value is 30. The maximum value is 1000
|
||||||
Limit int64 `json:"limit" default:"30"`
|
Limit int64 `json:"limit" default:"30"`
|
||||||
|
|
||||||
// Number of elements that will be skipped in the response.
|
// Number of elements that will be skipped in the response.
|
||||||
// For example, if offset=10, the response will start with the 11th element found
|
// For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset int64 `json:"offset"`
|
Offset int64 `json:"offset,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListChatsFilter struct {
|
type ListChatsFilter struct {
|
||||||
@@ -240,7 +240,7 @@ type UpdateChatParams struct {
|
|||||||
FromMessageId uint64 `json:"from_message_id"`
|
FromMessageId uint64 `json:"from_message_id"`
|
||||||
|
|
||||||
// Number of messages in the response
|
// Number of messages in the response
|
||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateChatResponse struct {
|
type UpdateChatResponse struct {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func TestListChats(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&ListChatsParams{
|
&ListChatsParams{
|
||||||
Filter: ListChatsFilter{
|
Filter: &ListChatsFilter{
|
||||||
ChatStatus: "Opened",
|
ChatStatus: "Opened",
|
||||||
UnreadOnly: true,
|
UnreadOnly: true,
|
||||||
},
|
},
|
||||||
|
|||||||
12
ozon/fbo.go
12
ozon/fbo.go
@@ -14,7 +14,7 @@ type FBO struct {
|
|||||||
|
|
||||||
type GetFBOShipmentsListParams struct {
|
type GetFBOShipmentsListParams struct {
|
||||||
// Sorting direction
|
// Sorting direction
|
||||||
Direction string `json:"dir"`
|
Direction string `json:"dir,omitempty"`
|
||||||
|
|
||||||
// Shipment search filter
|
// Shipment search filter
|
||||||
Filter GetFBOShipmentsListFilter `json:"filter"`
|
Filter GetFBOShipmentsListFilter `json:"filter"`
|
||||||
@@ -23,13 +23,13 @@ type GetFBOShipmentsListParams struct {
|
|||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
|
|
||||||
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset int64 `json:"offset"`
|
Offset int64 `json:"offset,omitempty"`
|
||||||
|
|
||||||
// true if the address transliteration from Cyrillic to Latin is enabled
|
// true if the address transliteration from Cyrillic to Latin is enabled
|
||||||
Translit bool `json:"translit"`
|
Translit bool `json:"translit,omitempty"`
|
||||||
|
|
||||||
// Additional fields to add to the response
|
// Additional fields to add to the response
|
||||||
With GetFBOShipmentsListWith `json:"with"`
|
With *GetFBOShipmentsListWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shipment search filter
|
// Shipment search filter
|
||||||
@@ -185,10 +185,10 @@ type GetShipmentDetailsParams struct {
|
|||||||
PostingNumber string `json:"posting_number"`
|
PostingNumber string `json:"posting_number"`
|
||||||
|
|
||||||
// true if the address transliteration from Cyrillic to Latin is enabled
|
// true if the address transliteration from Cyrillic to Latin is enabled
|
||||||
Translit bool `json:"translit"`
|
Translit bool `json:"translit,omitempty"`
|
||||||
|
|
||||||
// Additional fields to add to the response
|
// Additional fields to add to the response
|
||||||
With GetShipmentDetailsWith `json:"with"`
|
With *GetShipmentDetailsWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetShipmentDetailsWith struct {
|
type GetShipmentDetailsWith struct {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ func TestGetFBOShipmentsList(t *testing.T) {
|
|||||||
Limit: 5,
|
Limit: 5,
|
||||||
Offset: 0,
|
Offset: 0,
|
||||||
Translit: true,
|
Translit: true,
|
||||||
With: GetFBOShipmentsListWith{
|
With: &GetFBOShipmentsListWith{
|
||||||
AnalyticsData: true,
|
AnalyticsData: true,
|
||||||
FinancialData: true,
|
FinancialData: true,
|
||||||
},
|
},
|
||||||
@@ -165,7 +165,7 @@ func TestGetShipmentDetails(t *testing.T) {
|
|||||||
&GetShipmentDetailsParams{
|
&GetShipmentDetailsParams{
|
||||||
PostingNumber: "50520644-0012-7",
|
PostingNumber: "50520644-0012-7",
|
||||||
Translit: true,
|
Translit: true,
|
||||||
With: GetShipmentDetailsWith{
|
With: &GetShipmentDetailsWith{
|
||||||
AnalyticsData: true,
|
AnalyticsData: true,
|
||||||
FinancialData: true,
|
FinancialData: true,
|
||||||
},
|
},
|
||||||
|
|||||||
18
ozon/fbs.go
18
ozon/fbs.go
@@ -14,7 +14,7 @@ type FBS struct {
|
|||||||
|
|
||||||
type ListUnprocessedShipmentsParams struct {
|
type ListUnprocessedShipmentsParams struct {
|
||||||
// Sorting direction
|
// Sorting direction
|
||||||
Direction Order `json:"dir"`
|
Direction Order `json:"dir,omitempty"`
|
||||||
|
|
||||||
// Request filter
|
// Request filter
|
||||||
Filter ListUnprocessedShipmentsFilter `json:"filter"`
|
Filter ListUnprocessedShipmentsFilter `json:"filter"`
|
||||||
@@ -27,10 +27,10 @@ type ListUnprocessedShipmentsParams struct {
|
|||||||
|
|
||||||
// Number of elements that will be skipped in the response.
|
// Number of elements that will be skipped in the response.
|
||||||
// For example, if `offset` = 10, the response will start with the 11th element found
|
// For example, if `offset` = 10, the response will start with the 11th element found
|
||||||
Offset int64 `json:"offset"`
|
Offset int64 `json:"offset,omitempty"`
|
||||||
|
|
||||||
// Additional fields that should be added to the response
|
// Additional fields that should be added to the response
|
||||||
With ListUnprocessedShipmentsWith `json:"with"`
|
With *ListUnprocessedShipmentsWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ListUnprocessedShipmentsFilter struct {
|
type ListUnprocessedShipmentsFilter struct {
|
||||||
@@ -511,9 +511,9 @@ func (c FBS) ListUnprocessedShipments(ctx context.Context, params *ListUnprocess
|
|||||||
|
|
||||||
type GetFBSShipmentsListParams struct {
|
type GetFBSShipmentsListParams struct {
|
||||||
// Sorting direction
|
// Sorting direction
|
||||||
Direction string `json:"direction"`
|
Direction string `json:"dir,omitempty"`
|
||||||
|
|
||||||
//Filter
|
// Filter
|
||||||
Filter GetFBSShipmentsListFilter `json:"filter"`
|
Filter GetFBSShipmentsListFilter `json:"filter"`
|
||||||
|
|
||||||
// Number of shipments in the response:
|
// Number of shipments in the response:
|
||||||
@@ -522,10 +522,10 @@ type GetFBSShipmentsListParams struct {
|
|||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
|
|
||||||
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset int64 `json:"offset"`
|
Offset int64 `json:"offset,omitempty"`
|
||||||
|
|
||||||
// Additional fields that should be added to the response
|
// Additional fields that should be added to the response
|
||||||
With GetFBSShipmentsListWith `json:"with"`
|
With *GetFBSShipmentsListWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetFBSShipmentsListFilter struct {
|
type GetFBSShipmentsListFilter struct {
|
||||||
@@ -625,7 +625,7 @@ type PackOrderParams struct {
|
|||||||
PostingNumber string `json:"posting_number"`
|
PostingNumber string `json:"posting_number"`
|
||||||
|
|
||||||
// Additional information
|
// Additional information
|
||||||
With PackOrderWith `json:"with"`
|
With *PackOrderWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PackOrderPackage struct {
|
type PackOrderPackage struct {
|
||||||
@@ -865,7 +865,7 @@ type GetShipmentDataByIdentifierParams struct {
|
|||||||
PostingNumber string `json:"posting_number"`
|
PostingNumber string `json:"posting_number"`
|
||||||
|
|
||||||
// Additional fields that should be added to the response
|
// Additional fields that should be added to the response
|
||||||
With GetShipmentDataByIdentifierWith `json:"with"`
|
With *GetShipmentDataByIdentifierWith `json:"with,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetShipmentDataByIdentifierWith struct {
|
type GetShipmentDataByIdentifierWith struct {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ func TestListUnprocessedShipments(t *testing.T) {
|
|||||||
Status: "awaiting_packaging",
|
Status: "awaiting_packaging",
|
||||||
},
|
},
|
||||||
Limit: 100,
|
Limit: 100,
|
||||||
With: ListUnprocessedShipmentsWith{
|
With: &ListUnprocessedShipmentsWith{
|
||||||
AnalyticsData: true,
|
AnalyticsData: true,
|
||||||
Barcodes: true,
|
Barcodes: true,
|
||||||
FinancialData: true,
|
FinancialData: true,
|
||||||
@@ -210,7 +210,7 @@ func TestGetFBSShipmentsList(t *testing.T) {
|
|||||||
},
|
},
|
||||||
Limit: 0,
|
Limit: 0,
|
||||||
Offset: 0,
|
Offset: 0,
|
||||||
With: GetFBSShipmentsListWith{
|
With: &GetFBSShipmentsListWith{
|
||||||
AnalyticsData: true,
|
AnalyticsData: true,
|
||||||
FinancialData: true,
|
FinancialData: true,
|
||||||
Translit: true,
|
Translit: true,
|
||||||
@@ -330,7 +330,7 @@ func TestPackOrder(t *testing.T) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
PostingNumber: "89491381-0072-1",
|
PostingNumber: "89491381-0072-1",
|
||||||
With: PackOrderWith{
|
With: &PackOrderWith{
|
||||||
AdditionalData: true,
|
AdditionalData: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -556,7 +556,7 @@ func TestGetShipmentDataByIdentifier(t *testing.T) {
|
|||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&GetShipmentDataByIdentifierParams{
|
&GetShipmentDataByIdentifierParams{
|
||||||
PostingNumber: "57195475-0050-3",
|
PostingNumber: "57195475-0050-3",
|
||||||
With: GetShipmentDataByIdentifierWith{},
|
With: &GetShipmentDataByIdentifierWith{},
|
||||||
},
|
},
|
||||||
`{
|
`{
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||
@@ -1356,10 +1356,10 @@ type GetDescriptionOfProductParams struct {
|
|||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
|
|
||||||
// The parameter by which the products will be sorted
|
// The parameter by which the products will be sorted
|
||||||
SortBy string `json:"sort_by"`
|
SortBy string `json:"sort_by,omitempty"`
|
||||||
|
|
||||||
// Sorting direction
|
// Sorting direction
|
||||||
SortDirection string `json:"sort_direction"`
|
SortDirection string `json:"sort_dir,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetDescriptionOfProductFilter struct {
|
type GetDescriptionOfProductFilter struct {
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ type ProductsAvailableForPromotionParams struct {
|
|||||||
|
|
||||||
// Number of elements that will be skipped in the response.
|
// Number of elements that will be skipped in the response.
|
||||||
// For example, if offset=10, the response will start with the 11th element found
|
// For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset float64 `json:"offset"`
|
Offset float64 `json:"offset,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProductsAvailableForPromotionResponse struct {
|
type ProductsAvailableForPromotionResponse struct {
|
||||||
@@ -218,7 +218,7 @@ type ProductsInPromotionParams struct {
|
|||||||
Limit float64 `json:"limit"`
|
Limit float64 `json:"limit"`
|
||||||
|
|
||||||
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset float64 `json:"offset"`
|
Offset float64 `json:"offset,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProductsInPromotionResponse struct {
|
type ProductsInPromotionResponse struct {
|
||||||
@@ -355,7 +355,7 @@ type ProductsAvailableForHotSalePromotionParams struct {
|
|||||||
Limit float64 `json:"limit"`
|
Limit float64 `json:"limit"`
|
||||||
|
|
||||||
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
// Number of elements that will be skipped in the response. For example, if offset=10, the response will start with the 11th element found
|
||||||
Offset float64 `json:"offset"`
|
Offset float64 `json:"offset,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProductsAvailableForHotSalePromotionResponse struct {
|
type ProductsAvailableForHotSalePromotionResponse struct {
|
||||||
|
|||||||
@@ -450,7 +450,7 @@ func (c Reports) GetProducts(ctx context.Context, params *GetProductsReportParam
|
|||||||
|
|
||||||
type GetReturnsReportParams struct {
|
type GetReturnsReportParams struct {
|
||||||
// Filter
|
// Filter
|
||||||
Filter GetReturnsReportsFilter `json:"filter"`
|
Filter *GetReturnsReportsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Default: "DEFAULT"
|
// Default: "DEFAULT"
|
||||||
// Response language:
|
// Response language:
|
||||||
@@ -501,7 +501,7 @@ func (c Reports) GetReturns(ctx context.Context, params *GetReturnsReportParams)
|
|||||||
|
|
||||||
type GetShipmentReportParams struct {
|
type GetShipmentReportParams struct {
|
||||||
// Filter
|
// Filter
|
||||||
Filter GetShipmentReportFilter `json:"filter"`
|
Filter *GetShipmentReportFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Default: "DEFAULT"
|
// Default: "DEFAULT"
|
||||||
// Response language:
|
// Response language:
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ func TestGetReturnsReport(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&GetReturnsReportParams{
|
&GetReturnsReportParams{
|
||||||
Filter: GetReturnsReportsFilter{
|
Filter: &GetReturnsReportsFilter{
|
||||||
DeliverySchema: "fbs",
|
DeliverySchema: "fbs",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -435,7 +435,7 @@ func TestGetShipmentReport(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&GetShipmentReportParams{
|
&GetShipmentReportParams{
|
||||||
Filter: GetShipmentReportFilter{
|
Filter: &GetShipmentReportFilter{
|
||||||
DeliverySchema: []string{"fbs", "fbo", "crossborder"},
|
DeliverySchema: []string{"fbs", "fbo", "crossborder"},
|
||||||
ProcessedAtFrom: core.TimeFromString(t, "2006-01-02T15:04:05Z", "2021-09-02T17:10:54.861Z"),
|
ProcessedAtFrom: core.TimeFromString(t, "2006-01-02T15:04:05Z", "2021-09-02T17:10:54.861Z"),
|
||||||
ProcessedAtTo: core.TimeFromString(t, "2006-01-02T15:04:05Z", "2021-11-02T17:10:54.861Z"),
|
ProcessedAtTo: core.TimeFromString(t, "2006-01-02T15:04:05Z", "2021-11-02T17:10:54.861Z"),
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ type Returns struct {
|
|||||||
|
|
||||||
type GetFBOReturnsParams struct {
|
type GetFBOReturnsParams struct {
|
||||||
// Filter
|
// Filter
|
||||||
Filter GetFBOReturnsFilter `json:"filter"`
|
Filter *GetFBOReturnsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Identifier of the last value on the page. Leave this field blank in the first request.
|
// Identifier of the last value on the page. Leave this field blank in the first request.
|
||||||
//
|
//
|
||||||
@@ -95,7 +95,7 @@ func (c Returns) GetFBOReturns(ctx context.Context, params *GetFBOReturnsParams)
|
|||||||
|
|
||||||
type GetFBSReturnsParams struct {
|
type GetFBSReturnsParams struct {
|
||||||
// Filter
|
// Filter
|
||||||
Filter GetFBSReturnsFilter `json:"filter"`
|
Filter *GetFBSReturnsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Number of values in the response:
|
// Number of values in the response:
|
||||||
// - maximum — 1000,
|
// - maximum — 1000,
|
||||||
@@ -264,7 +264,7 @@ func (c Returns) GetFBSReturns(ctx context.Context, params *GetFBSReturnsParams)
|
|||||||
|
|
||||||
type GetRFBSReturnsParams struct {
|
type GetRFBSReturnsParams struct {
|
||||||
// Filter
|
// Filter
|
||||||
Filter GetRFBSReturnsFilter `json:"filter"`
|
Filter *GetRFBSReturnsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Identifier of the last value on the page.
|
// Identifier of the last value on the page.
|
||||||
// Leave this field blank in the first request
|
// Leave this field blank in the first request
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ func TestGetFBOReturns(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&GetFBOReturnsParams{
|
&GetFBOReturnsParams{
|
||||||
Filter: GetFBOReturnsFilter{
|
Filter: &GetFBOReturnsFilter{
|
||||||
PostingNumber: "some number",
|
PostingNumber: "some number",
|
||||||
},
|
},
|
||||||
LastId: 123,
|
LastId: 123,
|
||||||
@@ -105,7 +105,7 @@ func TestGetFBSReturns(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&GetFBSReturnsParams{
|
&GetFBSReturnsParams{
|
||||||
Filter: GetFBSReturnsFilter{
|
Filter: &GetFBSReturnsFilter{
|
||||||
PostingNumber: []string{"07402477-0022-2"},
|
PostingNumber: []string{"07402477-0022-2"},
|
||||||
Status: "returned_to_seller",
|
Status: "returned_to_seller",
|
||||||
},
|
},
|
||||||
@@ -212,7 +212,7 @@ func TestGetRFBSReturns(t *testing.T) {
|
|||||||
&GetRFBSReturnsParams{
|
&GetRFBSReturnsParams{
|
||||||
LastId: 999,
|
LastId: 999,
|
||||||
Limit: 555,
|
Limit: 555,
|
||||||
Filter: GetRFBSReturnsFilter{
|
Filter: &GetRFBSReturnsFilter{
|
||||||
OfferId: "123",
|
OfferId: "123",
|
||||||
PostingNumber: "111",
|
PostingNumber: "111",
|
||||||
GroupState: []RFBSReturnsGroupState{RFBSReturnsGroupStateAll},
|
GroupState: []RFBSReturnsGroupState{RFBSReturnsGroupStateAll},
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ func (c Warehouses) GetListOfWarehouses(ctx context.Context) (*GetListOfWarehous
|
|||||||
|
|
||||||
type GetListOfDeliveryMethodsParams struct {
|
type GetListOfDeliveryMethodsParams struct {
|
||||||
// Search filter for delivery methods
|
// Search filter for delivery methods
|
||||||
Filter GetListOfDeliveryMethodsFilter `json:"filter"`
|
Filter *GetListOfDeliveryMethodsFilter `json:"filter,omitempty"`
|
||||||
|
|
||||||
// Number of items in a response. Maximum is 50, minimum is 1
|
// Number of items in a response. Maximum is 50, minimum is 1
|
||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ func TestGetListOfDeliveryMethods(t *testing.T) {
|
|||||||
http.StatusOK,
|
http.StatusOK,
|
||||||
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
map[string]string{"Client-Id": "my-client-id", "Api-Key": "my-api-key"},
|
||||||
&GetListOfDeliveryMethodsParams{
|
&GetListOfDeliveryMethodsParams{
|
||||||
Filter: GetListOfDeliveryMethodsFilter{
|
Filter: &GetListOfDeliveryMethodsFilter{
|
||||||
WarehouseId: 15588127982000,
|
WarehouseId: 15588127982000,
|
||||||
},
|
},
|
||||||
Limit: 100,
|
Limit: 100,
|
||||||
|
|||||||
Reference in New Issue
Block a user