// Code generated by go-swagger; DO NOT EDIT.

package product_management

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"net/http"

	"github.com/go-openapi/runtime"

	"github.com/Cyclops-Labs/cyclops-4-hpc.git/services/customerdb/models"
)

// ListProductsOKCode is the HTTP code returned for type ListProductsOK
const ListProductsOKCode int = 200

/*ListProductsOK List of products in the system returned

swagger:response listProductsOK
*/
type ListProductsOK struct {

	/*
	  In: Body
	*/
	Payload []*models.Product `json:"body,omitempty"`
}

// NewListProductsOK creates ListProductsOK with default headers values
func NewListProductsOK() *ListProductsOK {

	return &ListProductsOK{}
}

// WithPayload adds the payload to the list products o k response
func (o *ListProductsOK) WithPayload(payload []*models.Product) *ListProductsOK {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the list products o k response
func (o *ListProductsOK) SetPayload(payload []*models.Product) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *ListProductsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(200)
	payload := o.Payload
	if payload == nil {
		// return empty array
		payload = make([]*models.Product, 0, 50)
	}

	if err := producer.Produce(rw, payload); err != nil {
		panic(err) // let the recovery middleware deal with this
	}
}

// ListProductsInternalServerErrorCode is the HTTP code returned for type ListProductsInternalServerError
const ListProductsInternalServerErrorCode int = 500

/*ListProductsInternalServerError Something unexpected happend, error raised

swagger:response listProductsInternalServerError
*/
type ListProductsInternalServerError struct {

	/*
	  In: Body
	*/
	Payload *models.ErrorResponse `json:"body,omitempty"`
}

// NewListProductsInternalServerError creates ListProductsInternalServerError with default headers values
func NewListProductsInternalServerError() *ListProductsInternalServerError {

	return &ListProductsInternalServerError{}
}

// WithPayload adds the payload to the list products internal server error response
func (o *ListProductsInternalServerError) WithPayload(payload *models.ErrorResponse) *ListProductsInternalServerError {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the list products internal server error response
func (o *ListProductsInternalServerError) SetPayload(payload *models.ErrorResponse) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *ListProductsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(500)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}
