func (r GetEligibleShipmentServicesResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}
Status returns HTTPResponse.Status
package merchantFulfillment
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 {
	GetAdditionalSellerInputsWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	GetAdditionalSellerInputs(ctx context.Context, body GetAdditionalSellerInputsJSONRequestBody) (*http.Response, error)
	GetEligibleShipmentServicesOldWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	GetEligibleShipmentServicesOld(ctx context.Context, body GetEligibleShipmentServicesOldJSONRequestBody) (*http.Response, error)
	GetEligibleShipmentServicesWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	GetEligibleShipmentServices(ctx context.Context, body GetEligibleShipmentServicesJSONRequestBody) (*http.Response, error)
	GetAdditionalSellerInputsOldWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	GetAdditionalSellerInputsOld(ctx context.Context, body GetAdditionalSellerInputsOldJSONRequestBody) (*http.Response, error)
	CreateShipmentWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error)
	CreateShipment(ctx context.Context, body CreateShipmentJSONRequestBody) (*http.Response, error)
	CancelShipment(ctx context.Context, shipmentId string) (*http.Response, error)
	GetShipment(ctx context.Context, shipmentId string) (*http.Response, error)
	CancelShipmentOld(ctx context.Context, shipmentId string) (*http.Response, error)
}
func (c *Client) GetAdditionalSellerInputsWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewGetAdditionalSellerInputsRequestWithBody(c.Endpoint, 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) GetAdditionalSellerInputs(ctx context.Context, body GetAdditionalSellerInputsJSONRequestBody) (*http.Response, error) {
	req, err := NewGetAdditionalSellerInputsRequest(c.Endpoint, 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) GetEligibleShipmentServicesOldWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewGetEligibleShipmentServicesOldRequestWithBody(c.Endpoint, 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) GetEligibleShipmentServicesOld(ctx context.Context, body GetEligibleShipmentServicesOldJSONRequestBody) (*http.Response, error) {
	req, err := NewGetEligibleShipmentServicesOldRequest(c.Endpoint, 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) GetEligibleShipmentServicesWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewGetEligibleShipmentServicesRequestWithBody(c.Endpoint, 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) GetEligibleShipmentServices(ctx context.Context, body GetEligibleShipmentServicesJSONRequestBody) (*http.Response, error) {
	req, err := NewGetEligibleShipmentServicesRequest(c.Endpoint, 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) GetAdditionalSellerInputsOldWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewGetAdditionalSellerInputsOldRequestWithBody(c.Endpoint, 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) GetAdditionalSellerInputsOld(ctx context.Context, body GetAdditionalSellerInputsOldJSONRequestBody) (*http.Response, error) {
	req, err := NewGetAdditionalSellerInputsOldRequest(c.Endpoint, 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) CreateShipmentWithBody(ctx context.Context, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateShipmentRequestWithBody(c.Endpoint, 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) CreateShipment(ctx context.Context, body CreateShipmentJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateShipmentRequest(c.Endpoint, 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) CancelShipment(ctx context.Context, shipmentId string) (*http.Response, error) {
	req, err := NewCancelShipmentRequest(c.Endpoint, shipmentId)
	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) GetShipment(ctx context.Context, shipmentId string) (*http.Response, error) {
	req, err := NewGetShipmentRequest(c.Endpoint, shipmentId)
	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) CancelShipmentOld(ctx context.Context, shipmentId string) (*http.Response, error) {
	req, err := NewCancelShipmentOldRequest(c.Endpoint, shipmentId)
	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 NewGetAdditionalSellerInputsRequest(endpoint string, body GetAdditionalSellerInputsJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewGetAdditionalSellerInputsRequestWithBody(endpoint, "application/json", bodyReader)
}
func NewGetAdditionalSellerInputsRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/additionalSellerInputs")
	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 NewGetEligibleShipmentServicesOldRequest(endpoint string, body GetEligibleShipmentServicesOldJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewGetEligibleShipmentServicesOldRequestWithBody(endpoint, "application/json", bodyReader)
}
func NewGetEligibleShipmentServicesOldRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/eligibleServices")
	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 NewGetEligibleShipmentServicesRequest(endpoint string, body GetEligibleShipmentServicesJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewGetEligibleShipmentServicesRequestWithBody(endpoint, "application/json", bodyReader)
}
func NewGetEligibleShipmentServicesRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/eligibleShippingServices")
	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 NewGetAdditionalSellerInputsOldRequest(endpoint string, body GetAdditionalSellerInputsOldJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewGetAdditionalSellerInputsOldRequestWithBody(endpoint, "application/json", bodyReader)
}
func NewGetAdditionalSellerInputsOldRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/sellerInputs")
	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 NewCreateShipmentRequest(endpoint string, body CreateShipmentJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateShipmentRequestWithBody(endpoint, "application/json", bodyReader)
}
func NewCreateShipmentRequestWithBody(endpoint string, contentType string, body io.Reader) (*http.Request, error) {
	var err error
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/shipments")
	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 NewCancelShipmentRequest(endpoint string, shipmentId string) (*http.Request, error) {
	var err error
	var pathParam0 string
	pathParam0, err = runtime.StyleParam("simple", false, "shipmentId", shipmentId)
	if err != nil {
		return nil, err
	}
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/shipments/%s", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("DELETE", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	return req, nil
}
func NewGetShipmentRequest(endpoint string, shipmentId string) (*http.Request, error) {
	var err error
	var pathParam0 string
	pathParam0, err = runtime.StyleParam("simple", false, "shipmentId", shipmentId)
	if err != nil {
		return nil, err
	}
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/shipments/%s", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("GET", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	return req, nil
}
func NewCancelShipmentOldRequest(endpoint string, shipmentId string) (*http.Request, error) {
	var err error
	var pathParam0 string
	pathParam0, err = runtime.StyleParam("simple", false, "shipmentId", shipmentId)
	if err != nil {
		return nil, err
	}
	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}
	basePath := fmt.Sprintf("/mfn/v0/shipments/%s/cancel", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}
	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}
	req, err := http.NewRequest("PUT", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}
	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 {
	GetAdditionalSellerInputsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*GetAdditionalSellerInputsResp, error)
	GetAdditionalSellerInputsWithResponse(ctx context.Context, body GetAdditionalSellerInputsJSONRequestBody) (*GetAdditionalSellerInputsResp, error)
	GetEligibleShipmentServicesOldWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*GetEligibleShipmentServicesOldResp, error)
	GetEligibleShipmentServicesOldWithResponse(ctx context.Context, body GetEligibleShipmentServicesOldJSONRequestBody) (*GetEligibleShipmentServicesOldResp, error)
	GetEligibleShipmentServicesWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*GetEligibleShipmentServicesResp, error)
	GetEligibleShipmentServicesWithResponse(ctx context.Context, body GetEligibleShipmentServicesJSONRequestBody) (*GetEligibleShipmentServicesResp, error)
	GetAdditionalSellerInputsOldWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*GetAdditionalSellerInputsOldResp, error)
	GetAdditionalSellerInputsOldWithResponse(ctx context.Context, body GetAdditionalSellerInputsOldJSONRequestBody) (*GetAdditionalSellerInputsOldResp, error)
	CreateShipmentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader) (*CreateShipmentResp, error)
	CreateShipmentWithResponse(ctx context.Context, body CreateShipmentJSONRequestBody) (*CreateShipmentResp, error)
	CancelShipmentWithResponse(ctx context.Context, shipmentId string) (*CancelShipmentResp, error)
	GetShipmentWithResponse(ctx context.Context, shipmentId string) (*GetShipmentResp, error)
	CancelShipmentOldWithResponse(ctx context.Context, shipmentId string) (*CancelShipmentOldResp, error)
}
type GetAdditionalSellerInputsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetAdditionalSellerInputsResponse
}
func (r GetAdditionalSellerInputsResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}
func (r GetAdditionalSellerInputsResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}
type GetEligibleShipmentServicesOldResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetEligibleShipmentServicesResponse
}
func (r GetEligibleShipmentServicesOldResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}
func (r GetEligibleShipmentServicesOldResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}
type GetEligibleShipmentServicesResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetEligibleShipmentServicesResponse
}