github.com/cilium/cilium@v1.16.2/api/v1/client/service/get_lrp_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 "fmt" 13 "io" 14 15 "github.com/go-openapi/runtime" 16 "github.com/go-openapi/strfmt" 17 18 "github.com/cilium/cilium/api/v1/models" 19 ) 20 21 // GetLrpReader is a Reader for the GetLrp structure. 22 type GetLrpReader struct { 23 formats strfmt.Registry 24 } 25 26 // ReadResponse reads a server response into the received o. 27 func (o *GetLrpReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 28 switch response.Code() { 29 case 200: 30 result := NewGetLrpOK() 31 if err := result.readResponse(response, consumer, o.formats); err != nil { 32 return nil, err 33 } 34 return result, nil 35 default: 36 return nil, runtime.NewAPIError("[GET /lrp] GetLrp", response, response.Code()) 37 } 38 } 39 40 // NewGetLrpOK creates a GetLrpOK with default headers values 41 func NewGetLrpOK() *GetLrpOK { 42 return &GetLrpOK{} 43 } 44 45 /* 46 GetLrpOK describes a response with status code 200, with default header values. 47 48 Success 49 */ 50 type GetLrpOK struct { 51 Payload []*models.LRPSpec 52 } 53 54 // IsSuccess returns true when this get lrp o k response has a 2xx status code 55 func (o *GetLrpOK) IsSuccess() bool { 56 return true 57 } 58 59 // IsRedirect returns true when this get lrp o k response has a 3xx status code 60 func (o *GetLrpOK) IsRedirect() bool { 61 return false 62 } 63 64 // IsClientError returns true when this get lrp o k response has a 4xx status code 65 func (o *GetLrpOK) IsClientError() bool { 66 return false 67 } 68 69 // IsServerError returns true when this get lrp o k response has a 5xx status code 70 func (o *GetLrpOK) IsServerError() bool { 71 return false 72 } 73 74 // IsCode returns true when this get lrp o k response a status code equal to that given 75 func (o *GetLrpOK) IsCode(code int) bool { 76 return code == 200 77 } 78 79 // Code gets the status code for the get lrp o k response 80 func (o *GetLrpOK) Code() int { 81 return 200 82 } 83 84 func (o *GetLrpOK) Error() string { 85 return fmt.Sprintf("[GET /lrp][%d] getLrpOK %+v", 200, o.Payload) 86 } 87 88 func (o *GetLrpOK) String() string { 89 return fmt.Sprintf("[GET /lrp][%d] getLrpOK %+v", 200, o.Payload) 90 } 91 92 func (o *GetLrpOK) GetPayload() []*models.LRPSpec { 93 return o.Payload 94 } 95 96 func (o *GetLrpOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 97 98 // response payload 99 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 100 return err 101 } 102 103 return nil 104 }