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