github.com/kubearmor/cilium@v1.6.12/api/v1/client/daemon/patch_config_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package daemon 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 "fmt" 10 "io" 11 12 "github.com/go-openapi/runtime" 13 14 strfmt "github.com/go-openapi/strfmt" 15 16 models "github.com/cilium/cilium/api/v1/models" 17 ) 18 19 // PatchConfigReader is a Reader for the PatchConfig structure. 20 type PatchConfigReader struct { 21 formats strfmt.Registry 22 } 23 24 // ReadResponse reads a server response into the received o. 25 func (o *PatchConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 26 switch response.Code() { 27 28 case 200: 29 result := NewPatchConfigOK() 30 if err := result.readResponse(response, consumer, o.formats); err != nil { 31 return nil, err 32 } 33 return result, nil 34 35 case 400: 36 result := NewPatchConfigBadRequest() 37 if err := result.readResponse(response, consumer, o.formats); err != nil { 38 return nil, err 39 } 40 return nil, result 41 42 case 500: 43 result := NewPatchConfigFailure() 44 if err := result.readResponse(response, consumer, o.formats); err != nil { 45 return nil, err 46 } 47 return nil, result 48 49 default: 50 return nil, runtime.NewAPIError("unknown error", response, response.Code()) 51 } 52 } 53 54 // NewPatchConfigOK creates a PatchConfigOK with default headers values 55 func NewPatchConfigOK() *PatchConfigOK { 56 return &PatchConfigOK{} 57 } 58 59 /*PatchConfigOK handles this case with default header values. 60 61 Success 62 */ 63 type PatchConfigOK struct { 64 } 65 66 func (o *PatchConfigOK) Error() string { 67 return fmt.Sprintf("[PATCH /config][%d] patchConfigOK ", 200) 68 } 69 70 func (o *PatchConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 71 72 return nil 73 } 74 75 // NewPatchConfigBadRequest creates a PatchConfigBadRequest with default headers values 76 func NewPatchConfigBadRequest() *PatchConfigBadRequest { 77 return &PatchConfigBadRequest{} 78 } 79 80 /*PatchConfigBadRequest handles this case with default header values. 81 82 Bad configuration parameters 83 */ 84 type PatchConfigBadRequest struct { 85 Payload models.Error 86 } 87 88 func (o *PatchConfigBadRequest) Error() string { 89 return fmt.Sprintf("[PATCH /config][%d] patchConfigBadRequest %+v", 400, o.Payload) 90 } 91 92 func (o *PatchConfigBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 93 94 // response payload 95 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 96 return err 97 } 98 99 return nil 100 } 101 102 // NewPatchConfigFailure creates a PatchConfigFailure with default headers values 103 func NewPatchConfigFailure() *PatchConfigFailure { 104 return &PatchConfigFailure{} 105 } 106 107 /*PatchConfigFailure handles this case with default header values. 108 109 Recompilation failed 110 */ 111 type PatchConfigFailure struct { 112 Payload models.Error 113 } 114 115 func (o *PatchConfigFailure) Error() string { 116 return fmt.Sprintf("[PATCH /config][%d] patchConfigFailure %+v", 500, o.Payload) 117 } 118 119 func (o *PatchConfigFailure) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 120 121 // response payload 122 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 123 return err 124 } 125 126 return nil 127 }