github.com/kubearmor/cilium@v1.6.12/api/v1/client/policy/get_fqdn_cache_id_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  // GetFqdnCacheIDReader is a Reader for the GetFqdnCacheID structure.
    20  type GetFqdnCacheIDReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *GetFqdnCacheIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewGetFqdnCacheIDOK()
    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 := NewGetFqdnCacheIDBadRequest()
    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 := NewGetFqdnCacheIDNotFound()
    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  // NewGetFqdnCacheIDOK creates a GetFqdnCacheIDOK with default headers values
    55  func NewGetFqdnCacheIDOK() *GetFqdnCacheIDOK {
    56  	return &GetFqdnCacheIDOK{}
    57  }
    58  
    59  /*GetFqdnCacheIDOK handles this case with default header values.
    60  
    61  Success
    62  */
    63  type GetFqdnCacheIDOK struct {
    64  	Payload []*models.DNSLookup
    65  }
    66  
    67  func (o *GetFqdnCacheIDOK) Error() string {
    68  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdOK  %+v", 200, o.Payload)
    69  }
    70  
    71  func (o *GetFqdnCacheIDOK) 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  // NewGetFqdnCacheIDBadRequest creates a GetFqdnCacheIDBadRequest with default headers values
    82  func NewGetFqdnCacheIDBadRequest() *GetFqdnCacheIDBadRequest {
    83  	return &GetFqdnCacheIDBadRequest{}
    84  }
    85  
    86  /*GetFqdnCacheIDBadRequest handles this case with default header values.
    87  
    88  Invalid request (error parsing parameters)
    89  */
    90  type GetFqdnCacheIDBadRequest struct {
    91  	Payload models.Error
    92  }
    93  
    94  func (o *GetFqdnCacheIDBadRequest) Error() string {
    95  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdBadRequest  %+v", 400, o.Payload)
    96  }
    97  
    98  func (o *GetFqdnCacheIDBadRequest) 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  // NewGetFqdnCacheIDNotFound creates a GetFqdnCacheIDNotFound with default headers values
   109  func NewGetFqdnCacheIDNotFound() *GetFqdnCacheIDNotFound {
   110  	return &GetFqdnCacheIDNotFound{}
   111  }
   112  
   113  /*GetFqdnCacheIDNotFound handles this case with default header values.
   114  
   115  No DNS data with provided parameters found
   116  */
   117  type GetFqdnCacheIDNotFound struct {
   118  }
   119  
   120  func (o *GetFqdnCacheIDNotFound) Error() string {
   121  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdNotFound ", 404)
   122  }
   123  
   124  func (o *GetFqdnCacheIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   125  
   126  	return nil
   127  }