github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/service/delete_service_id_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package service
     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/runtime"
    12  
    13  	models "github.com/cilium/cilium/api/v1/models"
    14  )
    15  
    16  // DeleteServiceIDOKCode is the HTTP code returned for type DeleteServiceIDOK
    17  const DeleteServiceIDOKCode int = 200
    18  
    19  /*DeleteServiceIDOK Success
    20  
    21  swagger:response deleteServiceIdOK
    22  */
    23  type DeleteServiceIDOK struct {
    24  }
    25  
    26  // NewDeleteServiceIDOK creates DeleteServiceIDOK with default headers values
    27  func NewDeleteServiceIDOK() *DeleteServiceIDOK {
    28  
    29  	return &DeleteServiceIDOK{}
    30  }
    31  
    32  // WriteResponse to the client
    33  func (o *DeleteServiceIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    34  
    35  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    36  
    37  	rw.WriteHeader(200)
    38  }
    39  
    40  // DeleteServiceIDNotFoundCode is the HTTP code returned for type DeleteServiceIDNotFound
    41  const DeleteServiceIDNotFoundCode int = 404
    42  
    43  /*DeleteServiceIDNotFound Service not found
    44  
    45  swagger:response deleteServiceIdNotFound
    46  */
    47  type DeleteServiceIDNotFound struct {
    48  }
    49  
    50  // NewDeleteServiceIDNotFound creates DeleteServiceIDNotFound with default headers values
    51  func NewDeleteServiceIDNotFound() *DeleteServiceIDNotFound {
    52  
    53  	return &DeleteServiceIDNotFound{}
    54  }
    55  
    56  // WriteResponse to the client
    57  func (o *DeleteServiceIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    58  
    59  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    60  
    61  	rw.WriteHeader(404)
    62  }
    63  
    64  // DeleteServiceIDFailureCode is the HTTP code returned for type DeleteServiceIDFailure
    65  const DeleteServiceIDFailureCode int = 500
    66  
    67  /*DeleteServiceIDFailure Service deletion failed
    68  
    69  swagger:response deleteServiceIdFailure
    70  */
    71  type DeleteServiceIDFailure struct {
    72  
    73  	/*
    74  	  In: Body
    75  	*/
    76  	Payload models.Error `json:"body,omitempty"`
    77  }
    78  
    79  // NewDeleteServiceIDFailure creates DeleteServiceIDFailure with default headers values
    80  func NewDeleteServiceIDFailure() *DeleteServiceIDFailure {
    81  
    82  	return &DeleteServiceIDFailure{}
    83  }
    84  
    85  // WithPayload adds the payload to the delete service Id failure response
    86  func (o *DeleteServiceIDFailure) WithPayload(payload models.Error) *DeleteServiceIDFailure {
    87  	o.Payload = payload
    88  	return o
    89  }
    90  
    91  // SetPayload sets the payload to the delete service Id failure response
    92  func (o *DeleteServiceIDFailure) SetPayload(payload models.Error) {
    93  	o.Payload = payload
    94  }
    95  
    96  // WriteResponse to the client
    97  func (o *DeleteServiceIDFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    98  
    99  	rw.WriteHeader(500)
   100  	payload := o.Payload
   101  	if err := producer.Produce(rw, payload); err != nil {
   102  		panic(err) // let the recovery middleware deal with this
   103  	}
   104  }