github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/bgp/get_bgp_peers_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 bgp
     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  // GetBgpPeersOKCode is the HTTP code returned for type GetBgpPeersOK
    20  const GetBgpPeersOKCode int = 200
    21  
    22  /*
    23  GetBgpPeersOK Success
    24  
    25  swagger:response getBgpPeersOK
    26  */
    27  type GetBgpPeersOK struct {
    28  
    29  	/*
    30  	  In: Body
    31  	*/
    32  	Payload []*models.BgpPeer `json:"body,omitempty"`
    33  }
    34  
    35  // NewGetBgpPeersOK creates GetBgpPeersOK with default headers values
    36  func NewGetBgpPeersOK() *GetBgpPeersOK {
    37  
    38  	return &GetBgpPeersOK{}
    39  }
    40  
    41  // WithPayload adds the payload to the get bgp peers o k response
    42  func (o *GetBgpPeersOK) WithPayload(payload []*models.BgpPeer) *GetBgpPeersOK {
    43  	o.Payload = payload
    44  	return o
    45  }
    46  
    47  // SetPayload sets the payload to the get bgp peers o k response
    48  func (o *GetBgpPeersOK) SetPayload(payload []*models.BgpPeer) {
    49  	o.Payload = payload
    50  }
    51  
    52  // WriteResponse to the client
    53  func (o *GetBgpPeersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    54  
    55  	rw.WriteHeader(200)
    56  	payload := o.Payload
    57  	if payload == nil {
    58  		// return empty array
    59  		payload = make([]*models.BgpPeer, 0, 50)
    60  	}
    61  
    62  	if err := producer.Produce(rw, payload); err != nil {
    63  		panic(err) // let the recovery middleware deal with this
    64  	}
    65  }
    66  
    67  // GetBgpPeersInternalServerErrorCode is the HTTP code returned for type GetBgpPeersInternalServerError
    68  const GetBgpPeersInternalServerErrorCode int = 500
    69  
    70  /*
    71  GetBgpPeersInternalServerError Internal Server Error
    72  
    73  swagger:response getBgpPeersInternalServerError
    74  */
    75  type GetBgpPeersInternalServerError struct {
    76  
    77  	/*
    78  	  In: Body
    79  	*/
    80  	Payload models.Error `json:"body,omitempty"`
    81  }
    82  
    83  // NewGetBgpPeersInternalServerError creates GetBgpPeersInternalServerError with default headers values
    84  func NewGetBgpPeersInternalServerError() *GetBgpPeersInternalServerError {
    85  
    86  	return &GetBgpPeersInternalServerError{}
    87  }
    88  
    89  // WithPayload adds the payload to the get bgp peers internal server error response
    90  func (o *GetBgpPeersInternalServerError) WithPayload(payload models.Error) *GetBgpPeersInternalServerError {
    91  	o.Payload = payload
    92  	return o
    93  }
    94  
    95  // SetPayload sets the payload to the get bgp peers internal server error response
    96  func (o *GetBgpPeersInternalServerError) SetPayload(payload models.Error) {
    97  	o.Payload = payload
    98  }
    99  
   100  // WriteResponse to the client
   101  func (o *GetBgpPeersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   102  
   103  	rw.WriteHeader(500)
   104  	payload := o.Payload
   105  	if err := producer.Produce(rw, payload); err != nil {
   106  		panic(err) // let the recovery middleware deal with this
   107  	}
   108  }
   109  
   110  // GetBgpPeersDisabledCode is the HTTP code returned for type GetBgpPeersDisabled
   111  const GetBgpPeersDisabledCode int = 501
   112  
   113  /*
   114  GetBgpPeersDisabled BGP Control Plane disabled
   115  
   116  swagger:response getBgpPeersDisabled
   117  */
   118  type GetBgpPeersDisabled struct {
   119  
   120  	/*
   121  	  In: Body
   122  	*/
   123  	Payload models.Error `json:"body,omitempty"`
   124  }
   125  
   126  // NewGetBgpPeersDisabled creates GetBgpPeersDisabled with default headers values
   127  func NewGetBgpPeersDisabled() *GetBgpPeersDisabled {
   128  
   129  	return &GetBgpPeersDisabled{}
   130  }
   131  
   132  // WithPayload adds the payload to the get bgp peers disabled response
   133  func (o *GetBgpPeersDisabled) WithPayload(payload models.Error) *GetBgpPeersDisabled {
   134  	o.Payload = payload
   135  	return o
   136  }
   137  
   138  // SetPayload sets the payload to the get bgp peers disabled response
   139  func (o *GetBgpPeersDisabled) SetPayload(payload models.Error) {
   140  	o.Payload = payload
   141  }
   142  
   143  // WriteResponse to the client
   144  func (o *GetBgpPeersDisabled) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   145  
   146  	rw.WriteHeader(501)
   147  	payload := o.Payload
   148  	if err := producer.Produce(rw, payload); err != nil {
   149  		panic(err) // let the recovery middleware deal with this
   150  	}
   151  }