github.com/circl-dev/go-swagger@v0.31.0/examples/contributed-templates/stratoscale/restapi/operations/store/order_get_responses.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/circl-dev/runtime"
    12  
    13  	"github.com/circl-dev/go-swagger/examples/contributed-templates/stratoscale/models"
    14  )
    15  
    16  // OrderGetOKCode is the HTTP code returned for type OrderGetOK
    17  const OrderGetOKCode int = 200
    18  
    19  /*OrderGetOK successful operation
    20  
    21  swagger:response orderGetOK
    22  */
    23  type OrderGetOK struct {
    24  
    25  	/*
    26  	  In: Body
    27  	*/
    28  	Payload *models.Order `json:"body,omitempty"`
    29  }
    30  
    31  // NewOrderGetOK creates OrderGetOK with default headers values
    32  func NewOrderGetOK() *OrderGetOK {
    33  
    34  	return &OrderGetOK{}
    35  }
    36  
    37  // WithPayload adds the payload to the order get o k response
    38  func (o *OrderGetOK) WithPayload(payload *models.Order) *OrderGetOK {
    39  	o.Payload = payload
    40  	return o
    41  }
    42  
    43  // SetPayload sets the payload to the order get o k response
    44  func (o *OrderGetOK) SetPayload(payload *models.Order) {
    45  	o.Payload = payload
    46  }
    47  
    48  // WriteResponse to the client
    49  func (o *OrderGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    50  
    51  	rw.WriteHeader(200)
    52  	if o.Payload != nil {
    53  		payload := o.Payload
    54  		if err := producer.Produce(rw, payload); err != nil {
    55  			panic(err) // let the recovery middleware deal with this
    56  		}
    57  	}
    58  }
    59  
    60  // OrderGetBadRequestCode is the HTTP code returned for type OrderGetBadRequest
    61  const OrderGetBadRequestCode int = 400
    62  
    63  /*OrderGetBadRequest Invalid ID supplied
    64  
    65  swagger:response orderGetBadRequest
    66  */
    67  type OrderGetBadRequest struct {
    68  }
    69  
    70  // NewOrderGetBadRequest creates OrderGetBadRequest with default headers values
    71  func NewOrderGetBadRequest() *OrderGetBadRequest {
    72  
    73  	return &OrderGetBadRequest{}
    74  }
    75  
    76  // WriteResponse to the client
    77  func (o *OrderGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    78  
    79  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    80  
    81  	rw.WriteHeader(400)
    82  }
    83  
    84  // OrderGetNotFoundCode is the HTTP code returned for type OrderGetNotFound
    85  const OrderGetNotFoundCode int = 404
    86  
    87  /*OrderGetNotFound Order not found
    88  
    89  swagger:response orderGetNotFound
    90  */
    91  type OrderGetNotFound struct {
    92  }
    93  
    94  // NewOrderGetNotFound creates OrderGetNotFound with default headers values
    95  func NewOrderGetNotFound() *OrderGetNotFound {
    96  
    97  	return &OrderGetNotFound{}
    98  }
    99  
   100  // WriteResponse to the client
   101  func (o *OrderGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   102  
   103  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   104  
   105  	rw.WriteHeader(404)
   106  }