# README
Go API client for openapi
MPStats API
Overview
This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.
- API version: 1.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.GoClientCodegen
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import openapi "github.com/GIT_USER_ID/GIT_REPO_ID"
To use a proxy, set the environment variable HTTP_PROXY
:
os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")
Configuration of Server URL
Default configuration comes with Servers
field that contains server objects as defined in the OpenAPI specification.
Select Server Configuration
For using other server than the one defined on index 0 set context value sw.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{
"basePath": "v2",
})
Note, enum values are always validated and all unused variables are silently ignored.
URLs Configuration per Operation
Each operation can use different server URL defined using OperationServers
map in the Configuration
.
An operation is uniquely identified by "{classname}Service.{nickname}"
string.
Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices
and sw.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), openapi.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
Documentation for API Endpoints
All URIs are relative to https://mpstats.io/api
Class | Method | HTTP request | Description |
---|---|---|---|
WbApi | GetBrandByDate | Get /wb/get/brand/by_date | Данные по дням по бренду |
WbApi | GetBrandCategories | Get /wb/get/brand/categories | Категории бренда |
WbApi | GetBrandDetailedItems | Post /wb/get/brand | Товары бренда |
WbApi | GetBrandPriceSegmentation | Get /wb/get/brand/price_segmentation | Ценовая сегментация бренда |
WbApi | GetBrandSellers | Get /wb/get/brand/sellers | Продавцы бренда |
WbApi | GetCategories | Get /wb/get/categories | Текущие категории |
WbApi | GetCategoryBrands | Get /wb/get/category/brands | Бренды категории |
WbApi | GetCategoryByDate | Get /wb/get/category/by_date | Данные по дням по категории |
WbApi | GetCategoryItems | Post /wb/get/category | Товары категории |
WbApi | GetCategoryPriceSegmentation | Get /wb/get/category/price_segmentation | Ценовая сегментация категории |
WbApi | GetCategorySellers | Get /wb/get/category/sellers | Продавцы категории |
WbApi | GetCategorySubcategories | Get /wb/get/category/subcategories | Подкатегории категории |
WbApi | GetCategorySubjects | Get /wb/get/category/items | Предметы категории |
WbApi | GetCategoryTrends | Get /wb/get/category/trends | Тренды категории |
WbApi | GetItemBalanceByDay | Get /wb/get/item/{sku}/balance_by_day | Продажи и остатки товарной позиции за сутки |
WbApi | GetItemByCategory | Get /wb/get/item/{sku}/by_category | История товарной позиции по категориям |
WbApi | GetItemBySku | Get /wb/get/item/{sku} | Одна товарная позиция по SKU |
WbApi | GetItemOrdersByRegion | Get /wb/get/item/{sku}/orders_by_region | История заказов и остатков товарной позиции по складам |
WbApi | GetItemOrdersBySize | Get /wb/get/item/{sku}/orders_by_size | История заказов и остатков товарной позиции по размерам |
WbApi | GetItemSales | Get /wb/get/item/{sku}/sales | Продажи и остатки товарной позиции |
WbApi | GetItemSimilar | Get /wb/get/item/{sku}/similar | Похожие товарные позиции |
WbApi | GetItemsBatch | Post /wb/get/items/batch | Товарные позиции по SKU |
WbApi | GetSellerBrands | Get /wb/get/seller/brands | Бренды продавца |
WbApi | GetSellerByDate | Get /wb/get/seller/by_date | Данные по дням по продавцу |
WbApi | GetSellerCategories | Get /wb/get/seller/categories | Категории продавца |
WbApi | GetSellerDetailedItems | Post /wb/get/seller | Товары продавца |
WbApi | GetSellerPriceSegmentation | Get /wb/get/seller/price_segmentation | Ценовая сегментация продавца |
WbApi | GetSimilarBrands | Get /wb/get/similar/brands | Бренды похожего товара |
WbApi | GetSimilarByDate | Get /wb/get/similar/by_date | По дням |
WbApi | GetSimilarCategories | Get /wb/get/similar/categories | Категории похожего товара |
WbApi | GetSimilarDetailedItems | Post /wb/get/similar | Товары по похожему товару |
WbApi | GetSimilarSellers | Get /wb/get/similar/sellers | Продавцы похожего товара |
WbApi | GetSubjectItems | Post /wb/get/subject | Получить список товаров по предмету |
WbApi | PostWbGetSearchCategories | Post /wb/get/search/categories | GetSearchCategories |
WbApi | PostWbGetSearchItems | Post /wb/get/search | GetSearchItems |
Documentation For Models
- BrandByDate
- BrandCategory
- BrandPriceSegmentation
- BrandSeller
- CategoryBrand
- CategoryByDate
- CategoryName
- CategoryPath
- CategoryPriceSegmentation
- CategorySeller
- CategorySubcategory
- CategorySubject
- CategoryTrend
- CategoryUrl
- FilterModelItem
- GetItemsBatchRequestBody
- GetItemsRequestBody
- GetSearchItemsRequestBody
- InlineResponse200
- Item
- ItemBalanceByDay
- ItemByCategory
- ItemItem
- ItemPhotos
- ItemSale
- ItemSimilar
- SearchCategoriesElement
- SearchItems
- SearchItemsElement
- SellerBrand
- SellerByDate
- SellerCategory
- SellerPriceSegmentation
- SimilarBrand
- SimilarByDate
- SimilarCategory
- SimilarSeller
- SortModelItem
- TplsRequestBody
Documentation For Authorization
Header-token
- Type: API key
- API key parameter name: X-Mpstats-TOKEN
- Location: HTTP header
Note, each API key must be added to a map of map[string]APIKey
where the key is: X-Mpstats-TOKEN and passed in as the auth context for each request.
Documentation for Utility Methods
Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:
PtrBool
PtrInt
PtrInt32
PtrInt64
PtrFloat
PtrFloat32
PtrFloat64
PtrString
PtrTime