github.com/circl-dev/go-swagger@v0.31.0/examples/todo-list-strict/restapi/operations/todos/update_one_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package todos
     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  	"github.com/circl-dev/runtime/middleware"
    13  
    14  	"github.com/circl-dev/go-swagger/examples/todo-list-strict/models"
    15  )
    16  
    17  // UpdateOneOKCode is the HTTP code returned for type UpdateOneOK
    18  const UpdateOneOKCode int = 200
    19  
    20  /*UpdateOneOK OK
    21  
    22  swagger:response updateOneOK
    23  */
    24  type UpdateOneOK struct {
    25  
    26  	/*
    27  	  In: Body
    28  	*/
    29  	Payload *models.Item `json:"body,omitempty"`
    30  }
    31  
    32  // NewUpdateOneOK creates UpdateOneOK with default headers values
    33  func NewUpdateOneOK() *UpdateOneOK {
    34  
    35  	return &UpdateOneOK{}
    36  }
    37  
    38  // WithPayload adds the payload to the update one o k response
    39  func (o *UpdateOneOK) WithPayload(payload *models.Item) *UpdateOneOK {
    40  	o.Payload = payload
    41  	return o
    42  }
    43  
    44  // SetPayload sets the payload to the update one o k response
    45  func (o *UpdateOneOK) SetPayload(payload *models.Item) {
    46  	o.Payload = payload
    47  }
    48  
    49  // WriteResponse to the client
    50  func (o *UpdateOneOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    51  
    52  	rw.WriteHeader(200)
    53  	if o.Payload != nil {
    54  		payload := o.Payload
    55  		if err := producer.Produce(rw, payload); err != nil {
    56  			panic(err) // let the recovery middleware deal with this
    57  		}
    58  	}
    59  }
    60  
    61  func (o *UpdateOneOK) UpdateOneResponder() {}
    62  
    63  /*UpdateOneDefault error
    64  
    65  swagger:response updateOneDefault
    66  */
    67  type UpdateOneDefault struct {
    68  	_statusCode int
    69  
    70  	/*
    71  	  In: Body
    72  	*/
    73  	Payload *models.Error `json:"body,omitempty"`
    74  }
    75  
    76  // NewUpdateOneDefault creates UpdateOneDefault with default headers values
    77  func NewUpdateOneDefault(code int) *UpdateOneDefault {
    78  	if code <= 0 {
    79  		code = 500
    80  	}
    81  
    82  	return &UpdateOneDefault{
    83  		_statusCode: code,
    84  	}
    85  }
    86  
    87  // WithStatusCode adds the status to the update one default response
    88  func (o *UpdateOneDefault) WithStatusCode(code int) *UpdateOneDefault {
    89  	o._statusCode = code
    90  	return o
    91  }
    92  
    93  // SetStatusCode sets the status to the update one default response
    94  func (o *UpdateOneDefault) SetStatusCode(code int) {
    95  	o._statusCode = code
    96  }
    97  
    98  // WithPayload adds the payload to the update one default response
    99  func (o *UpdateOneDefault) WithPayload(payload *models.Error) *UpdateOneDefault {
   100  	o.Payload = payload
   101  	return o
   102  }
   103  
   104  // SetPayload sets the payload to the update one default response
   105  func (o *UpdateOneDefault) SetPayload(payload *models.Error) {
   106  	o.Payload = payload
   107  }
   108  
   109  // WriteResponse to the client
   110  func (o *UpdateOneDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   111  
   112  	rw.WriteHeader(o._statusCode)
   113  	if o.Payload != nil {
   114  		payload := o.Payload
   115  		if err := producer.Produce(rw, payload); err != nil {
   116  			panic(err) // let the recovery middleware deal with this
   117  		}
   118  	}
   119  }
   120  
   121  func (o *UpdateOneDefault) UpdateOneResponder() {}
   122  
   123  type UpdateOneNotImplementedResponder struct {
   124  	middleware.Responder
   125  }
   126  
   127  func (*UpdateOneNotImplementedResponder) UpdateOneResponder() {}
   128  
   129  func UpdateOneNotImplemented() UpdateOneResponder {
   130  	return &UpdateOneNotImplementedResponder{
   131  		middleware.NotImplemented(
   132  			"operation authentication.UpdateOne has not yet been implemented",
   133  		),
   134  	}
   135  }
   136  
   137  type UpdateOneResponder interface {
   138  	middleware.Responder
   139  	UpdateOneResponder()
   140  }