orders

package
v0.0.0-...-3ce5cd6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const CheckoutCreatedCode int = 201

CheckoutCreatedCode is the HTTP code returned for type CheckoutCreated

View Source
const ViewOneOrderOKCode int = 200

ViewOneOrderOKCode is the HTTP code returned for type ViewOneOrderOK

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkout

type Checkout struct {
	Context *middleware.Context
	Handler CheckoutHandler
}

Checkout swagger:route POST /orders orders checkout

Create order for the cart

func NewCheckout

func NewCheckout(ctx *middleware.Context, handler CheckoutHandler) *Checkout

NewCheckout creates a new http.Handler for the checkout operation

func (*Checkout) ServeHTTP

func (o *Checkout) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type CheckoutBody

type CheckoutBody struct {

	// cart id
	// Required: true
	// Format: uuid
	CartID *strfmt.UUID `json:"cart_id"`

	// customer address
	// Required: true
	// Min Length: 1
	CustomerAddress *string `json:"customer_address"`

	// customer email
	// Required: true
	// Min Length: 1
	// Format: email
	CustomerEmail *strfmt.Email `json:"customer_email"`

	// customer name
	// Required: true
	// Min Length: 1
	CustomerName *string `json:"customer_name"`
}

CheckoutBody checkout body

swagger:model CheckoutBody

func (*CheckoutBody) MarshalBinary

func (o *CheckoutBody) MarshalBinary() ([]byte, error)

MarshalBinary interface implementation

func (*CheckoutBody) UnmarshalBinary

func (o *CheckoutBody) UnmarshalBinary(b []byte) error

UnmarshalBinary interface implementation

func (*CheckoutBody) Validate

func (o *CheckoutBody) Validate(formats strfmt.Registry) error

Validate validates this checkout body

type CheckoutCreated

type CheckoutCreated struct {

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

CheckoutCreated Created new order from cart

swagger:response checkoutCreated

func NewCheckoutCreated

func NewCheckoutCreated() *CheckoutCreated

NewCheckoutCreated creates CheckoutCreated with default headers values

func (*CheckoutCreated) SetPayload

func (o *CheckoutCreated) SetPayload(payload *models.Order)

SetPayload sets the payload to the checkout created response

func (*CheckoutCreated) WithPayload

func (o *CheckoutCreated) WithPayload(payload *models.Order) *CheckoutCreated

WithPayload adds the payload to the checkout created response

func (*CheckoutCreated) WriteResponse

func (o *CheckoutCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type CheckoutDefault

type CheckoutDefault struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
	// contains filtered or unexported fields
}

CheckoutDefault error

swagger:response checkoutDefault

func NewCheckoutDefault

func NewCheckoutDefault(code int) *CheckoutDefault

NewCheckoutDefault creates CheckoutDefault with default headers values

func (*CheckoutDefault) SetPayload

func (o *CheckoutDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the checkout default response

func (*CheckoutDefault) SetStatusCode

func (o *CheckoutDefault) SetStatusCode(code int)

SetStatusCode sets the status to the checkout default response

func (*CheckoutDefault) WithPayload

func (o *CheckoutDefault) WithPayload(payload *models.Error) *CheckoutDefault

WithPayload adds the payload to the checkout default response

func (*CheckoutDefault) WithStatusCode

func (o *CheckoutDefault) WithStatusCode(code int) *CheckoutDefault

WithStatusCode adds the status to the checkout default response

func (*CheckoutDefault) WriteResponse

func (o *CheckoutDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type CheckoutHandler

type CheckoutHandler interface {
	Handle(CheckoutParams) middleware.Responder
}

CheckoutHandler interface for that can handle valid checkout params

type CheckoutHandlerFunc

type CheckoutHandlerFunc func(CheckoutParams) middleware.Responder

CheckoutHandlerFunc turns a function with the right signature into a checkout handler

func (CheckoutHandlerFunc) Handle

Handle executing the request and returning a response

type CheckoutParams

type CheckoutParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*
	  Required: true
	  In: body
	*/
	Body CheckoutBody
}

CheckoutParams contains all the bound params for the checkout operation typically these are obtained from a http.Request

swagger:parameters checkout

func NewCheckoutParams

func NewCheckoutParams() CheckoutParams

NewCheckoutParams creates a new CheckoutParams object no default values defined in spec.

func (*CheckoutParams) BindRequest

func (o *CheckoutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewCheckoutParams() beforehand.

type CheckoutURL

type CheckoutURL struct {
	// contains filtered or unexported fields
}

CheckoutURL generates an URL for the checkout operation

func (*CheckoutURL) Build

func (o *CheckoutURL) Build() (*url.URL, error)

Build a url path and query string

func (*CheckoutURL) BuildFull

func (o *CheckoutURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*CheckoutURL) Must

func (o *CheckoutURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*CheckoutURL) SetBasePath

func (o *CheckoutURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*CheckoutURL) String

func (o *CheckoutURL) String() string

String returns the string representation of the path with query string

func (*CheckoutURL) StringFull

func (o *CheckoutURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*CheckoutURL) WithBasePath

func (o *CheckoutURL) WithBasePath(bp string) *CheckoutURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

type ViewOneOrder

type ViewOneOrder struct {
	Context *middleware.Context
	Handler ViewOneOrderHandler
}

ViewOneOrder swagger:route GET /orders/{orderId} orders viewOneOrder

View order details

func NewViewOneOrder

func NewViewOneOrder(ctx *middleware.Context, handler ViewOneOrderHandler) *ViewOneOrder

NewViewOneOrder creates a new http.Handler for the view one order operation

func (*ViewOneOrder) ServeHTTP

func (o *ViewOneOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type ViewOneOrderDefault

type ViewOneOrderDefault struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
	// contains filtered or unexported fields
}

ViewOneOrderDefault error

swagger:response viewOneOrderDefault

func NewViewOneOrderDefault

func NewViewOneOrderDefault(code int) *ViewOneOrderDefault

NewViewOneOrderDefault creates ViewOneOrderDefault with default headers values

func (*ViewOneOrderDefault) SetPayload

func (o *ViewOneOrderDefault) SetPayload(payload *models.Error)

SetPayload sets the payload to the view one order default response

func (*ViewOneOrderDefault) SetStatusCode

func (o *ViewOneOrderDefault) SetStatusCode(code int)

SetStatusCode sets the status to the view one order default response

func (*ViewOneOrderDefault) WithPayload

func (o *ViewOneOrderDefault) WithPayload(payload *models.Error) *ViewOneOrderDefault

WithPayload adds the payload to the view one order default response

func (*ViewOneOrderDefault) WithStatusCode

func (o *ViewOneOrderDefault) WithStatusCode(code int) *ViewOneOrderDefault

WithStatusCode adds the status to the view one order default response

func (*ViewOneOrderDefault) WriteResponse

func (o *ViewOneOrderDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type ViewOneOrderHandler

type ViewOneOrderHandler interface {
	Handle(ViewOneOrderParams) middleware.Responder
}

ViewOneOrderHandler interface for that can handle valid view one order params

type ViewOneOrderHandlerFunc

type ViewOneOrderHandlerFunc func(ViewOneOrderParams) middleware.Responder

ViewOneOrderHandlerFunc turns a function with the right signature into a view one order handler

func (ViewOneOrderHandlerFunc) Handle

Handle executing the request and returning a response

type ViewOneOrderOK

type ViewOneOrderOK struct {

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

ViewOneOrderOK Returned one order

swagger:response viewOneOrderOK

func NewViewOneOrderOK

func NewViewOneOrderOK() *ViewOneOrderOK

NewViewOneOrderOK creates ViewOneOrderOK with default headers values

func (*ViewOneOrderOK) SetPayload

func (o *ViewOneOrderOK) SetPayload(payload *models.Order)

SetPayload sets the payload to the view one order o k response

func (*ViewOneOrderOK) WithPayload

func (o *ViewOneOrderOK) WithPayload(payload *models.Order) *ViewOneOrderOK

WithPayload adds the payload to the view one order o k response

func (*ViewOneOrderOK) WriteResponse

func (o *ViewOneOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer)

WriteResponse to the client

type ViewOneOrderParams

type ViewOneOrderParams struct {

	// HTTP Request Object
	HTTPRequest *http.Request `json:"-"`

	/*
	  Required: true
	  In: path
	*/
	OrderID strfmt.UUID
}

ViewOneOrderParams contains all the bound params for the view one order operation typically these are obtained from a http.Request

swagger:parameters viewOneOrder

func NewViewOneOrderParams

func NewViewOneOrderParams() ViewOneOrderParams

NewViewOneOrderParams creates a new ViewOneOrderParams object no default values defined in spec.

func (*ViewOneOrderParams) BindRequest

func (o *ViewOneOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error

BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface for simple values it will use straight method calls.

To ensure default values, the struct must have been initialized with NewViewOneOrderParams() beforehand.

type ViewOneOrderURL

type ViewOneOrderURL struct {
	OrderID strfmt.UUID
	// contains filtered or unexported fields
}

ViewOneOrderURL generates an URL for the view one order operation

func (*ViewOneOrderURL) Build

func (o *ViewOneOrderURL) Build() (*url.URL, error)

Build a url path and query string

func (*ViewOneOrderURL) BuildFull

func (o *ViewOneOrderURL) BuildFull(scheme, host string) (*url.URL, error)

BuildFull builds a full url with scheme, host, path and query string

func (*ViewOneOrderURL) Must

func (o *ViewOneOrderURL) Must(u *url.URL, err error) *url.URL

Must is a helper function to panic when the url builder returns an error

func (*ViewOneOrderURL) SetBasePath

func (o *ViewOneOrderURL) SetBasePath(bp string)

SetBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

func (*ViewOneOrderURL) String

func (o *ViewOneOrderURL) String() string

String returns the string representation of the path with query string

func (*ViewOneOrderURL) StringFull

func (o *ViewOneOrderURL) StringFull(scheme, host string) string

StringFull returns the string representation of a complete url

func (*ViewOneOrderURL) WithBasePath

func (o *ViewOneOrderURL) WithBasePath(bp string) *ViewOneOrderURL

WithBasePath sets the base path for this url builder, only required when it's different from the base path specified in the swagger spec. When the value of the base path is an empty string

Jump to

Keyboard shortcuts

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