Update December 25, 2023 (#57)
This commit is contained in:
@@ -25,7 +25,7 @@ type GetProductTreeResponse struct {
|
|||||||
|
|
||||||
type GetProductTreeResult struct {
|
type GetProductTreeResult struct {
|
||||||
// Category identifier
|
// Category identifier
|
||||||
CategoryId int64 `json:"category_id"`
|
DescriptionCategoryId int64 `json:"description_category_id"`
|
||||||
|
|
||||||
// Category name
|
// Category name
|
||||||
CategoryName string `json:"category_name"`
|
CategoryName string `json:"category_name"`
|
||||||
@@ -64,7 +64,7 @@ func (c *Categories) Tree(ctx context.Context, params *GetProductTreeParams) (*G
|
|||||||
|
|
||||||
type GetCategoryAttributesParams struct {
|
type GetCategoryAttributesParams struct {
|
||||||
// Category identifier
|
// Category identifier
|
||||||
CategoryId int64 `json:"category_id"`
|
DescriptionCategoryId int64 `json:"description_category_id"`
|
||||||
|
|
||||||
// Response language
|
// Response language
|
||||||
Language Language `json:"language"`
|
Language Language `json:"language"`
|
||||||
@@ -123,6 +123,12 @@ type GetCategoryAttributesResult struct {
|
|||||||
|
|
||||||
// Characteristic type
|
// Characteristic type
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
|
|
||||||
|
// Complex attribute identifier
|
||||||
|
AttributeComplexId int64 `json:"attribute_complex_id"`
|
||||||
|
|
||||||
|
// Maximum number of values for attribute
|
||||||
|
MaxValueCount int64 `json:"max_value_count"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Getting characteristics for specified product category and type.
|
// Getting characteristics for specified product category and type.
|
||||||
@@ -149,7 +155,7 @@ type GetAttributeDictionaryParams struct {
|
|||||||
AttributeId int64 `json:"attribute_id"`
|
AttributeId int64 `json:"attribute_id"`
|
||||||
|
|
||||||
// Category identifier
|
// Category identifier
|
||||||
CategoryId int64 `json:"category_id"`
|
DescriptionCategoryId int64 `json:"description_category_id"`
|
||||||
|
|
||||||
// Response language
|
// Response language
|
||||||
Language Language `json:"language"`
|
Language Language `json:"language"`
|
||||||
@@ -200,7 +206,7 @@ type GetAttributeDictionaryResult struct {
|
|||||||
// To check if an attribute has a nested directory,
|
// To check if an attribute has a nested directory,
|
||||||
// use the `/v1/description-category/attribute` method.
|
// use the `/v1/description-category/attribute` method.
|
||||||
func (c *Categories) AttributesDictionary(ctx context.Context, params *GetAttributeDictionaryParams) (*GetAttributeDictionaryResponse, error) {
|
func (c *Categories) AttributesDictionary(ctx context.Context, params *GetAttributeDictionaryParams) (*GetAttributeDictionaryResponse, error) {
|
||||||
url := "/v1/description-category/attribute"
|
url := "/v1/description-category/attribute/values"
|
||||||
|
|
||||||
resp := &GetAttributeDictionaryResponse{}
|
resp := &GetAttributeDictionaryResponse{}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ func TestGetProductTree(t *testing.T) {
|
|||||||
`{
|
`{
|
||||||
"result": [
|
"result": [
|
||||||
{
|
{
|
||||||
"category_id": 0,
|
"description_category_id": 0,
|
||||||
"category_name": "string",
|
"category_name": "string",
|
||||||
"children": [],
|
"children": [],
|
||||||
"disabled": true,
|
"disabled": true,
|
||||||
@@ -81,9 +81,9 @@ func TestGetCategoryAttributes(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"},
|
||||||
&GetCategoryAttributesParams{
|
&GetCategoryAttributesParams{
|
||||||
CategoryId: 12345,
|
DescriptionCategoryId: 12345,
|
||||||
Language: English,
|
Language: English,
|
||||||
TypeId: 2,
|
TypeId: 2,
|
||||||
},
|
},
|
||||||
`{
|
`{
|
||||||
"result": [
|
"result": [
|
||||||
@@ -97,7 +97,9 @@ func TestGetCategoryAttributes(t *testing.T) {
|
|||||||
"is_collection": true,
|
"is_collection": true,
|
||||||
"is_required": true,
|
"is_required": true,
|
||||||
"name": "string",
|
"name": "string",
|
||||||
"type": "string"
|
"type": "string",
|
||||||
|
"attribute_complex_id": 0,
|
||||||
|
"max_value_count": 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}`,
|
}`,
|
||||||
@@ -146,12 +148,12 @@ func TestGetAttributeDictionary(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"},
|
||||||
&GetAttributeDictionaryParams{
|
&GetAttributeDictionaryParams{
|
||||||
AttributeId: 123456,
|
AttributeId: 123456,
|
||||||
CategoryId: 12,
|
DescriptionCategoryId: 12,
|
||||||
Language: English,
|
Language: English,
|
||||||
LastValueId: 1,
|
LastValueId: 1,
|
||||||
Limit: 5,
|
Limit: 5,
|
||||||
TypeId: 6,
|
TypeId: 6,
|
||||||
},
|
},
|
||||||
`{
|
`{
|
||||||
"has_next": true,
|
"has_next": true,
|
||||||
|
|||||||
@@ -130,6 +130,9 @@ type ProductDetails struct {
|
|||||||
// Category identifier
|
// Category identifier
|
||||||
DescriptionCategoryId int64 `json:"description_category_id"`
|
DescriptionCategoryId int64 `json:"description_category_id"`
|
||||||
|
|
||||||
|
// Product type identifier
|
||||||
|
TypeId int64 `json:"type_id"`
|
||||||
|
|
||||||
// Marketing color
|
// Marketing color
|
||||||
ColorImage string `json:"color_image"`
|
ColorImage string `json:"color_image"`
|
||||||
|
|
||||||
@@ -888,7 +891,7 @@ type CreateOrUpdateProductResult struct {
|
|||||||
|
|
||||||
// This method allows you to create products and update their details
|
// This method allows you to create products and update their details
|
||||||
func (c Products) CreateOrUpdateProduct(ctx context.Context, params *CreateOrUpdateProductParams) (*CreateOrUpdateProductResponse, error) {
|
func (c Products) CreateOrUpdateProduct(ctx context.Context, params *CreateOrUpdateProductParams) (*CreateOrUpdateProductResponse, error) {
|
||||||
url := "/v2/product/import"
|
url := "/v3/product/import"
|
||||||
|
|
||||||
resp := &CreateOrUpdateProductResponse{}
|
resp := &CreateOrUpdateProductResponse{}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ func TestGetProductDetails(t *testing.T) {
|
|||||||
"7533900005"
|
"7533900005"
|
||||||
],
|
],
|
||||||
"buybox_price": "",
|
"buybox_price": "",
|
||||||
"description_category_id": 17038062,
|
"type_id": 0,
|
||||||
"created_at": "2021-10-21T15:48:03.529178Z",
|
"created_at": "2021-10-21T15:48:03.529178Z",
|
||||||
"images": [
|
"images": [
|
||||||
"https://cdn1.ozone.ru/s3/multimedia-5/6088931525.jpg",
|
"https://cdn1.ozone.ru/s3/multimedia-5/6088931525.jpg",
|
||||||
@@ -141,6 +141,7 @@ func TestGetProductDetails(t *testing.T) {
|
|||||||
"reserved": 0
|
"reserved": 0
|
||||||
},
|
},
|
||||||
"currency_code": "RUB",
|
"currency_code": "RUB",
|
||||||
|
"description_category_id": 12,
|
||||||
"marketing_price": "",
|
"marketing_price": "",
|
||||||
"min_price": "",
|
"min_price": "",
|
||||||
"old_price": "",
|
"old_price": "",
|
||||||
@@ -1378,6 +1379,7 @@ func TestListProductsByIDs(t *testing.T) {
|
|||||||
],
|
],
|
||||||
"buybox_price": "",
|
"buybox_price": "",
|
||||||
"description_category_id": 93726157,
|
"description_category_id": 93726157,
|
||||||
|
"type_id": 0,
|
||||||
"created_at": "2021-06-03T03:40:05.871465Z",
|
"created_at": "2021-06-03T03:40:05.871465Z",
|
||||||
"images": [],
|
"images": [],
|
||||||
"has_discounted_item": true,
|
"has_discounted_item": true,
|
||||||
@@ -1420,7 +1422,24 @@ func TestListProductsByIDs(t *testing.T) {
|
|||||||
"active_product": false,
|
"active_product": false,
|
||||||
"reasons": {}
|
"reasons": {}
|
||||||
},
|
},
|
||||||
"price_index": "0.00",
|
"price_indexes": {
|
||||||
|
"external_index_data": {
|
||||||
|
"minimal_price": "string",
|
||||||
|
"minimal_price_currency": "string",
|
||||||
|
"price_index_value": 0
|
||||||
|
},
|
||||||
|
"ozon_index_data": {
|
||||||
|
"minimal_price": "string",
|
||||||
|
"minimal_price_currency": "string",
|
||||||
|
"price_index_value": 0
|
||||||
|
},
|
||||||
|
"price_index": "WITHOUT_INDEX",
|
||||||
|
"self_marketplaces_index_data": {
|
||||||
|
"minimal_price": "string",
|
||||||
|
"minimal_price_currency": "string",
|
||||||
|
"price_index_value": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
"images360": [],
|
"images360": [],
|
||||||
"is_kgt": false,
|
"is_kgt": false,
|
||||||
"color_image": "",
|
"color_image": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user