github.com/cilium/cilium@v1.16.2/api/v1/client/policy/get_fqdn_cache_id_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Authors of Cilium
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package policy
     7  
     8  // This file was generated by the swagger tool.
     9  // Editing this file might prove futile when you re-run the swagger generate command
    10  
    11  import (
    12  	"fmt"
    13  	"io"
    14  
    15  	"github.com/go-openapi/runtime"
    16  	"github.com/go-openapi/strfmt"
    17  
    18  	"github.com/cilium/cilium/api/v1/models"
    19  )
    20  
    21  // GetFqdnCacheIDReader is a Reader for the GetFqdnCacheID structure.
    22  type GetFqdnCacheIDReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *GetFqdnCacheIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewGetFqdnCacheIDOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    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  	case 404:
    42  		result := NewGetFqdnCacheIDNotFound()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return nil, result
    47  	default:
    48  		return nil, runtime.NewAPIError("[GET /fqdn/cache/{id}] GetFqdnCacheID", response, response.Code())
    49  	}
    50  }
    51  
    52  // NewGetFqdnCacheIDOK creates a GetFqdnCacheIDOK with default headers values
    53  func NewGetFqdnCacheIDOK() *GetFqdnCacheIDOK {
    54  	return &GetFqdnCacheIDOK{}
    55  }
    56  
    57  /*
    58  GetFqdnCacheIDOK describes a response with status code 200, with default header values.
    59  
    60  Success
    61  */
    62  type GetFqdnCacheIDOK struct {
    63  	Payload []*models.DNSLookup
    64  }
    65  
    66  // IsSuccess returns true when this get fqdn cache Id o k response has a 2xx status code
    67  func (o *GetFqdnCacheIDOK) IsSuccess() bool {
    68  	return true
    69  }
    70  
    71  // IsRedirect returns true when this get fqdn cache Id o k response has a 3xx status code
    72  func (o *GetFqdnCacheIDOK) IsRedirect() bool {
    73  	return false
    74  }
    75  
    76  // IsClientError returns true when this get fqdn cache Id o k response has a 4xx status code
    77  func (o *GetFqdnCacheIDOK) IsClientError() bool {
    78  	return false
    79  }
    80  
    81  // IsServerError returns true when this get fqdn cache Id o k response has a 5xx status code
    82  func (o *GetFqdnCacheIDOK) IsServerError() bool {
    83  	return false
    84  }
    85  
    86  // IsCode returns true when this get fqdn cache Id o k response a status code equal to that given
    87  func (o *GetFqdnCacheIDOK) IsCode(code int) bool {
    88  	return code == 200
    89  }
    90  
    91  // Code gets the status code for the get fqdn cache Id o k response
    92  func (o *GetFqdnCacheIDOK) Code() int {
    93  	return 200
    94  }
    95  
    96  func (o *GetFqdnCacheIDOK) Error() string {
    97  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdOK  %+v", 200, o.Payload)
    98  }
    99  
   100  func (o *GetFqdnCacheIDOK) String() string {
   101  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdOK  %+v", 200, o.Payload)
   102  }
   103  
   104  func (o *GetFqdnCacheIDOK) GetPayload() []*models.DNSLookup {
   105  	return o.Payload
   106  }
   107  
   108  func (o *GetFqdnCacheIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   109  
   110  	// response payload
   111  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   112  		return err
   113  	}
   114  
   115  	return nil
   116  }
   117  
   118  // NewGetFqdnCacheIDBadRequest creates a GetFqdnCacheIDBadRequest with default headers values
   119  func NewGetFqdnCacheIDBadRequest() *GetFqdnCacheIDBadRequest {
   120  	return &GetFqdnCacheIDBadRequest{}
   121  }
   122  
   123  /*
   124  GetFqdnCacheIDBadRequest describes a response with status code 400, with default header values.
   125  
   126  Invalid request (error parsing parameters)
   127  */
   128  type GetFqdnCacheIDBadRequest struct {
   129  	Payload models.Error
   130  }
   131  
   132  // IsSuccess returns true when this get fqdn cache Id bad request response has a 2xx status code
   133  func (o *GetFqdnCacheIDBadRequest) IsSuccess() bool {
   134  	return false
   135  }
   136  
   137  // IsRedirect returns true when this get fqdn cache Id bad request response has a 3xx status code
   138  func (o *GetFqdnCacheIDBadRequest) IsRedirect() bool {
   139  	return false
   140  }
   141  
   142  // IsClientError returns true when this get fqdn cache Id bad request response has a 4xx status code
   143  func (o *GetFqdnCacheIDBadRequest) IsClientError() bool {
   144  	return true
   145  }
   146  
   147  // IsServerError returns true when this get fqdn cache Id bad request response has a 5xx status code
   148  func (o *GetFqdnCacheIDBadRequest) IsServerError() bool {
   149  	return false
   150  }
   151  
   152  // IsCode returns true when this get fqdn cache Id bad request response a status code equal to that given
   153  func (o *GetFqdnCacheIDBadRequest) IsCode(code int) bool {
   154  	return code == 400
   155  }
   156  
   157  // Code gets the status code for the get fqdn cache Id bad request response
   158  func (o *GetFqdnCacheIDBadRequest) Code() int {
   159  	return 400
   160  }
   161  
   162  func (o *GetFqdnCacheIDBadRequest) Error() string {
   163  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdBadRequest  %+v", 400, o.Payload)
   164  }
   165  
   166  func (o *GetFqdnCacheIDBadRequest) String() string {
   167  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdBadRequest  %+v", 400, o.Payload)
   168  }
   169  
   170  func (o *GetFqdnCacheIDBadRequest) GetPayload() models.Error {
   171  	return o.Payload
   172  }
   173  
   174  func (o *GetFqdnCacheIDBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   175  
   176  	// response payload
   177  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   178  		return err
   179  	}
   180  
   181  	return nil
   182  }
   183  
   184  // NewGetFqdnCacheIDNotFound creates a GetFqdnCacheIDNotFound with default headers values
   185  func NewGetFqdnCacheIDNotFound() *GetFqdnCacheIDNotFound {
   186  	return &GetFqdnCacheIDNotFound{}
   187  }
   188  
   189  /*
   190  GetFqdnCacheIDNotFound describes a response with status code 404, with default header values.
   191  
   192  No DNS data with provided parameters found
   193  */
   194  type GetFqdnCacheIDNotFound struct {
   195  }
   196  
   197  // IsSuccess returns true when this get fqdn cache Id not found response has a 2xx status code
   198  func (o *GetFqdnCacheIDNotFound) IsSuccess() bool {
   199  	return false
   200  }
   201  
   202  // IsRedirect returns true when this get fqdn cache Id not found response has a 3xx status code
   203  func (o *GetFqdnCacheIDNotFound) IsRedirect() bool {
   204  	return false
   205  }
   206  
   207  // IsClientError returns true when this get fqdn cache Id not found response has a 4xx status code
   208  func (o *GetFqdnCacheIDNotFound) IsClientError() bool {
   209  	return true
   210  }
   211  
   212  // IsServerError returns true when this get fqdn cache Id not found response has a 5xx status code
   213  func (o *GetFqdnCacheIDNotFound) IsServerError() bool {
   214  	return false
   215  }
   216  
   217  // IsCode returns true when this get fqdn cache Id not found response a status code equal to that given
   218  func (o *GetFqdnCacheIDNotFound) IsCode(code int) bool {
   219  	return code == 404
   220  }
   221  
   222  // Code gets the status code for the get fqdn cache Id not found response
   223  func (o *GetFqdnCacheIDNotFound) Code() int {
   224  	return 404
   225  }
   226  
   227  func (o *GetFqdnCacheIDNotFound) Error() string {
   228  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdNotFound ", 404)
   229  }
   230  
   231  func (o *GetFqdnCacheIDNotFound) String() string {
   232  	return fmt.Sprintf("[GET /fqdn/cache/{id}][%d] getFqdnCacheIdNotFound ", 404)
   233  }
   234  
   235  func (o *GetFqdnCacheIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   236  
   237  	return nil
   238  }