From 32bd7748ecac1ef2f45cbc3fded860f85791acd7 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 10 Jan 2025 17:51:16 +0300 Subject: [PATCH] Update December 6, 2024 (#126) --- ozon/certificates.go | 16 ++++++++++------ ozon/certificates_test.go | 19 ++++++++++--------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ozon/certificates.go b/ozon/certificates.go index ea959e2..d96d209 100644 --- a/ozon/certificates.go +++ b/ozon/certificates.go @@ -99,11 +99,6 @@ type ListOfCertifiedCategoriesParams struct { type ListOfCertifiedCategoriesResponse struct { core.CommonResponse - // Method result - Result ListOfCertifiedCategoriesResult `json:"result"` -} - -type ListOfCertifiedCategoriesResult struct { // Certified categories details Certification []ListOfCertifiedCategoriesResultCert `json:"certification"` @@ -112,16 +107,25 @@ type ListOfCertifiedCategoriesResult struct { } type ListOfCertifiedCategoriesResultCert struct { + // Identifier of the certified category + CategoryId int64 `json:"category_id"` + // Category name CategoryName string `json:"category_name"` // Indication of a mandatory category IsRequired bool `json:"is_required"` + + // Type identifier of the certified category + TypeId int64 `json:"type_id"` + + // Name of the type of certified category + TypeName string `json:"type_name"` } // List of certified categories func (c Certificates) ListOfCertifiedCategories(ctx context.Context, params *ListOfCertifiedCategoriesParams) (*ListOfCertifiedCategoriesResponse, error) { - url := "/v1/product/certification/list" + url := "/v2/product/certification/list" resp := &ListOfCertifiedCategoriesResponse{} diff --git a/ozon/certificates_test.go b/ozon/certificates_test.go index c747d4c..489a996 100644 --- a/ozon/certificates_test.go +++ b/ozon/certificates_test.go @@ -151,15 +151,16 @@ func TestListOfCertifiedCategories(t *testing.T) { PageSize: 100, }, `{ - "result": { - "certification": [ - { - "is_required": true, - "category_name": "Витаминно-минеральные комплексы для взрослых" - } - ], - "total": 1 - } + "certification": [ + { + "category_id": 0, + "category_name": "string", + "is_required": true, + "type_id": 0, + "type_name": "string" + } + ], + "total": 1 }`, }, // Test No Client-Id or Api-Key