github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/patch_endpoint_id_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package endpoint 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 // PatchEndpointIDReader is a Reader for the PatchEndpointID structure. 20 type PatchEndpointIDReader struct { 21 formats strfmt.Registry 22 } 23 24 // ReadResponse reads a server response into the received o. 25 func (o *PatchEndpointIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 26 switch response.Code() { 27 28 case 200: 29 result := NewPatchEndpointIDOK() 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 := NewPatchEndpointIDInvalid() 37 if err := result.readResponse(response, consumer, o.formats); err != nil { 38 return nil, err 39 } 40 return nil, result 41 42 case 404: 43 result := NewPatchEndpointIDNotFound() 44 if err := result.readResponse(response, consumer, o.formats); err != nil { 45 return nil, err 46 } 47 return nil, result 48 49 case 500: 50 result := NewPatchEndpointIDFailed() 51 if err := result.readResponse(response, consumer, o.formats); err != nil { 52 return nil, err 53 } 54 return nil, result 55 56 default: 57 return nil, runtime.NewAPIError("unknown error", response, response.Code()) 58 } 59 } 60 61 // NewPatchEndpointIDOK creates a PatchEndpointIDOK with default headers values 62 func NewPatchEndpointIDOK() *PatchEndpointIDOK { 63 return &PatchEndpointIDOK{} 64 } 65 66 /*PatchEndpointIDOK handles this case with default header values. 67 68 Success 69 */ 70 type PatchEndpointIDOK struct { 71 } 72 73 func (o *PatchEndpointIDOK) Error() string { 74 return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdOK ", 200) 75 } 76 77 func (o *PatchEndpointIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 78 79 return nil 80 } 81 82 // NewPatchEndpointIDInvalid creates a PatchEndpointIDInvalid with default headers values 83 func NewPatchEndpointIDInvalid() *PatchEndpointIDInvalid { 84 return &PatchEndpointIDInvalid{} 85 } 86 87 /*PatchEndpointIDInvalid handles this case with default header values. 88 89 Invalid modify endpoint request 90 */ 91 type PatchEndpointIDInvalid struct { 92 Payload models.Error 93 } 94 95 func (o *PatchEndpointIDInvalid) Error() string { 96 return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdInvalid %+v", 400, o.Payload) 97 } 98 99 func (o *PatchEndpointIDInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 100 101 // response payload 102 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 103 return err 104 } 105 106 return nil 107 } 108 109 // NewPatchEndpointIDNotFound creates a PatchEndpointIDNotFound with default headers values 110 func NewPatchEndpointIDNotFound() *PatchEndpointIDNotFound { 111 return &PatchEndpointIDNotFound{} 112 } 113 114 /*PatchEndpointIDNotFound handles this case with default header values. 115 116 Endpoint does not exist 117 */ 118 type PatchEndpointIDNotFound struct { 119 } 120 121 func (o *PatchEndpointIDNotFound) Error() string { 122 return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdNotFound ", 404) 123 } 124 125 func (o *PatchEndpointIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 126 127 return nil 128 } 129 130 // NewPatchEndpointIDFailed creates a PatchEndpointIDFailed with default headers values 131 func NewPatchEndpointIDFailed() *PatchEndpointIDFailed { 132 return &PatchEndpointIDFailed{} 133 } 134 135 /*PatchEndpointIDFailed handles this case with default header values. 136 137 Endpoint update failed 138 */ 139 type PatchEndpointIDFailed struct { 140 Payload models.Error 141 } 142 143 func (o *PatchEndpointIDFailed) Error() string { 144 return fmt.Sprintf("[PATCH /endpoint/{id}][%d] patchEndpointIdFailed %+v", 500, o.Payload) 145 } 146 147 func (o *PatchEndpointIDFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 148 149 // response payload 150 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 151 return err 152 } 153 154 return nil 155 }