github.com/circl-dev/go-swagger@v0.31.0/examples/contributed-templates/stratoscale/restapi/operations/store/inventory_get_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package store
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"net/http"
    10  
    11  	"github.com/go-openapi/errors"
    12  	"github.com/circl-dev/runtime/middleware"
    13  )
    14  
    15  // NewInventoryGetParams creates a new InventoryGetParams object
    16  //
    17  // There are no default values defined in the spec.
    18  func NewInventoryGetParams() InventoryGetParams {
    19  
    20  	return InventoryGetParams{}
    21  }
    22  
    23  // InventoryGetParams contains all the bound params for the inventory get operation
    24  // typically these are obtained from a http.Request
    25  //
    26  // swagger:parameters InventoryGet
    27  type InventoryGetParams struct {
    28  
    29  	// HTTP Request Object
    30  	HTTPRequest *http.Request `json:"-"`
    31  }
    32  
    33  // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
    34  // for simple values it will use straight method calls.
    35  //
    36  // To ensure default values, the struct must have been initialized with NewInventoryGetParams() beforehand.
    37  func (o *InventoryGetParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
    38  	var res []error
    39  
    40  	o.HTTPRequest = r
    41  
    42  	if len(res) > 0 {
    43  		return errors.CompositeValidationError(res...)
    44  	}
    45  	return nil
    46  }