github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/patch_endpoint_id_labels_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 // PatchEndpointIDLabelsReader is a Reader for the PatchEndpointIDLabels structure. 20 type PatchEndpointIDLabelsReader struct { 21 formats strfmt.Registry 22 } 23 24 // ReadResponse reads a server response into the received o. 25 func (o *PatchEndpointIDLabelsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 26 switch response.Code() { 27 28 case 200: 29 result := NewPatchEndpointIDLabelsOK() 30 if err := result.readResponse(response, consumer, o.formats); err != nil { 31 return nil, err 32 } 33 return result, nil 34 35 case 404: 36 result := NewPatchEndpointIDLabelsNotFound() 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 := NewPatchEndpointIDLabelsUpdateFailed() 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 // NewPatchEndpointIDLabelsOK creates a PatchEndpointIDLabelsOK with default headers values 55 func NewPatchEndpointIDLabelsOK() *PatchEndpointIDLabelsOK { 56 return &PatchEndpointIDLabelsOK{} 57 } 58 59 /*PatchEndpointIDLabelsOK handles this case with default header values. 60 61 Success 62 */ 63 type PatchEndpointIDLabelsOK struct { 64 } 65 66 func (o *PatchEndpointIDLabelsOK) Error() string { 67 return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsOK ", 200) 68 } 69 70 func (o *PatchEndpointIDLabelsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 71 72 return nil 73 } 74 75 // NewPatchEndpointIDLabelsNotFound creates a PatchEndpointIDLabelsNotFound with default headers values 76 func NewPatchEndpointIDLabelsNotFound() *PatchEndpointIDLabelsNotFound { 77 return &PatchEndpointIDLabelsNotFound{} 78 } 79 80 /*PatchEndpointIDLabelsNotFound handles this case with default header values. 81 82 Endpoint not found 83 */ 84 type PatchEndpointIDLabelsNotFound struct { 85 } 86 87 func (o *PatchEndpointIDLabelsNotFound) Error() string { 88 return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsNotFound ", 404) 89 } 90 91 func (o *PatchEndpointIDLabelsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 92 93 return nil 94 } 95 96 // NewPatchEndpointIDLabelsUpdateFailed creates a PatchEndpointIDLabelsUpdateFailed with default headers values 97 func NewPatchEndpointIDLabelsUpdateFailed() *PatchEndpointIDLabelsUpdateFailed { 98 return &PatchEndpointIDLabelsUpdateFailed{} 99 } 100 101 /*PatchEndpointIDLabelsUpdateFailed handles this case with default header values. 102 103 Error while updating labels 104 */ 105 type PatchEndpointIDLabelsUpdateFailed struct { 106 Payload models.Error 107 } 108 109 func (o *PatchEndpointIDLabelsUpdateFailed) Error() string { 110 return fmt.Sprintf("[PATCH /endpoint/{id}/labels][%d] patchEndpointIdLabelsUpdateFailed %+v", 500, o.Payload) 111 } 112 113 func (o *PatchEndpointIDLabelsUpdateFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 114 115 // response payload 116 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 117 return err 118 } 119 120 return nil 121 }