// Package messaging provides primitives to interact the openapi HTTP API.
//
// Code generated by go-sdk-codegen DO NOT EDIT.
package messaging

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
	"net/http"
	"net/url"
	runt "runtime"
	"strings"

	"github.com/amzapi/selling-partner-api-sdk/pkg/runtime"
)

// RequestBeforeFn  is the function signature for the RequestBefore callback function
type RequestBeforeFn func(ctx context.Context, req *http.Request) error

// ResponseAfterFn  is the function signature for the ResponseAfter callback function
type ResponseAfterFn func(ctx context.Context, rsp *http.Response) error

// Doer performs HTTP requests.
//
// The standard http.Client implements this interface.
type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

// Client which conforms to the OpenAPI3 specification for this service.
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
}

// ClientOption allows setting custom parameters during construction
type ClientOption func(*Client) error

// Creates a new Client, with reasonable defaults
func NewClient(endpoint string, opts ...ClientOption) (*Client, error) {
	// create a client with sane default values
	client := Client{
		Endpoint: endpoint,
	}
	// mutate client and add all optional params
	for _, o := range opts {
		if err := o(&client); err != nil {
			return nil, err
		}
	}
	// ensure the endpoint URL always has a trailing slash
	if !strings.HasSuffix(client.Endpoint, "/") {
		client.Endpoint += "/"
	}
	// create httpClient, if not already present
	if client.Client == nil {
		client.Client = http.DefaultClient
	}
	// setting the default useragent
	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
}

// WithHTTPClient allows overriding the default Doer, which is
// automatically created using http.Client. This is useful for tests.
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
	return func(c *Client) error {
		c.Client = doer
		return nil
	}
}

// WithUserAgent set up useragent
// add user agent to every request automatically
func WithUserAgent(userAgent string) ClientOption {
	return func(c *Client) error {
		c.UserAgent = userAgent
		return nil
	}
}

// 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 WithRequestBefore(fn RequestBeforeFn) ClientOption {
	return func(c *Client) error {
		c.RequestBefore = fn
		return nil
	}
}

// WithResponseAfter allows setting up a callback function, which will be
// called right after get response the request. This can be used to log.
func WithResponseAfter(fn ResponseAfterFn) ClientOption {
	return func(c *Client) error {
		c.ResponseAfter = fn
		return nil
	}
}

// The interface specification for the client above.
type ClientInterface interface {
	// GetMessagingActionsForOrder request
	GetMessagingActionsForOrder(ctx context.Context, amazonOrderId string, params *GetMessagingActionsForOrderParams) (*http.Response, error)

	// GetAttributes request
	GetAttributes(ctx context.Context, amazonOrderId string, params *GetAttributesParams) (*http.Response, error)

	// CreateAmazonMotors request  with any body
	CreateAmazonMotorsWithBody(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, contentType string, body io.Reader) (*http.Response, error)

	CreateAmazonMotors(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, body CreateAmazonMotorsJSONRequestBody) (*http.Response, error)

	// ConfirmCustomizationDetails request  with any body
	ConfirmCustomizationDetailsWithBody(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, contentType string, body io.Reader) (*http.Response, error)

	ConfirmCustomizationDetails(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, body ConfirmCustomizationDetailsJSONRequestBody) (*http.Response, error)

	// CreateConfirmDeliveryDetails request  with any body
	CreateConfirmDeliveryDetailsWithBody(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, contentType string, body io.Reader) (*http.Response, error)

	CreateConfirmDeliveryDetails(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, body CreateConfirmDeliveryDetailsJSONRequestBody) (*http.Response, error)

	// CreateConfirmOrderDetails request  with any body
	CreateConfirmOrderDetailsWithBody(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, contentType string, body io.Reader) (*http.Response, error)

	CreateConfirmOrderDetails(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, body CreateConfirmOrderDetailsJSONRequestBody) (*http.Response, error)

	// CreateConfirmServiceDetails request  with any body
	CreateConfirmServiceDetailsWithBody(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, contentType string, body io.Reader) (*http.Response, error)

	CreateConfirmServiceDetails(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, body CreateConfirmServiceDetailsJSONRequestBody) (*http.Response, error)

	// CreateDigitalAccessKey request  with any body
	CreateDigitalAccessKeyWithBody(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, contentType string, body io.Reader) (*http.Response, error)

	CreateDigitalAccessKey(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, body CreateDigitalAccessKeyJSONRequestBody) (*http.Response, error)

	// CreateLegalDisclosure request  with any body
	CreateLegalDisclosureWithBody(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, contentType string, body io.Reader) (*http.Response, error)

	CreateLegalDisclosure(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, body CreateLegalDisclosureJSONRequestBody) (*http.Response, error)

	// CreateNegativeFeedbackRemoval request
	CreateNegativeFeedbackRemoval(ctx context.Context, amazonOrderId string, params *CreateNegativeFeedbackRemovalParams) (*http.Response, error)

	// CreateUnexpectedProblem request  with any body
	CreateUnexpectedProblemWithBody(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, contentType string, body io.Reader) (*http.Response, error)

	CreateUnexpectedProblem(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, body CreateUnexpectedProblemJSONRequestBody) (*http.Response, error)

	// CreateWarranty request  with any body
	CreateWarrantyWithBody(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, contentType string, body io.Reader) (*http.Response, error)

	CreateWarranty(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, body CreateWarrantyJSONRequestBody) (*http.Response, error)
}

func (c *Client) GetMessagingActionsForOrder(ctx context.Context, amazonOrderId string, params *GetMessagingActionsForOrderParams) (*http.Response, error) {
	req, err := NewGetMessagingActionsForOrderRequest(c.Endpoint, amazonOrderId, params)
	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) GetAttributes(ctx context.Context, amazonOrderId string, params *GetAttributesParams) (*http.Response, error) {
	req, err := NewGetAttributesRequest(c.Endpoint, amazonOrderId, params)
	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) CreateAmazonMotorsWithBody(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateAmazonMotorsRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateAmazonMotors(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, body CreateAmazonMotorsJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateAmazonMotorsRequest(c.Endpoint, amazonOrderId, params, 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) ConfirmCustomizationDetailsWithBody(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewConfirmCustomizationDetailsRequestWithBody(c.Endpoint, amazonOrderId, params, 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) ConfirmCustomizationDetails(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, body ConfirmCustomizationDetailsJSONRequestBody) (*http.Response, error) {
	req, err := NewConfirmCustomizationDetailsRequest(c.Endpoint, amazonOrderId, params, 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) CreateConfirmDeliveryDetailsWithBody(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateConfirmDeliveryDetailsRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateConfirmDeliveryDetails(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, body CreateConfirmDeliveryDetailsJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateConfirmDeliveryDetailsRequest(c.Endpoint, amazonOrderId, params, 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) CreateConfirmOrderDetailsWithBody(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateConfirmOrderDetailsRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateConfirmOrderDetails(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, body CreateConfirmOrderDetailsJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateConfirmOrderDetailsRequest(c.Endpoint, amazonOrderId, params, 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) CreateConfirmServiceDetailsWithBody(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateConfirmServiceDetailsRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateConfirmServiceDetails(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, body CreateConfirmServiceDetailsJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateConfirmServiceDetailsRequest(c.Endpoint, amazonOrderId, params, 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) CreateDigitalAccessKeyWithBody(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateDigitalAccessKeyRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateDigitalAccessKey(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, body CreateDigitalAccessKeyJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateDigitalAccessKeyRequest(c.Endpoint, amazonOrderId, params, 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) CreateLegalDisclosureWithBody(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateLegalDisclosureRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateLegalDisclosure(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, body CreateLegalDisclosureJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateLegalDisclosureRequest(c.Endpoint, amazonOrderId, params, 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) CreateNegativeFeedbackRemoval(ctx context.Context, amazonOrderId string, params *CreateNegativeFeedbackRemovalParams) (*http.Response, error) {
	req, err := NewCreateNegativeFeedbackRemovalRequest(c.Endpoint, amazonOrderId, params)
	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) CreateUnexpectedProblemWithBody(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateUnexpectedProblemRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateUnexpectedProblem(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, body CreateUnexpectedProblemJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateUnexpectedProblemRequest(c.Endpoint, amazonOrderId, params, 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) CreateWarrantyWithBody(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, contentType string, body io.Reader) (*http.Response, error) {
	req, err := NewCreateWarrantyRequestWithBody(c.Endpoint, amazonOrderId, params, 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) CreateWarranty(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, body CreateWarrantyJSONRequestBody) (*http.Response, error) {
	req, err := NewCreateWarrantyRequest(c.Endpoint, amazonOrderId, params, 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)
}

// NewGetMessagingActionsForOrderRequest generates requests for GetMessagingActionsForOrder
func NewGetMessagingActionsForOrderRequest(endpoint string, amazonOrderId string, params *GetMessagingActionsForOrderParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("GET", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewGetAttributesRequest generates requests for GetAttributes
func NewGetAttributesRequest(endpoint string, amazonOrderId string, params *GetAttributesParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/attributes", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("GET", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewCreateAmazonMotorsRequest calls the generic CreateAmazonMotors builder with application/json body
func NewCreateAmazonMotorsRequest(endpoint string, amazonOrderId string, params *CreateAmazonMotorsParams, body CreateAmazonMotorsJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateAmazonMotorsRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateAmazonMotorsRequestWithBody generates requests for CreateAmazonMotors with any type of body
func NewCreateAmazonMotorsRequestWithBody(endpoint string, amazonOrderId string, params *CreateAmazonMotorsParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/amazonMotors", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewConfirmCustomizationDetailsRequest calls the generic ConfirmCustomizationDetails builder with application/json body
func NewConfirmCustomizationDetailsRequest(endpoint string, amazonOrderId string, params *ConfirmCustomizationDetailsParams, body ConfirmCustomizationDetailsJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewConfirmCustomizationDetailsRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewConfirmCustomizationDetailsRequestWithBody generates requests for ConfirmCustomizationDetails with any type of body
func NewConfirmCustomizationDetailsRequestWithBody(endpoint string, amazonOrderId string, params *ConfirmCustomizationDetailsParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/confirmCustomizationDetails", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateConfirmDeliveryDetailsRequest calls the generic CreateConfirmDeliveryDetails builder with application/json body
func NewCreateConfirmDeliveryDetailsRequest(endpoint string, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, body CreateConfirmDeliveryDetailsJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateConfirmDeliveryDetailsRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateConfirmDeliveryDetailsRequestWithBody generates requests for CreateConfirmDeliveryDetails with any type of body
func NewCreateConfirmDeliveryDetailsRequestWithBody(endpoint string, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/confirmDeliveryDetails", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateConfirmOrderDetailsRequest calls the generic CreateConfirmOrderDetails builder with application/json body
func NewCreateConfirmOrderDetailsRequest(endpoint string, amazonOrderId string, params *CreateConfirmOrderDetailsParams, body CreateConfirmOrderDetailsJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateConfirmOrderDetailsRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateConfirmOrderDetailsRequestWithBody generates requests for CreateConfirmOrderDetails with any type of body
func NewCreateConfirmOrderDetailsRequestWithBody(endpoint string, amazonOrderId string, params *CreateConfirmOrderDetailsParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/confirmOrderDetails", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateConfirmServiceDetailsRequest calls the generic CreateConfirmServiceDetails builder with application/json body
func NewCreateConfirmServiceDetailsRequest(endpoint string, amazonOrderId string, params *CreateConfirmServiceDetailsParams, body CreateConfirmServiceDetailsJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateConfirmServiceDetailsRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateConfirmServiceDetailsRequestWithBody generates requests for CreateConfirmServiceDetails with any type of body
func NewCreateConfirmServiceDetailsRequestWithBody(endpoint string, amazonOrderId string, params *CreateConfirmServiceDetailsParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/confirmServiceDetails", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateDigitalAccessKeyRequest calls the generic CreateDigitalAccessKey builder with application/json body
func NewCreateDigitalAccessKeyRequest(endpoint string, amazonOrderId string, params *CreateDigitalAccessKeyParams, body CreateDigitalAccessKeyJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateDigitalAccessKeyRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateDigitalAccessKeyRequestWithBody generates requests for CreateDigitalAccessKey with any type of body
func NewCreateDigitalAccessKeyRequestWithBody(endpoint string, amazonOrderId string, params *CreateDigitalAccessKeyParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/digitalAccessKey", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateLegalDisclosureRequest calls the generic CreateLegalDisclosure builder with application/json body
func NewCreateLegalDisclosureRequest(endpoint string, amazonOrderId string, params *CreateLegalDisclosureParams, body CreateLegalDisclosureJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateLegalDisclosureRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateLegalDisclosureRequestWithBody generates requests for CreateLegalDisclosure with any type of body
func NewCreateLegalDisclosureRequestWithBody(endpoint string, amazonOrderId string, params *CreateLegalDisclosureParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/legalDisclosure", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateNegativeFeedbackRemovalRequest generates requests for CreateNegativeFeedbackRemoval
func NewCreateNegativeFeedbackRemovalRequest(endpoint string, amazonOrderId string, params *CreateNegativeFeedbackRemovalParams) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/negativeFeedbackRemoval", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewCreateUnexpectedProblemRequest calls the generic CreateUnexpectedProblem builder with application/json body
func NewCreateUnexpectedProblemRequest(endpoint string, amazonOrderId string, params *CreateUnexpectedProblemParams, body CreateUnexpectedProblemJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateUnexpectedProblemRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateUnexpectedProblemRequestWithBody generates requests for CreateUnexpectedProblem with any type of body
func NewCreateUnexpectedProblemRequestWithBody(endpoint string, amazonOrderId string, params *CreateUnexpectedProblemParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/unexpectedProblem", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// NewCreateWarrantyRequest calls the generic CreateWarranty builder with application/json body
func NewCreateWarrantyRequest(endpoint string, amazonOrderId string, params *CreateWarrantyParams, body CreateWarrantyJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateWarrantyRequestWithBody(endpoint, amazonOrderId, params, "application/json", bodyReader)
}

// NewCreateWarrantyRequestWithBody generates requests for CreateWarranty with any type of body
func NewCreateWarrantyRequestWithBody(endpoint string, amazonOrderId string, params *CreateWarrantyParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParam("simple", false, "amazonOrderId", amazonOrderId)
	if err != nil {
		return nil, err
	}

	queryUrl, err := url.Parse(endpoint)
	if err != nil {
		return nil, err
	}

	basePath := fmt.Sprintf("/messaging/v1/orders/%s/messages/warranty", pathParam0)
	if basePath[0] == '/' {
		basePath = basePath[1:]
	}

	queryUrl, err = queryUrl.Parse(basePath)
	if err != nil {
		return nil, err
	}

	queryValues := queryUrl.Query()

	if queryFrag, err := runtime.StyleParam("form", true, "marketplaceIds", params.MarketplaceIds); err != nil {
		return nil, err
	} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
		return nil, err
	} else {
		for k, v := range parsed {
			for _, v2 := range v {
				queryValues.Add(k, v2)
			}
		}
	}

	queryUrl.RawQuery = queryValues.Encode()

	req, err := http.NewRequest("POST", queryUrl.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)
	return req, nil
}

// ClientWithResponses builds on ClientInterface to offer response payloads
type ClientWithResponses struct {
	ClientInterface
}

// NewClientWithResponses creates a new ClientWithResponses, which wraps
// Client with return type handling
func NewClientWithResponses(endpoint string, opts ...ClientOption) (*ClientWithResponses, error) {
	client, err := NewClient(endpoint, opts...)
	if err != nil {
		return nil, err
	}
	return &ClientWithResponses{client}, nil
}

// WithBaseURL overrides the baseURL.
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
	}
}

// ClientWithResponsesInterface is the interface specification for the client with responses above.
type ClientWithResponsesInterface interface {
	// GetMessagingActionsForOrder request
	GetMessagingActionsForOrderWithResponse(ctx context.Context, amazonOrderId string, params *GetMessagingActionsForOrderParams) (*GetMessagingActionsForOrderResp, error)

	// GetAttributes request
	GetAttributesWithResponse(ctx context.Context, amazonOrderId string, params *GetAttributesParams) (*GetAttributesResp, error)

	// CreateAmazonMotors request  with any body
	CreateAmazonMotorsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, contentType string, body io.Reader) (*CreateAmazonMotorsResp, error)

	CreateAmazonMotorsWithResponse(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, body CreateAmazonMotorsJSONRequestBody) (*CreateAmazonMotorsResp, error)

	// ConfirmCustomizationDetails request  with any body
	ConfirmCustomizationDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, contentType string, body io.Reader) (*ConfirmCustomizationDetailsResp, error)

	ConfirmCustomizationDetailsWithResponse(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, body ConfirmCustomizationDetailsJSONRequestBody) (*ConfirmCustomizationDetailsResp, error)

	// CreateConfirmDeliveryDetails request  with any body
	CreateConfirmDeliveryDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, contentType string, body io.Reader) (*CreateConfirmDeliveryDetailsResp, error)

	CreateConfirmDeliveryDetailsWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, body CreateConfirmDeliveryDetailsJSONRequestBody) (*CreateConfirmDeliveryDetailsResp, error)

	// CreateConfirmOrderDetails request  with any body
	CreateConfirmOrderDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, contentType string, body io.Reader) (*CreateConfirmOrderDetailsResp, error)

	CreateConfirmOrderDetailsWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, body CreateConfirmOrderDetailsJSONRequestBody) (*CreateConfirmOrderDetailsResp, error)

	// CreateConfirmServiceDetails request  with any body
	CreateConfirmServiceDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, contentType string, body io.Reader) (*CreateConfirmServiceDetailsResp, error)

	CreateConfirmServiceDetailsWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, body CreateConfirmServiceDetailsJSONRequestBody) (*CreateConfirmServiceDetailsResp, error)

	// CreateDigitalAccessKey request  with any body
	CreateDigitalAccessKeyWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, contentType string, body io.Reader) (*CreateDigitalAccessKeyResp, error)

	CreateDigitalAccessKeyWithResponse(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, body CreateDigitalAccessKeyJSONRequestBody) (*CreateDigitalAccessKeyResp, error)

	// CreateLegalDisclosure request  with any body
	CreateLegalDisclosureWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, contentType string, body io.Reader) (*CreateLegalDisclosureResp, error)

	CreateLegalDisclosureWithResponse(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, body CreateLegalDisclosureJSONRequestBody) (*CreateLegalDisclosureResp, error)

	// CreateNegativeFeedbackRemoval request
	CreateNegativeFeedbackRemovalWithResponse(ctx context.Context, amazonOrderId string, params *CreateNegativeFeedbackRemovalParams) (*CreateNegativeFeedbackRemovalResp, error)

	// CreateUnexpectedProblem request  with any body
	CreateUnexpectedProblemWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, contentType string, body io.Reader) (*CreateUnexpectedProblemResp, error)

	CreateUnexpectedProblemWithResponse(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, body CreateUnexpectedProblemJSONRequestBody) (*CreateUnexpectedProblemResp, error)

	// CreateWarranty request  with any body
	CreateWarrantyWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, contentType string, body io.Reader) (*CreateWarrantyResp, error)

	CreateWarrantyWithResponse(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, body CreateWarrantyJSONRequestBody) (*CreateWarrantyResp, error)
}

type GetMessagingActionsForOrderResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetMessagingActionsForOrderResponse
}

// Status returns HTTPResponse.Status
func (r GetMessagingActionsForOrderResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GetMessagingActionsForOrderResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type GetAttributesResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *GetAttributesResponse
}

// Status returns HTTPResponse.Status
func (r GetAttributesResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r GetAttributesResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateAmazonMotorsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateAmazonMotorsResponse
}

// Status returns HTTPResponse.Status
func (r CreateAmazonMotorsResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateAmazonMotorsResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type ConfirmCustomizationDetailsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateConfirmCustomizationDetailsResponse
}

// Status returns HTTPResponse.Status
func (r ConfirmCustomizationDetailsResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r ConfirmCustomizationDetailsResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateConfirmDeliveryDetailsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateConfirmDeliveryDetailsResponse
}

// Status returns HTTPResponse.Status
func (r CreateConfirmDeliveryDetailsResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateConfirmDeliveryDetailsResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateConfirmOrderDetailsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateConfirmOrderDetailsResponse
}

// Status returns HTTPResponse.Status
func (r CreateConfirmOrderDetailsResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateConfirmOrderDetailsResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateConfirmServiceDetailsResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateConfirmServiceDetailsResponse
}

// Status returns HTTPResponse.Status
func (r CreateConfirmServiceDetailsResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateConfirmServiceDetailsResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateDigitalAccessKeyResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateDigitalAccessKeyResponse
}

// Status returns HTTPResponse.Status
func (r CreateDigitalAccessKeyResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateDigitalAccessKeyResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateLegalDisclosureResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateLegalDisclosureResponse
}

// Status returns HTTPResponse.Status
func (r CreateLegalDisclosureResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateLegalDisclosureResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateNegativeFeedbackRemovalResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateNegativeFeedbackRemovalResponse
}

// Status returns HTTPResponse.Status
func (r CreateNegativeFeedbackRemovalResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateNegativeFeedbackRemovalResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateUnexpectedProblemResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateUnexpectedProblemResponse
}

// Status returns HTTPResponse.Status
func (r CreateUnexpectedProblemResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateUnexpectedProblemResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

type CreateWarrantyResp struct {
	Body         []byte
	HTTPResponse *http.Response
	Model        *CreateWarrantyResponse
}

// Status returns HTTPResponse.Status
func (r CreateWarrantyResp) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateWarrantyResp) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// GetMessagingActionsForOrderWithResponse request returning *GetMessagingActionsForOrderResponse
func (c *ClientWithResponses) GetMessagingActionsForOrderWithResponse(ctx context.Context, amazonOrderId string, params *GetMessagingActionsForOrderParams) (*GetMessagingActionsForOrderResp, error) {
	rsp, err := c.GetMessagingActionsForOrder(ctx, amazonOrderId, params)
	if err != nil {
		return nil, err
	}
	return ParseGetMessagingActionsForOrderResp(rsp)
}

// GetAttributesWithResponse request returning *GetAttributesResponse
func (c *ClientWithResponses) GetAttributesWithResponse(ctx context.Context, amazonOrderId string, params *GetAttributesParams) (*GetAttributesResp, error) {
	rsp, err := c.GetAttributes(ctx, amazonOrderId, params)
	if err != nil {
		return nil, err
	}
	return ParseGetAttributesResp(rsp)
}

// CreateAmazonMotorsWithBodyWithResponse request with arbitrary body returning *CreateAmazonMotorsResponse
func (c *ClientWithResponses) CreateAmazonMotorsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, contentType string, body io.Reader) (*CreateAmazonMotorsResp, error) {
	rsp, err := c.CreateAmazonMotorsWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateAmazonMotorsResp(rsp)
}

func (c *ClientWithResponses) CreateAmazonMotorsWithResponse(ctx context.Context, amazonOrderId string, params *CreateAmazonMotorsParams, body CreateAmazonMotorsJSONRequestBody) (*CreateAmazonMotorsResp, error) {
	rsp, err := c.CreateAmazonMotors(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateAmazonMotorsResp(rsp)
}

// ConfirmCustomizationDetailsWithBodyWithResponse request with arbitrary body returning *ConfirmCustomizationDetailsResponse
func (c *ClientWithResponses) ConfirmCustomizationDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, contentType string, body io.Reader) (*ConfirmCustomizationDetailsResp, error) {
	rsp, err := c.ConfirmCustomizationDetailsWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseConfirmCustomizationDetailsResp(rsp)
}

func (c *ClientWithResponses) ConfirmCustomizationDetailsWithResponse(ctx context.Context, amazonOrderId string, params *ConfirmCustomizationDetailsParams, body ConfirmCustomizationDetailsJSONRequestBody) (*ConfirmCustomizationDetailsResp, error) {
	rsp, err := c.ConfirmCustomizationDetails(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseConfirmCustomizationDetailsResp(rsp)
}

// CreateConfirmDeliveryDetailsWithBodyWithResponse request with arbitrary body returning *CreateConfirmDeliveryDetailsResponse
func (c *ClientWithResponses) CreateConfirmDeliveryDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, contentType string, body io.Reader) (*CreateConfirmDeliveryDetailsResp, error) {
	rsp, err := c.CreateConfirmDeliveryDetailsWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateConfirmDeliveryDetailsResp(rsp)
}

func (c *ClientWithResponses) CreateConfirmDeliveryDetailsWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmDeliveryDetailsParams, body CreateConfirmDeliveryDetailsJSONRequestBody) (*CreateConfirmDeliveryDetailsResp, error) {
	rsp, err := c.CreateConfirmDeliveryDetails(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateConfirmDeliveryDetailsResp(rsp)
}

// CreateConfirmOrderDetailsWithBodyWithResponse request with arbitrary body returning *CreateConfirmOrderDetailsResponse
func (c *ClientWithResponses) CreateConfirmOrderDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, contentType string, body io.Reader) (*CreateConfirmOrderDetailsResp, error) {
	rsp, err := c.CreateConfirmOrderDetailsWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateConfirmOrderDetailsResp(rsp)
}

func (c *ClientWithResponses) CreateConfirmOrderDetailsWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmOrderDetailsParams, body CreateConfirmOrderDetailsJSONRequestBody) (*CreateConfirmOrderDetailsResp, error) {
	rsp, err := c.CreateConfirmOrderDetails(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateConfirmOrderDetailsResp(rsp)
}

// CreateConfirmServiceDetailsWithBodyWithResponse request with arbitrary body returning *CreateConfirmServiceDetailsResponse
func (c *ClientWithResponses) CreateConfirmServiceDetailsWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, contentType string, body io.Reader) (*CreateConfirmServiceDetailsResp, error) {
	rsp, err := c.CreateConfirmServiceDetailsWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateConfirmServiceDetailsResp(rsp)
}

func (c *ClientWithResponses) CreateConfirmServiceDetailsWithResponse(ctx context.Context, amazonOrderId string, params *CreateConfirmServiceDetailsParams, body CreateConfirmServiceDetailsJSONRequestBody) (*CreateConfirmServiceDetailsResp, error) {
	rsp, err := c.CreateConfirmServiceDetails(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateConfirmServiceDetailsResp(rsp)
}

// CreateDigitalAccessKeyWithBodyWithResponse request with arbitrary body returning *CreateDigitalAccessKeyResponse
func (c *ClientWithResponses) CreateDigitalAccessKeyWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, contentType string, body io.Reader) (*CreateDigitalAccessKeyResp, error) {
	rsp, err := c.CreateDigitalAccessKeyWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateDigitalAccessKeyResp(rsp)
}

func (c *ClientWithResponses) CreateDigitalAccessKeyWithResponse(ctx context.Context, amazonOrderId string, params *CreateDigitalAccessKeyParams, body CreateDigitalAccessKeyJSONRequestBody) (*CreateDigitalAccessKeyResp, error) {
	rsp, err := c.CreateDigitalAccessKey(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateDigitalAccessKeyResp(rsp)
}

// CreateLegalDisclosureWithBodyWithResponse request with arbitrary body returning *CreateLegalDisclosureResponse
func (c *ClientWithResponses) CreateLegalDisclosureWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, contentType string, body io.Reader) (*CreateLegalDisclosureResp, error) {
	rsp, err := c.CreateLegalDisclosureWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateLegalDisclosureResp(rsp)
}

func (c *ClientWithResponses) CreateLegalDisclosureWithResponse(ctx context.Context, amazonOrderId string, params *CreateLegalDisclosureParams, body CreateLegalDisclosureJSONRequestBody) (*CreateLegalDisclosureResp, error) {
	rsp, err := c.CreateLegalDisclosure(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateLegalDisclosureResp(rsp)
}

// CreateNegativeFeedbackRemovalWithResponse request returning *CreateNegativeFeedbackRemovalResponse
func (c *ClientWithResponses) CreateNegativeFeedbackRemovalWithResponse(ctx context.Context, amazonOrderId string, params *CreateNegativeFeedbackRemovalParams) (*CreateNegativeFeedbackRemovalResp, error) {
	rsp, err := c.CreateNegativeFeedbackRemoval(ctx, amazonOrderId, params)
	if err != nil {
		return nil, err
	}
	return ParseCreateNegativeFeedbackRemovalResp(rsp)
}

// CreateUnexpectedProblemWithBodyWithResponse request with arbitrary body returning *CreateUnexpectedProblemResponse
func (c *ClientWithResponses) CreateUnexpectedProblemWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, contentType string, body io.Reader) (*CreateUnexpectedProblemResp, error) {
	rsp, err := c.CreateUnexpectedProblemWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateUnexpectedProblemResp(rsp)
}

func (c *ClientWithResponses) CreateUnexpectedProblemWithResponse(ctx context.Context, amazonOrderId string, params *CreateUnexpectedProblemParams, body CreateUnexpectedProblemJSONRequestBody) (*CreateUnexpectedProblemResp, error) {
	rsp, err := c.CreateUnexpectedProblem(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateUnexpectedProblemResp(rsp)
}

// CreateWarrantyWithBodyWithResponse request with arbitrary body returning *CreateWarrantyResponse
func (c *ClientWithResponses) CreateWarrantyWithBodyWithResponse(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, contentType string, body io.Reader) (*CreateWarrantyResp, error) {
	rsp, err := c.CreateWarrantyWithBody(ctx, amazonOrderId, params, contentType, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateWarrantyResp(rsp)
}

func (c *ClientWithResponses) CreateWarrantyWithResponse(ctx context.Context, amazonOrderId string, params *CreateWarrantyParams, body CreateWarrantyJSONRequestBody) (*CreateWarrantyResp, error) {
	rsp, err := c.CreateWarranty(ctx, amazonOrderId, params, body)
	if err != nil {
		return nil, err
	}
	return ParseCreateWarrantyResp(rsp)
}

// ParseGetMessagingActionsForOrderResp parses an HTTP response from a GetMessagingActionsForOrderWithResponse call
func ParseGetMessagingActionsForOrderResp(rsp *http.Response) (*GetMessagingActionsForOrderResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &GetMessagingActionsForOrderResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest GetMessagingActionsForOrderResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseGetAttributesResp parses an HTTP response from a GetAttributesWithResponse call
func ParseGetAttributesResp(rsp *http.Response) (*GetAttributesResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &GetAttributesResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest GetAttributesResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateAmazonMotorsResp parses an HTTP response from a CreateAmazonMotorsWithResponse call
func ParseCreateAmazonMotorsResp(rsp *http.Response) (*CreateAmazonMotorsResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateAmazonMotorsResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateAmazonMotorsResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseConfirmCustomizationDetailsResp parses an HTTP response from a ConfirmCustomizationDetailsWithResponse call
func ParseConfirmCustomizationDetailsResp(rsp *http.Response) (*ConfirmCustomizationDetailsResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &ConfirmCustomizationDetailsResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateConfirmCustomizationDetailsResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateConfirmDeliveryDetailsResp parses an HTTP response from a CreateConfirmDeliveryDetailsWithResponse call
func ParseCreateConfirmDeliveryDetailsResp(rsp *http.Response) (*CreateConfirmDeliveryDetailsResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateConfirmDeliveryDetailsResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateConfirmDeliveryDetailsResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateConfirmOrderDetailsResp parses an HTTP response from a CreateConfirmOrderDetailsWithResponse call
func ParseCreateConfirmOrderDetailsResp(rsp *http.Response) (*CreateConfirmOrderDetailsResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateConfirmOrderDetailsResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateConfirmOrderDetailsResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateConfirmServiceDetailsResp parses an HTTP response from a CreateConfirmServiceDetailsWithResponse call
func ParseCreateConfirmServiceDetailsResp(rsp *http.Response) (*CreateConfirmServiceDetailsResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateConfirmServiceDetailsResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateConfirmServiceDetailsResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateDigitalAccessKeyResp parses an HTTP response from a CreateDigitalAccessKeyWithResponse call
func ParseCreateDigitalAccessKeyResp(rsp *http.Response) (*CreateDigitalAccessKeyResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateDigitalAccessKeyResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateDigitalAccessKeyResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateLegalDisclosureResp parses an HTTP response from a CreateLegalDisclosureWithResponse call
func ParseCreateLegalDisclosureResp(rsp *http.Response) (*CreateLegalDisclosureResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateLegalDisclosureResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateLegalDisclosureResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateNegativeFeedbackRemovalResp parses an HTTP response from a CreateNegativeFeedbackRemovalWithResponse call
func ParseCreateNegativeFeedbackRemovalResp(rsp *http.Response) (*CreateNegativeFeedbackRemovalResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateNegativeFeedbackRemovalResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateNegativeFeedbackRemovalResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateUnexpectedProblemResp parses an HTTP response from a CreateUnexpectedProblemWithResponse call
func ParseCreateUnexpectedProblemResp(rsp *http.Response) (*CreateUnexpectedProblemResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateUnexpectedProblemResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateUnexpectedProblemResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}

// ParseCreateWarrantyResp parses an HTTP response from a CreateWarrantyWithResponse call
func ParseCreateWarrantyResp(rsp *http.Response) (*CreateWarrantyResp, error) {
	bodyBytes, err := ioutil.ReadAll(rsp.Body)
	defer rsp.Body.Close()
	if err != nil {
		return nil, err
	}

	response := &CreateWarrantyResp{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	var dest CreateWarrantyResponse
	if err := json.Unmarshal(bodyBytes, &dest); err != nil {
		return nil, err
	}

	response.Model = &dest

	if rsp.StatusCode >= 300 {
		err = fmt.Errorf(rsp.Status)
	}

	return response, err
}
