github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/delete_endpoint_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 endpoint
     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  
    19  // DeleteEndpointReader is a Reader for the DeleteEndpoint structure.
    20  type DeleteEndpointReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *DeleteEndpointReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  	case 200:
    28  		result := NewDeleteEndpointOK()
    29  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    30  			return nil, err
    31  		}
    32  		return result, nil
    33  	case 206:
    34  		result := NewDeleteEndpointErrors()
    35  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    36  			return nil, err
    37  		}
    38  		return result, nil
    39  	case 400:
    40  		result := NewDeleteEndpointInvalid()
    41  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    42  			return nil, err
    43  		}
    44  		return nil, result
    45  	case 404:
    46  		result := NewDeleteEndpointNotFound()
    47  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    48  			return nil, err
    49  		}
    50  		return nil, result
    51  	case 429:
    52  		result := NewDeleteEndpointTooManyRequests()
    53  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    54  			return nil, err
    55  		}
    56  		return nil, result
    57  	default:
    58  		return nil, runtime.NewAPIError("[DELETE /endpoint] DeleteEndpoint", response, response.Code())
    59  	}
    60  }
    61  
    62  // NewDeleteEndpointOK creates a DeleteEndpointOK with default headers values
    63  func NewDeleteEndpointOK() *DeleteEndpointOK {
    64  	return &DeleteEndpointOK{}
    65  }
    66  
    67  /*
    68  DeleteEndpointOK describes a response with status code 200, with default header values.
    69  
    70  Success
    71  */
    72  type DeleteEndpointOK struct {
    73  }
    74  
    75  // IsSuccess returns true when this delete endpoint o k response has a 2xx status code
    76  func (o *DeleteEndpointOK) IsSuccess() bool {
    77  	return true
    78  }
    79  
    80  // IsRedirect returns true when this delete endpoint o k response has a 3xx status code
    81  func (o *DeleteEndpointOK) IsRedirect() bool {
    82  	return false
    83  }
    84  
    85  // IsClientError returns true when this delete endpoint o k response has a 4xx status code
    86  func (o *DeleteEndpointOK) IsClientError() bool {
    87  	return false
    88  }
    89  
    90  // IsServerError returns true when this delete endpoint o k response has a 5xx status code
    91  func (o *DeleteEndpointOK) IsServerError() bool {
    92  	return false
    93  }
    94  
    95  // IsCode returns true when this delete endpoint o k response a status code equal to that given
    96  func (o *DeleteEndpointOK) IsCode(code int) bool {
    97  	return code == 200
    98  }
    99  
   100  // Code gets the status code for the delete endpoint o k response
   101  func (o *DeleteEndpointOK) Code() int {
   102  	return 200
   103  }
   104  
   105  func (o *DeleteEndpointOK) Error() string {
   106  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointOK ", 200)
   107  }
   108  
   109  func (o *DeleteEndpointOK) String() string {
   110  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointOK ", 200)
   111  }
   112  
   113  func (o *DeleteEndpointOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   114  
   115  	return nil
   116  }
   117  
   118  // NewDeleteEndpointErrors creates a DeleteEndpointErrors with default headers values
   119  func NewDeleteEndpointErrors() *DeleteEndpointErrors {
   120  	return &DeleteEndpointErrors{}
   121  }
   122  
   123  /*
   124  DeleteEndpointErrors describes a response with status code 206, with default header values.
   125  
   126  Deleted with a number of errors encountered
   127  */
   128  type DeleteEndpointErrors struct {
   129  	Payload int64
   130  }
   131  
   132  // IsSuccess returns true when this delete endpoint errors response has a 2xx status code
   133  func (o *DeleteEndpointErrors) IsSuccess() bool {
   134  	return true
   135  }
   136  
   137  // IsRedirect returns true when this delete endpoint errors response has a 3xx status code
   138  func (o *DeleteEndpointErrors) IsRedirect() bool {
   139  	return false
   140  }
   141  
   142  // IsClientError returns true when this delete endpoint errors response has a 4xx status code
   143  func (o *DeleteEndpointErrors) IsClientError() bool {
   144  	return false
   145  }
   146  
   147  // IsServerError returns true when this delete endpoint errors response has a 5xx status code
   148  func (o *DeleteEndpointErrors) IsServerError() bool {
   149  	return false
   150  }
   151  
   152  // IsCode returns true when this delete endpoint errors response a status code equal to that given
   153  func (o *DeleteEndpointErrors) IsCode(code int) bool {
   154  	return code == 206
   155  }
   156  
   157  // Code gets the status code for the delete endpoint errors response
   158  func (o *DeleteEndpointErrors) Code() int {
   159  	return 206
   160  }
   161  
   162  func (o *DeleteEndpointErrors) Error() string {
   163  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointErrors  %+v", 206, o.Payload)
   164  }
   165  
   166  func (o *DeleteEndpointErrors) String() string {
   167  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointErrors  %+v", 206, o.Payload)
   168  }
   169  
   170  func (o *DeleteEndpointErrors) GetPayload() int64 {
   171  	return o.Payload
   172  }
   173  
   174  func (o *DeleteEndpointErrors) 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  // NewDeleteEndpointInvalid creates a DeleteEndpointInvalid with default headers values
   185  func NewDeleteEndpointInvalid() *DeleteEndpointInvalid {
   186  	return &DeleteEndpointInvalid{}
   187  }
   188  
   189  /*
   190  DeleteEndpointInvalid describes a response with status code 400, with default header values.
   191  
   192  Invalid endpoint delete request
   193  */
   194  type DeleteEndpointInvalid struct {
   195  }
   196  
   197  // IsSuccess returns true when this delete endpoint invalid response has a 2xx status code
   198  func (o *DeleteEndpointInvalid) IsSuccess() bool {
   199  	return false
   200  }
   201  
   202  // IsRedirect returns true when this delete endpoint invalid response has a 3xx status code
   203  func (o *DeleteEndpointInvalid) IsRedirect() bool {
   204  	return false
   205  }
   206  
   207  // IsClientError returns true when this delete endpoint invalid response has a 4xx status code
   208  func (o *DeleteEndpointInvalid) IsClientError() bool {
   209  	return true
   210  }
   211  
   212  // IsServerError returns true when this delete endpoint invalid response has a 5xx status code
   213  func (o *DeleteEndpointInvalid) IsServerError() bool {
   214  	return false
   215  }
   216  
   217  // IsCode returns true when this delete endpoint invalid response a status code equal to that given
   218  func (o *DeleteEndpointInvalid) IsCode(code int) bool {
   219  	return code == 400
   220  }
   221  
   222  // Code gets the status code for the delete endpoint invalid response
   223  func (o *DeleteEndpointInvalid) Code() int {
   224  	return 400
   225  }
   226  
   227  func (o *DeleteEndpointInvalid) Error() string {
   228  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointInvalid ", 400)
   229  }
   230  
   231  func (o *DeleteEndpointInvalid) String() string {
   232  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointInvalid ", 400)
   233  }
   234  
   235  func (o *DeleteEndpointInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   236  
   237  	return nil
   238  }
   239  
   240  // NewDeleteEndpointNotFound creates a DeleteEndpointNotFound with default headers values
   241  func NewDeleteEndpointNotFound() *DeleteEndpointNotFound {
   242  	return &DeleteEndpointNotFound{}
   243  }
   244  
   245  /*
   246  DeleteEndpointNotFound describes a response with status code 404, with default header values.
   247  
   248  No endpoints with provided parameters found
   249  */
   250  type DeleteEndpointNotFound struct {
   251  }
   252  
   253  // IsSuccess returns true when this delete endpoint not found response has a 2xx status code
   254  func (o *DeleteEndpointNotFound) IsSuccess() bool {
   255  	return false
   256  }
   257  
   258  // IsRedirect returns true when this delete endpoint not found response has a 3xx status code
   259  func (o *DeleteEndpointNotFound) IsRedirect() bool {
   260  	return false
   261  }
   262  
   263  // IsClientError returns true when this delete endpoint not found response has a 4xx status code
   264  func (o *DeleteEndpointNotFound) IsClientError() bool {
   265  	return true
   266  }
   267  
   268  // IsServerError returns true when this delete endpoint not found response has a 5xx status code
   269  func (o *DeleteEndpointNotFound) IsServerError() bool {
   270  	return false
   271  }
   272  
   273  // IsCode returns true when this delete endpoint not found response a status code equal to that given
   274  func (o *DeleteEndpointNotFound) IsCode(code int) bool {
   275  	return code == 404
   276  }
   277  
   278  // Code gets the status code for the delete endpoint not found response
   279  func (o *DeleteEndpointNotFound) Code() int {
   280  	return 404
   281  }
   282  
   283  func (o *DeleteEndpointNotFound) Error() string {
   284  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointNotFound ", 404)
   285  }
   286  
   287  func (o *DeleteEndpointNotFound) String() string {
   288  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointNotFound ", 404)
   289  }
   290  
   291  func (o *DeleteEndpointNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   292  
   293  	return nil
   294  }
   295  
   296  // NewDeleteEndpointTooManyRequests creates a DeleteEndpointTooManyRequests with default headers values
   297  func NewDeleteEndpointTooManyRequests() *DeleteEndpointTooManyRequests {
   298  	return &DeleteEndpointTooManyRequests{}
   299  }
   300  
   301  /*
   302  DeleteEndpointTooManyRequests describes a response with status code 429, with default header values.
   303  
   304  Rate-limiting too many requests in the given time frame
   305  */
   306  type DeleteEndpointTooManyRequests struct {
   307  }
   308  
   309  // IsSuccess returns true when this delete endpoint too many requests response has a 2xx status code
   310  func (o *DeleteEndpointTooManyRequests) IsSuccess() bool {
   311  	return false
   312  }
   313  
   314  // IsRedirect returns true when this delete endpoint too many requests response has a 3xx status code
   315  func (o *DeleteEndpointTooManyRequests) IsRedirect() bool {
   316  	return false
   317  }
   318  
   319  // IsClientError returns true when this delete endpoint too many requests response has a 4xx status code
   320  func (o *DeleteEndpointTooManyRequests) IsClientError() bool {
   321  	return true
   322  }
   323  
   324  // IsServerError returns true when this delete endpoint too many requests response has a 5xx status code
   325  func (o *DeleteEndpointTooManyRequests) IsServerError() bool {
   326  	return false
   327  }
   328  
   329  // IsCode returns true when this delete endpoint too many requests response a status code equal to that given
   330  func (o *DeleteEndpointTooManyRequests) IsCode(code int) bool {
   331  	return code == 429
   332  }
   333  
   334  // Code gets the status code for the delete endpoint too many requests response
   335  func (o *DeleteEndpointTooManyRequests) Code() int {
   336  	return 429
   337  }
   338  
   339  func (o *DeleteEndpointTooManyRequests) Error() string {
   340  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointTooManyRequests ", 429)
   341  }
   342  
   343  func (o *DeleteEndpointTooManyRequests) String() string {
   344  	return fmt.Sprintf("[DELETE /endpoint][%d] deleteEndpointTooManyRequests ", 429)
   345  }
   346  
   347  func (o *DeleteEndpointTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   348  
   349  	return nil
   350  }