fees

package
v0.0.0-...-0593bef Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package fees provides primitives to interact the openapi HTTP API.

Code generated by go-sdk-codegen DO NOT EDIT.

Package fees provides primitives to interact the openapi HTTP API.

Code generated by go-sdk-codegen DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGetMyFeesEstimateForASINRequest

func NewGetMyFeesEstimateForASINRequest(endpoint string, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*http.Request, error)

NewGetMyFeesEstimateForASINRequest calls the generic GetMyFeesEstimateForASIN builder with application/json body

func NewGetMyFeesEstimateForASINRequestWithBody

func NewGetMyFeesEstimateForASINRequestWithBody(endpoint string, asin string, contentType string, body io.Reader) (*http.Request, error)

NewGetMyFeesEstimateForASINRequestWithBody generates requests for GetMyFeesEstimateForASIN with any type of body

func NewGetMyFeesEstimateForSKURequest

func NewGetMyFeesEstimateForSKURequest(endpoint string, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*http.Request, error)

NewGetMyFeesEstimateForSKURequest calls the generic GetMyFeesEstimateForSKU builder with application/json body

func NewGetMyFeesEstimateForSKURequestWithBody

func NewGetMyFeesEstimateForSKURequestWithBody(endpoint string, sellerSKU string, contentType string, body io.Reader) (*http.Request, error)

NewGetMyFeesEstimateForSKURequestWithBody generates requests for GetMyFeesEstimateForSKU with any type of body

Types

type Client

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Endpoint string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A callback for modifying requests which are generated before sending over
	// the network.
	RequestBefore RequestBeforeFn

	// A callback for modifying response which are generated before sending over
	// the network.
	ResponseAfter ResponseAfterFn

	// The user agent header identifies your application, its version number, and the platform and programming language you are using.
	// You must include a user agent header in each request submitted to the sales partner API.
	UserAgent string
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient

func NewClient(endpoint string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) GetMyFeesEstimateForASIN

func (c *Client) GetMyFeesEstimateForASIN(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*http.Response, error)

func (*Client) GetMyFeesEstimateForASINWithBody

func (c *Client) GetMyFeesEstimateForASINWithBody(ctx context.Context, asin string, contentType string, body io.Reader) (*http.Response, error)

func (*Client) GetMyFeesEstimateForSKU

func (c *Client) GetMyFeesEstimateForSKU(ctx context.Context, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*http.Response, error)

func (*Client) GetMyFeesEstimateForSKUWithBody

func (c *Client) GetMyFeesEstimateForSKUWithBody(ctx context.Context, sellerSKU string, contentType string, body io.Reader) (*http.Response, error)

type ClientInterface

type ClientInterface interface {
	// GetMyFeesEstimateForASIN request  with any body
	GetMyFeesEstimateForASINWithBody(ctx context.Context, asin string, contentType string, body io.Reader) (*http.Response, error)

	GetMyFeesEstimateForASIN(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*http.Response, error)

	// GetMyFeesEstimateForSKU request  with any body
	GetMyFeesEstimateForSKUWithBody(ctx context.Context, sellerSKU string, contentType string, body io.Reader) (*http.Response, error)

	GetMyFeesEstimateForSKU(ctx context.Context, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestBefore

func WithRequestBefore(fn RequestBeforeFn) ClientOption

WithRequestBefore allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

func WithResponseAfter

func WithResponseAfter(fn ResponseAfterFn) ClientOption

WithResponseAfter allows setting up a callback function, which will be called right after get response the request. This can be used to log.

func WithUserAgent

func WithUserAgent(userAgent string) ClientOption

WithUserAgent set up useragent add user agent to every request automatically

type ClientWithResponses

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses

func NewClientWithResponses(endpoint string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) GetMyFeesEstimateForASINWithBodyWithResponse

func (c *ClientWithResponses) GetMyFeesEstimateForASINWithBodyWithResponse(ctx context.Context, asin string, contentType string, body io.Reader) (*GetMyFeesEstimateForASINResp, error)

GetMyFeesEstimateForASINWithBodyWithResponse request with arbitrary body returning *GetMyFeesEstimateForASINResponse

func (*ClientWithResponses) GetMyFeesEstimateForASINWithResponse

func (c *ClientWithResponses) GetMyFeesEstimateForASINWithResponse(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*GetMyFeesEstimateForASINResp, error)

func (*ClientWithResponses) GetMyFeesEstimateForSKUWithBodyWithResponse

func (c *ClientWithResponses) GetMyFeesEstimateForSKUWithBodyWithResponse(ctx context.Context, sellerSKU string, contentType string, body io.Reader) (*GetMyFeesEstimateForSKUResp, error)

GetMyFeesEstimateForSKUWithBodyWithResponse request with arbitrary body returning *GetMyFeesEstimateForSKUResponse

func (*ClientWithResponses) GetMyFeesEstimateForSKUWithResponse

func (c *ClientWithResponses) GetMyFeesEstimateForSKUWithResponse(ctx context.Context, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*GetMyFeesEstimateForSKUResp, error)

type ClientWithResponsesInterface

type ClientWithResponsesInterface interface {
	// GetMyFeesEstimateForASIN request  with any body
	GetMyFeesEstimateForASINWithBodyWithResponse(ctx context.Context, asin string, contentType string, body io.Reader) (*GetMyFeesEstimateForASINResp, error)

	GetMyFeesEstimateForASINWithResponse(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*GetMyFeesEstimateForASINResp, error)

	// GetMyFeesEstimateForSKU request  with any body
	GetMyFeesEstimateForSKUWithBodyWithResponse(ctx context.Context, sellerSKU string, contentType string, body io.Reader) (*GetMyFeesEstimateForSKUResp, error)

	GetMyFeesEstimateForSKUWithResponse(ctx context.Context, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*GetMyFeesEstimateForSKUResp, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type Error

type Error struct {

	// An error code that identifies the type of error that occurred.
	Code string `json:"code"`

	// Additional information that can help the caller understand or fix the issue.
	Details *string `json:"details,omitempty"`

	// A message that describes the error condition.
	Message string `json:"message"`
}

Error defines model for Error.

type ErrorList

type ErrorList []Error

ErrorList defines model for ErrorList.

type FeeDetail

type FeeDetail struct {
	FeeAmount    MoneyType  `json:"FeeAmount"`
	FeePromotion *MoneyType `json:"FeePromotion,omitempty"`

	// The type of fee charged to a seller.
	FeeType  string    `json:"FeeType"`
	FinalFee MoneyType `json:"FinalFee"`

	// A list of other fees that contribute to a given fee.
	IncludedFeeDetailList *IncludedFeeDetailList `json:"IncludedFeeDetailList,omitempty"`
	TaxAmount             *MoneyType             `json:"TaxAmount,omitempty"`
}

FeeDetail defines model for FeeDetail.

type FeeDetailList

type FeeDetailList []FeeDetail

FeeDetailList defines model for FeeDetailList.

type FeesEstimate

type FeesEstimate struct {

	// A list of other fees that contribute to a given fee.
	FeeDetailList *FeeDetailList `json:"FeeDetailList,omitempty"`

	// The time for which the fees were estimated. This defaults to the time the request is made.
	TimeOfFeesEstimation time.Time  `json:"TimeOfFeesEstimation"`
	TotalFeesEstimate    *MoneyType `json:"TotalFeesEstimate,omitempty"`
}

FeesEstimate defines model for FeesEstimate.

type FeesEstimateError

type FeesEstimateError struct {

	// An error code that identifies the type of error that occurred.
	Code string `json:"Code"`

	// Additional information that can help the caller understand or fix the issue.
	Detail FeesEstimateErrorDetail `json:"Detail"`

	// A message that describes the error condition in a human-readable form.
	Message string `json:"Message"`

	// An error type, identifying either the receiver or the sender as the originator of the error.
	Type string `json:"Type"`
}

FeesEstimateError defines model for FeesEstimateError.

type FeesEstimateErrorDetail

type FeesEstimateErrorDetail []map[string]interface{}

FeesEstimateErrorDetail defines model for FeesEstimateErrorDetail.

type FeesEstimateIdentifier

type FeesEstimateIdentifier struct {

	// The type of item identifier specified.
	IdType *string `json:"IdType,omitempty"`

	// The item identifier.
	IdValue *string `json:"IdValue,omitempty"`

	// When true, the offer is fulfilled by Amazon.
	IsAmazonFulfilled *bool `json:"IsAmazonFulfilled,omitempty"`

	// A marketplace identifier.
	MarketplaceId *string `json:"MarketplaceId,omitempty"`

	// Price information for an item, used to estimate fees.
	PriceToEstimateFees *PriceToEstimateFees `json:"PriceToEstimateFees,omitempty"`

	// The seller identifier.
	SellerId *string `json:"SellerId,omitempty"`

	// A unique identifier provided by the caller to track this request.
	SellerInputIdentifier *string `json:"SellerInputIdentifier,omitempty"`
}

FeesEstimateIdentifier defines model for FeesEstimateIdentifier.

type FeesEstimateRequest

type FeesEstimateRequest struct {

	// The product price on which the fee estimate is based.
	Identifier string `json:"Identifier"`

	// When true, the offer is fulfilled by Amazon.
	IsAmazonFulfilled *bool `json:"IsAmazonFulfilled,omitempty"`

	// A marketplace identifier.
	MarketplaceId string `json:"MarketplaceId"`

	// Price information for an item, used to estimate fees.
	PriceToEstimateFees PriceToEstimateFees `json:"PriceToEstimateFees"`
}

FeesEstimateRequest defines model for FeesEstimateRequest.

type FeesEstimateResult

type FeesEstimateResult struct {

	// An unexpected error occurred during this operation.
	Error *FeesEstimateError `json:"Error,omitempty"`

	// The total estimated fees for an item and a list of details.
	FeesEstimate *FeesEstimate `json:"FeesEstimate,omitempty"`

	// An item identifier, marketplace, time of request, and other details that identify an estimate.
	FeesEstimateIdentifier *FeesEstimateIdentifier `json:"FeesEstimateIdentifier,omitempty"`

	// The status of the fee request. Possible values: Success, ClientError, ServiceError.
	Status *string `json:"Status,omitempty"`
}

FeesEstimateResult defines model for FeesEstimateResult.

type GetMyFeesEstimateForASINJSONBody

type GetMyFeesEstimateForASINJSONBody GetMyFeesEstimateRequest

GetMyFeesEstimateForASINJSONBody defines parameters for GetMyFeesEstimateForASIN.

type GetMyFeesEstimateForASINJSONRequestBody

type GetMyFeesEstimateForASINJSONRequestBody GetMyFeesEstimateForASINJSONBody

GetMyFeesEstimateForASINRequestBody defines body for GetMyFeesEstimateForASIN for application/json ContentType.

type GetMyFeesEstimateForASINResp

type GetMyFeesEstimateForASINResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetMyFeesEstimateResponse
}

func ParseGetMyFeesEstimateForASINResp

func ParseGetMyFeesEstimateForASINResp(rsp *http.Response) (*GetMyFeesEstimateForASINResp, error)

ParseGetMyFeesEstimateForASINResp parses an HTTP response from a GetMyFeesEstimateForASINWithResponse call

func (GetMyFeesEstimateForASINResp) Status

Status returns HTTPResponse.Status

func (GetMyFeesEstimateForASINResp) StatusCode

func (r GetMyFeesEstimateForASINResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetMyFeesEstimateForSKUJSONBody

type GetMyFeesEstimateForSKUJSONBody GetMyFeesEstimateRequest

GetMyFeesEstimateForSKUJSONBody defines parameters for GetMyFeesEstimateForSKU.

type GetMyFeesEstimateForSKUJSONRequestBody

type GetMyFeesEstimateForSKUJSONRequestBody GetMyFeesEstimateForSKUJSONBody

GetMyFeesEstimateForSKURequestBody defines body for GetMyFeesEstimateForSKU for application/json ContentType.

type GetMyFeesEstimateForSKUResp

type GetMyFeesEstimateForSKUResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetMyFeesEstimateResponse
}

func ParseGetMyFeesEstimateForSKUResp

func ParseGetMyFeesEstimateForSKUResp(rsp *http.Response) (*GetMyFeesEstimateForSKUResp, error)

ParseGetMyFeesEstimateForSKUResp parses an HTTP response from a GetMyFeesEstimateForSKUWithResponse call

func (GetMyFeesEstimateForSKUResp) Status

Status returns HTTPResponse.Status

func (GetMyFeesEstimateForSKUResp) StatusCode

func (r GetMyFeesEstimateForSKUResp) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetMyFeesEstimateRequest

type GetMyFeesEstimateRequest struct {
	FeesEstimateRequest *FeesEstimateRequest `json:"FeesEstimateRequest,omitempty"`
}

GetMyFeesEstimateRequest defines model for GetMyFeesEstimateRequest.

type GetMyFeesEstimateResponse

type GetMyFeesEstimateResponse struct {

	// A list of error responses returned when a request is unsuccessful.
	Errors *ErrorList `json:"errors,omitempty"`

	// Response schema.
	Payload *GetMyFeesEstimateResult `json:"payload,omitempty"`
}

GetMyFeesEstimateResponse defines model for GetMyFeesEstimateResponse.

type GetMyFeesEstimateResult

type GetMyFeesEstimateResult struct {

	// An item identifier and the estimated fees for the item.
	FeesEstimateResult *FeesEstimateResult `json:"FeesEstimateResult,omitempty"`
}

GetMyFeesEstimateResult defines model for GetMyFeesEstimateResult.

type HttpRequestDoer

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

type IncludedFeeDetail

type IncludedFeeDetail struct {
	FeeAmount    MoneyType  `json:"FeeAmount"`
	FeePromotion *MoneyType `json:"FeePromotion,omitempty"`

	// The type of fee charged to a seller.
	FeeType   string     `json:"FeeType"`
	FinalFee  MoneyType  `json:"FinalFee"`
	TaxAmount *MoneyType `json:"TaxAmount,omitempty"`
}

IncludedFeeDetail defines model for IncludedFeeDetail.

type IncludedFeeDetailList

type IncludedFeeDetailList []IncludedFeeDetail

IncludedFeeDetailList defines model for IncludedFeeDetailList.

type MoneyType

type MoneyType struct {

	// The monetary value.
	Amount *float32 `json:"Amount,omitempty"`

	// The currency code in ISO 4217 format.
	CurrencyCode *string `json:"CurrencyCode,omitempty"`
}

MoneyType defines model for MoneyType.

type Points

type Points struct {
	PointsMonetaryValue *MoneyType `json:"PointsMonetaryValue,omitempty"`
	PointsNumber        *int32     `json:"PointsNumber,omitempty"`
}

Points defines model for Points.

type PriceToEstimateFees

type PriceToEstimateFees struct {
	ListingPrice MoneyType  `json:"ListingPrice"`
	Points       *Points    `json:"Points,omitempty"`
	Shipping     *MoneyType `json:"Shipping,omitempty"`
}

PriceToEstimateFees defines model for PriceToEstimateFees.

type RequestBeforeFn

type RequestBeforeFn func(ctx context.Context, req *http.Request) error

RequestBeforeFn is the function signature for the RequestBefore callback function

type ResponseAfterFn

type ResponseAfterFn func(ctx context.Context, rsp *http.Response) error

ResponseAfterFn is the function signature for the ResponseAfter callback function

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL