github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/service/get_service_id_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Authors of Cilium
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package service
     7  
     8  // This file was generated by the swagger tool.
     9  // Editing this file might prove futile when you re-run the swagger generate command
    10  
    11  import (
    12  	"net/http"
    13  
    14  	"github.com/go-openapi/runtime"
    15  
    16  	"github.com/cilium/cilium/api/v1/models"
    17  )
    18  
    19  // GetServiceIDOKCode is the HTTP code returned for type GetServiceIDOK
    20  const GetServiceIDOKCode int = 200
    21  
    22  /*
    23  GetServiceIDOK Success
    24  
    25  swagger:response getServiceIdOK
    26  */
    27  type GetServiceIDOK struct {
    28  
    29  	/*
    30  	  In: Body
    31  	*/
    32  	Payload *models.Service `json:"body,omitempty"`
    33  }
    34  
    35  // NewGetServiceIDOK creates GetServiceIDOK with default headers values
    36  func NewGetServiceIDOK() *GetServiceIDOK {
    37  
    38  	return &GetServiceIDOK{}
    39  }
    40  
    41  // WithPayload adds the payload to the get service Id o k response
    42  func (o *GetServiceIDOK) WithPayload(payload *models.Service) *GetServiceIDOK {
    43  	o.Payload = payload
    44  	return o
    45  }
    46  
    47  // SetPayload sets the payload to the get service Id o k response
    48  func (o *GetServiceIDOK) SetPayload(payload *models.Service) {
    49  	o.Payload = payload
    50  }
    51  
    52  // WriteResponse to the client
    53  func (o *GetServiceIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    54  
    55  	rw.WriteHeader(200)
    56  	if o.Payload != nil {
    57  		payload := o.Payload
    58  		if err := producer.Produce(rw, payload); err != nil {
    59  			panic(err) // let the recovery middleware deal with this
    60  		}
    61  	}
    62  }
    63  
    64  // GetServiceIDNotFoundCode is the HTTP code returned for type GetServiceIDNotFound
    65  const GetServiceIDNotFoundCode int = 404
    66  
    67  /*
    68  GetServiceIDNotFound Service not found
    69  
    70  swagger:response getServiceIdNotFound
    71  */
    72  type GetServiceIDNotFound struct {
    73  }
    74  
    75  // NewGetServiceIDNotFound creates GetServiceIDNotFound with default headers values
    76  func NewGetServiceIDNotFound() *GetServiceIDNotFound {
    77  
    78  	return &GetServiceIDNotFound{}
    79  }
    80  
    81  // WriteResponse to the client
    82  func (o *GetServiceIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    83  
    84  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    85  
    86  	rw.WriteHeader(404)
    87  }