github.com/kubearmor/cilium@v1.6.12/api/v1/client/policy/get_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 // GetFqdnCacheReader is a Reader for the GetFqdnCache structure. 20 type GetFqdnCacheReader struct { 21 formats strfmt.Registry 22 } 23 24 // ReadResponse reads a server response into the received o. 25 func (o *GetFqdnCacheReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 26 switch response.Code() { 27 28 case 200: 29 result := NewGetFqdnCacheOK() 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 := NewGetFqdnCacheBadRequest() 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 := NewGetFqdnCacheNotFound() 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 // NewGetFqdnCacheOK creates a GetFqdnCacheOK with default headers values 55 func NewGetFqdnCacheOK() *GetFqdnCacheOK { 56 return &GetFqdnCacheOK{} 57 } 58 59 /*GetFqdnCacheOK handles this case with default header values. 60 61 Success 62 */ 63 type GetFqdnCacheOK struct { 64 Payload []*models.DNSLookup 65 } 66 67 func (o *GetFqdnCacheOK) Error() string { 68 return fmt.Sprintf("[GET /fqdn/cache][%d] getFqdnCacheOK %+v", 200, o.Payload) 69 } 70 71 func (o *GetFqdnCacheOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 72 73 // response payload 74 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 75 return err 76 } 77 78 return nil 79 } 80 81 // NewGetFqdnCacheBadRequest creates a GetFqdnCacheBadRequest with default headers values 82 func NewGetFqdnCacheBadRequest() *GetFqdnCacheBadRequest { 83 return &GetFqdnCacheBadRequest{} 84 } 85 86 /*GetFqdnCacheBadRequest handles this case with default header values. 87 88 Invalid request (error parsing parameters) 89 */ 90 type GetFqdnCacheBadRequest struct { 91 Payload models.Error 92 } 93 94 func (o *GetFqdnCacheBadRequest) Error() string { 95 return fmt.Sprintf("[GET /fqdn/cache][%d] getFqdnCacheBadRequest %+v", 400, o.Payload) 96 } 97 98 func (o *GetFqdnCacheBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 } 107 108 // NewGetFqdnCacheNotFound creates a GetFqdnCacheNotFound with default headers values 109 func NewGetFqdnCacheNotFound() *GetFqdnCacheNotFound { 110 return &GetFqdnCacheNotFound{} 111 } 112 113 /*GetFqdnCacheNotFound handles this case with default header values. 114 115 No DNS data with provided parameters found 116 */ 117 type GetFqdnCacheNotFound struct { 118 } 119 120 func (o *GetFqdnCacheNotFound) Error() string { 121 return fmt.Sprintf("[GET /fqdn/cache][%d] getFqdnCacheNotFound ", 404) 122 } 123 124 func (o *GetFqdnCacheNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 125 126 return nil 127 }