github.com/kubearmor/cilium@v1.6.12/api/v1/client/policy/delete_fqdn_cache_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package policy 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 // DeleteFqdnCacheReader is a Reader for the DeleteFqdnCache structure. 20 type DeleteFqdnCacheReader struct { 21 formats strfmt.Registry 22 } 23 24 // ReadResponse reads a server response into the received o. 25 func (o *DeleteFqdnCacheReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 26 switch response.Code() { 27 28 case 200: 29 result := NewDeleteFqdnCacheOK() 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 := NewDeleteFqdnCacheBadRequest() 37 if err := result.readResponse(response, consumer, o.formats); err != nil { 38 return nil, err 39 } 40 return nil, result 41 42 default: 43 return nil, runtime.NewAPIError("unknown error", response, response.Code()) 44 } 45 } 46 47 // NewDeleteFqdnCacheOK creates a DeleteFqdnCacheOK with default headers values 48 func NewDeleteFqdnCacheOK() *DeleteFqdnCacheOK { 49 return &DeleteFqdnCacheOK{} 50 } 51 52 /*DeleteFqdnCacheOK handles this case with default header values. 53 54 Success 55 */ 56 type DeleteFqdnCacheOK struct { 57 } 58 59 func (o *DeleteFqdnCacheOK) Error() string { 60 return fmt.Sprintf("[DELETE /fqdn/cache][%d] deleteFqdnCacheOK ", 200) 61 } 62 63 func (o *DeleteFqdnCacheOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 64 65 return nil 66 } 67 68 // NewDeleteFqdnCacheBadRequest creates a DeleteFqdnCacheBadRequest with default headers values 69 func NewDeleteFqdnCacheBadRequest() *DeleteFqdnCacheBadRequest { 70 return &DeleteFqdnCacheBadRequest{} 71 } 72 73 /*DeleteFqdnCacheBadRequest handles this case with default header values. 74 75 Invalid request (error parsing parameters) 76 */ 77 type DeleteFqdnCacheBadRequest struct { 78 Payload models.Error 79 } 80 81 func (o *DeleteFqdnCacheBadRequest) Error() string { 82 return fmt.Sprintf("[DELETE /fqdn/cache][%d] deleteFqdnCacheBadRequest %+v", 400, o.Payload) 83 } 84 85 func (o *DeleteFqdnCacheBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 86 87 // response payload 88 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 89 return err 90 } 91 92 return nil 93 }