You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
4.2 KiB
166 lines
4.2 KiB
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package sku_management
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-openapi/runtime"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
//go:generate mockery -name API -inpkg
|
|
|
|
// API is the interface of the sku management client
|
|
type API interface {
|
|
/*
|
|
CreateSku creates s k u
|
|
|
|
Creates a new sku*/
|
|
CreateSku(ctx context.Context, params *CreateSkuParams) (*CreateSkuCreated, error)
|
|
/*
|
|
GetSku gets specific sku
|
|
|
|
get sku with given skuid*/
|
|
GetSku(ctx context.Context, params *GetSkuParams) (*GetSkuOK, error)
|
|
/*
|
|
ListSkus lists s k us
|
|
|
|
lists all skus*/
|
|
ListSkus(ctx context.Context, params *ListSkusParams) (*ListSkusOK, error)
|
|
/*
|
|
UpdateSku updates specific sku
|
|
|
|
Update sku with given skuid*/
|
|
UpdateSku(ctx context.Context, params *UpdateSkuParams) (*UpdateSkuOK, error)
|
|
}
|
|
|
|
// New creates a new sku management API client.
|
|
func New(transport runtime.ClientTransport, formats strfmt.Registry, authInfo runtime.ClientAuthInfoWriter) *Client {
|
|
return &Client{
|
|
transport: transport,
|
|
formats: formats,
|
|
authInfo: authInfo,
|
|
}
|
|
}
|
|
|
|
/*
|
|
Client for sku management API
|
|
*/
|
|
type Client struct {
|
|
transport runtime.ClientTransport
|
|
formats strfmt.Registry
|
|
authInfo runtime.ClientAuthInfoWriter
|
|
}
|
|
|
|
/*
|
|
CreateSku creates s k u
|
|
|
|
Creates a new sku
|
|
*/
|
|
func (a *Client) CreateSku(ctx context.Context, params *CreateSkuParams) (*CreateSkuCreated, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "createSku",
|
|
Method: "POST",
|
|
PathPattern: "/sku",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &CreateSkuReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*CreateSkuCreated), nil
|
|
|
|
}
|
|
|
|
/*
|
|
GetSku gets specific sku
|
|
|
|
get sku with given skuid
|
|
*/
|
|
func (a *Client) GetSku(ctx context.Context, params *GetSkuParams) (*GetSkuOK, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "getSku",
|
|
Method: "GET",
|
|
PathPattern: "/sku/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &GetSkuReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*GetSkuOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
ListSkus lists s k us
|
|
|
|
lists all skus
|
|
*/
|
|
func (a *Client) ListSkus(ctx context.Context, params *ListSkusParams) (*ListSkusOK, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "listSkus",
|
|
Method: "GET",
|
|
PathPattern: "/sku",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &ListSkusReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*ListSkusOK), nil
|
|
|
|
}
|
|
|
|
/*
|
|
UpdateSku updates specific sku
|
|
|
|
Update sku with given skuid
|
|
*/
|
|
func (a *Client) UpdateSku(ctx context.Context, params *UpdateSkuParams) (*UpdateSkuOK, error) {
|
|
|
|
result, err := a.transport.Submit(&runtime.ClientOperation{
|
|
ID: "updateSku",
|
|
Method: "PUT",
|
|
PathPattern: "/sku/{id}",
|
|
ProducesMediaTypes: []string{"application/json"},
|
|
ConsumesMediaTypes: []string{"application/json"},
|
|
Schemes: []string{"http", "https"},
|
|
Params: params,
|
|
Reader: &UpdateSkuReader{formats: a.formats},
|
|
AuthInfo: a.authInfo,
|
|
Context: ctx,
|
|
Client: params.HTTPClient,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return result.(*UpdateSkuOK), nil
|
|
|
|
}
|
|
|