func (r GetMyFeesEstimateForSKUResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}
StatusCode returns HTTPResponse.StatusCode
package fees
import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	runt "runtime"
	"strings"
	"gopkg.me/selling-partner-api-sdk/pkg/runtime"
)
type RequestBeforeFn func(ctx context.Context, req *http.Request) error
type ResponseAfterFn func(ctx context.Context, rsp *http.Response) error
type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}
type Client struct {
	Endpoint string
	Client HttpRequestDoer
	RequestBefore RequestBeforeFn
	ResponseAfter ResponseAfterFn
	UserAgent string
}
type ClientOption func(*Client) error
func NewClient(endpoint string, opts ...ClientOption) (*Client, error) {
	client := Client{
		Endpoint: endpoint,
	}
	for _, o := range opts {
		if err := o(&client); err != nil {
			return nil, err
		}
	}
	if !strings.HasSuffix(client.Endpoint, "/") {
		client.Endpoint += "/"
	}
	if client.Client == nil {
		client.Client = http.DefaultClient
	}
	if client.UserAgent == "" {
		client.UserAgent = fmt.Sprintf("selling-partner-api-sdk/v1.0 (Language=%s; Platform=%s-%s)", strings.Replace(runt.Version(), "go", "go/", -1), runt.GOOS, runt.GOARCH)
	}
	return &client, nil
}
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
	return func(c *Client) error {
		c.Client = doer
		return nil
	}
}
func WithUserAgent(userAgent string) ClientOption {
	return func(c *Client) error {
		c.UserAgent = userAgent
		return nil
	}
}
func WithRequestBefore(fn RequestBeforeFn) ClientOption {
	return func(c *Client) error {
		c.RequestBefore = fn
		return nil
	}
}
func WithResponseAfter(fn ResponseAfterFn) ClientOption {
	return func(c *Client) error {
		c.ResponseAfter = fn
		return nil
	}
}
type ClientInterface interface {
	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)
	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)
}
func (c *Client) GetMyFeesEstimateForASINWithBody(ctx context.Context, asin string, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewGetMyFeesEstimateForASINRequestWithBody(c.Endpoint, asin, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) GetMyFeesEstimateForASIN(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*http.Response, error) {
	req, err := NewGetMyFeesEstimateForASINRequest(c.Endpoint, asin, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func (c *Client) GetMyFeesEstimateForSKUWithBody(ctx context.Context, sellerSKU string, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewGetMyFeesEstimateForSKURequestWithBody(c.Endpoint, sellerSKU, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	req.Header.Set("User-Agent", c.UserAgent)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	rsp, err := c.Client.Do(req)
	if err != nil {
		return nil, err
	}
	if c.ResponseAfter != nil {
		err = c.ResponseAfter(ctx, rsp)
		if err != nil {
			return nil, err
		}
	}
	return rsp, nil
}
func (c *Client) GetMyFeesEstimateForSKU(ctx context.Context, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*http.Response, error) {
	req, err := NewGetMyFeesEstimateForSKURequest(c.Endpoint, sellerSKU, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if c.RequestBefore != nil {
		err = c.RequestBefore(ctx, req)
		if err != nil {
			return nil, err
		}
	}
	return c.Client.Do(req)
}
func NewGetMyFeesEstimateForASINRequest(endpoint string, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewGetMyFeesEstimateForASINRequestWithBody(endpoint, asin, "application/json", bodyReader)
}
func NewGetMyFeesEstimateForASINRequestWithBody(endpoint string, asin string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	var pathParam0 string
	pathParam0, err = runtime.StyleParam("simple", false, "Asin", asin)
	if err != nil {
		return nil, err
	}
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/products/fees/v0/items/%s/feesEstimate", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Content-Type", contentType)
	return req, nil
}
func NewGetMyFeesEstimateForSKURequest(endpoint string, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewGetMyFeesEstimateForSKURequestWithBody(endpoint, sellerSKU, "application/json", bodyReader)
}
func NewGetMyFeesEstimateForSKURequestWithBody(endpoint string, sellerSKU string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	var pathParam0 string
	pathParam0, err = runtime.StyleParam("simple", false, "SellerSKU", sellerSKU)
	if err != nil {
		return nil, err
	}
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/products/fees/v0/listings/%s/feesEstimate", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}
	req.Header.Add("Content-Type", contentType)
	return req, nil
}
type ClientWithResponses struct {
	ClientInterface
}
func NewClientWithResponses(endpoint string, opts ...ClientOption) (*ClientWithResponses, error) {
	client, err := NewClient(endpoint, opts...)
	if err != nil {
		return nil, err
	}
	return &ClientWithResponses{client}, nil
}
func WithBaseURL(baseURL string) ClientOption {
	return func(c *Client) error {
		newBaseURL, err := url.Parse(baseURL)
		if err != nil {
			return err
		}
		c.Endpoint = newBaseURL.String()
		return nil
	}
}
type ClientWithResponsesInterface interface {
	GetMyFeesEstimateForASINWithBodyWithResponse(ctx context.Context, asin string, contentType string, body io.Reader) (*GetMyFeesEstimateForASINResp, error)
	GetMyFeesEstimateForASINWithResponse(ctx context.Context, asin string, body GetMyFeesEstimateForASINJSONRequestBody) (*GetMyFeesEstimateForASINResp, error)
	GetMyFeesEstimateForSKUWithBodyWithResponse(ctx context.Context, sellerSKU string, contentType string, body io.Reader) (*GetMyFeesEstimateForSKUResp, error)
	GetMyFeesEstimateForSKUWithResponse(ctx context.Context, sellerSKU string, body GetMyFeesEstimateForSKUJSONRequestBody) (*GetMyFeesEstimateForSKUResp, error)
}
type GetMyFeesEstimateForASINResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetMyFeesEstimateResponse
}
func (r GetMyFeesEstimateForASINResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}
func (r GetMyFeesEstimateForASINResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}
type GetMyFeesEstimateForSKUResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetMyFeesEstimateResponse
}
func (r GetMyFeesEstimateForSKUResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}