github.com/cilium/cilium@v1.16.2/api/v1/client/endpoint/delete_endpoint_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 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  	"github.com/cilium/cilium/api/v1/models"
    19  )
    20  
    21  // DeleteEndpointIDReader is a Reader for the DeleteEndpointID structure.
    22  type DeleteEndpointIDReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *DeleteEndpointIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewDeleteEndpointIDOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    35  	case 206:
    36  		result := NewDeleteEndpointIDErrors()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return result, nil
    41  	case 400:
    42  		result := NewDeleteEndpointIDInvalid()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return nil, result
    47  	case 403:
    48  		result := NewDeleteEndpointIDForbidden()
    49  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    50  			return nil, err
    51  		}
    52  		return nil, result
    53  	case 404:
    54  		result := NewDeleteEndpointIDNotFound()
    55  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    56  			return nil, err
    57  		}
    58  		return nil, result
    59  	case 429:
    60  		result := NewDeleteEndpointIDTooManyRequests()
    61  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    62  			return nil, err
    63  		}
    64  		return nil, result
    65  	default:
    66  		return nil, runtime.NewAPIError("[DELETE /endpoint/{id}] DeleteEndpointID", response, response.Code())
    67  	}
    68  }
    69  
    70  // NewDeleteEndpointIDOK creates a DeleteEndpointIDOK with default headers values
    71  func NewDeleteEndpointIDOK() *DeleteEndpointIDOK {
    72  	return &DeleteEndpointIDOK{}
    73  }
    74  
    75  /*
    76  DeleteEndpointIDOK describes a response with status code 200, with default header values.
    77  
    78  Success
    79  */
    80  type DeleteEndpointIDOK struct {
    81  }
    82  
    83  // IsSuccess returns true when this delete endpoint Id o k response has a 2xx status code
    84  func (o *DeleteEndpointIDOK) IsSuccess() bool {
    85  	return true
    86  }
    87  
    88  // IsRedirect returns true when this delete endpoint Id o k response has a 3xx status code
    89  func (o *DeleteEndpointIDOK) IsRedirect() bool {
    90  	return false
    91  }
    92  
    93  // IsClientError returns true when this delete endpoint Id o k response has a 4xx status code
    94  func (o *DeleteEndpointIDOK) IsClientError() bool {
    95  	return false
    96  }
    97  
    98  // IsServerError returns true when this delete endpoint Id o k response has a 5xx status code
    99  func (o *DeleteEndpointIDOK) IsServerError() bool {
   100  	return false
   101  }
   102  
   103  // IsCode returns true when this delete endpoint Id o k response a status code equal to that given
   104  func (o *DeleteEndpointIDOK) IsCode(code int) bool {
   105  	return code == 200
   106  }
   107  
   108  // Code gets the status code for the delete endpoint Id o k response
   109  func (o *DeleteEndpointIDOK) Code() int {
   110  	return 200
   111  }
   112  
   113  func (o *DeleteEndpointIDOK) Error() string {
   114  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdOK ", 200)
   115  }
   116  
   117  func (o *DeleteEndpointIDOK) String() string {
   118  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdOK ", 200)
   119  }
   120  
   121  func (o *DeleteEndpointIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   122  
   123  	return nil
   124  }
   125  
   126  // NewDeleteEndpointIDErrors creates a DeleteEndpointIDErrors with default headers values
   127  func NewDeleteEndpointIDErrors() *DeleteEndpointIDErrors {
   128  	return &DeleteEndpointIDErrors{}
   129  }
   130  
   131  /*
   132  DeleteEndpointIDErrors describes a response with status code 206, with default header values.
   133  
   134  Deleted with a number of errors encountered
   135  */
   136  type DeleteEndpointIDErrors struct {
   137  	Payload int64
   138  }
   139  
   140  // IsSuccess returns true when this delete endpoint Id errors response has a 2xx status code
   141  func (o *DeleteEndpointIDErrors) IsSuccess() bool {
   142  	return true
   143  }
   144  
   145  // IsRedirect returns true when this delete endpoint Id errors response has a 3xx status code
   146  func (o *DeleteEndpointIDErrors) IsRedirect() bool {
   147  	return false
   148  }
   149  
   150  // IsClientError returns true when this delete endpoint Id errors response has a 4xx status code
   151  func (o *DeleteEndpointIDErrors) IsClientError() bool {
   152  	return false
   153  }
   154  
   155  // IsServerError returns true when this delete endpoint Id errors response has a 5xx status code
   156  func (o *DeleteEndpointIDErrors) IsServerError() bool {
   157  	return false
   158  }
   159  
   160  // IsCode returns true when this delete endpoint Id errors response a status code equal to that given
   161  func (o *DeleteEndpointIDErrors) IsCode(code int) bool {
   162  	return code == 206
   163  }
   164  
   165  // Code gets the status code for the delete endpoint Id errors response
   166  func (o *DeleteEndpointIDErrors) Code() int {
   167  	return 206
   168  }
   169  
   170  func (o *DeleteEndpointIDErrors) Error() string {
   171  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdErrors  %+v", 206, o.Payload)
   172  }
   173  
   174  func (o *DeleteEndpointIDErrors) String() string {
   175  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdErrors  %+v", 206, o.Payload)
   176  }
   177  
   178  func (o *DeleteEndpointIDErrors) GetPayload() int64 {
   179  	return o.Payload
   180  }
   181  
   182  func (o *DeleteEndpointIDErrors) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   183  
   184  	// response payload
   185  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   186  		return err
   187  	}
   188  
   189  	return nil
   190  }
   191  
   192  // NewDeleteEndpointIDInvalid creates a DeleteEndpointIDInvalid with default headers values
   193  func NewDeleteEndpointIDInvalid() *DeleteEndpointIDInvalid {
   194  	return &DeleteEndpointIDInvalid{}
   195  }
   196  
   197  /*
   198  	DeleteEndpointIDInvalid describes a response with status code 400, with default header values.
   199  
   200  	Invalid endpoint ID format for specified type. Details in error
   201  
   202  message
   203  */
   204  type DeleteEndpointIDInvalid struct {
   205  	Payload models.Error
   206  }
   207  
   208  // IsSuccess returns true when this delete endpoint Id invalid response has a 2xx status code
   209  func (o *DeleteEndpointIDInvalid) IsSuccess() bool {
   210  	return false
   211  }
   212  
   213  // IsRedirect returns true when this delete endpoint Id invalid response has a 3xx status code
   214  func (o *DeleteEndpointIDInvalid) IsRedirect() bool {
   215  	return false
   216  }
   217  
   218  // IsClientError returns true when this delete endpoint Id invalid response has a 4xx status code
   219  func (o *DeleteEndpointIDInvalid) IsClientError() bool {
   220  	return true
   221  }
   222  
   223  // IsServerError returns true when this delete endpoint Id invalid response has a 5xx status code
   224  func (o *DeleteEndpointIDInvalid) IsServerError() bool {
   225  	return false
   226  }
   227  
   228  // IsCode returns true when this delete endpoint Id invalid response a status code equal to that given
   229  func (o *DeleteEndpointIDInvalid) IsCode(code int) bool {
   230  	return code == 400
   231  }
   232  
   233  // Code gets the status code for the delete endpoint Id invalid response
   234  func (o *DeleteEndpointIDInvalid) Code() int {
   235  	return 400
   236  }
   237  
   238  func (o *DeleteEndpointIDInvalid) Error() string {
   239  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdInvalid  %+v", 400, o.Payload)
   240  }
   241  
   242  func (o *DeleteEndpointIDInvalid) String() string {
   243  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdInvalid  %+v", 400, o.Payload)
   244  }
   245  
   246  func (o *DeleteEndpointIDInvalid) GetPayload() models.Error {
   247  	return o.Payload
   248  }
   249  
   250  func (o *DeleteEndpointIDInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   251  
   252  	// response payload
   253  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   254  		return err
   255  	}
   256  
   257  	return nil
   258  }
   259  
   260  // NewDeleteEndpointIDForbidden creates a DeleteEndpointIDForbidden with default headers values
   261  func NewDeleteEndpointIDForbidden() *DeleteEndpointIDForbidden {
   262  	return &DeleteEndpointIDForbidden{}
   263  }
   264  
   265  /*
   266  DeleteEndpointIDForbidden describes a response with status code 403, with default header values.
   267  
   268  Forbidden
   269  */
   270  type DeleteEndpointIDForbidden struct {
   271  }
   272  
   273  // IsSuccess returns true when this delete endpoint Id forbidden response has a 2xx status code
   274  func (o *DeleteEndpointIDForbidden) IsSuccess() bool {
   275  	return false
   276  }
   277  
   278  // IsRedirect returns true when this delete endpoint Id forbidden response has a 3xx status code
   279  func (o *DeleteEndpointIDForbidden) IsRedirect() bool {
   280  	return false
   281  }
   282  
   283  // IsClientError returns true when this delete endpoint Id forbidden response has a 4xx status code
   284  func (o *DeleteEndpointIDForbidden) IsClientError() bool {
   285  	return true
   286  }
   287  
   288  // IsServerError returns true when this delete endpoint Id forbidden response has a 5xx status code
   289  func (o *DeleteEndpointIDForbidden) IsServerError() bool {
   290  	return false
   291  }
   292  
   293  // IsCode returns true when this delete endpoint Id forbidden response a status code equal to that given
   294  func (o *DeleteEndpointIDForbidden) IsCode(code int) bool {
   295  	return code == 403
   296  }
   297  
   298  // Code gets the status code for the delete endpoint Id forbidden response
   299  func (o *DeleteEndpointIDForbidden) Code() int {
   300  	return 403
   301  }
   302  
   303  func (o *DeleteEndpointIDForbidden) Error() string {
   304  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdForbidden ", 403)
   305  }
   306  
   307  func (o *DeleteEndpointIDForbidden) String() string {
   308  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdForbidden ", 403)
   309  }
   310  
   311  func (o *DeleteEndpointIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   312  
   313  	return nil
   314  }
   315  
   316  // NewDeleteEndpointIDNotFound creates a DeleteEndpointIDNotFound with default headers values
   317  func NewDeleteEndpointIDNotFound() *DeleteEndpointIDNotFound {
   318  	return &DeleteEndpointIDNotFound{}
   319  }
   320  
   321  /*
   322  DeleteEndpointIDNotFound describes a response with status code 404, with default header values.
   323  
   324  Endpoint not found
   325  */
   326  type DeleteEndpointIDNotFound struct {
   327  }
   328  
   329  // IsSuccess returns true when this delete endpoint Id not found response has a 2xx status code
   330  func (o *DeleteEndpointIDNotFound) IsSuccess() bool {
   331  	return false
   332  }
   333  
   334  // IsRedirect returns true when this delete endpoint Id not found response has a 3xx status code
   335  func (o *DeleteEndpointIDNotFound) IsRedirect() bool {
   336  	return false
   337  }
   338  
   339  // IsClientError returns true when this delete endpoint Id not found response has a 4xx status code
   340  func (o *DeleteEndpointIDNotFound) IsClientError() bool {
   341  	return true
   342  }
   343  
   344  // IsServerError returns true when this delete endpoint Id not found response has a 5xx status code
   345  func (o *DeleteEndpointIDNotFound) IsServerError() bool {
   346  	return false
   347  }
   348  
   349  // IsCode returns true when this delete endpoint Id not found response a status code equal to that given
   350  func (o *DeleteEndpointIDNotFound) IsCode(code int) bool {
   351  	return code == 404
   352  }
   353  
   354  // Code gets the status code for the delete endpoint Id not found response
   355  func (o *DeleteEndpointIDNotFound) Code() int {
   356  	return 404
   357  }
   358  
   359  func (o *DeleteEndpointIDNotFound) Error() string {
   360  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdNotFound ", 404)
   361  }
   362  
   363  func (o *DeleteEndpointIDNotFound) String() string {
   364  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdNotFound ", 404)
   365  }
   366  
   367  func (o *DeleteEndpointIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   368  
   369  	return nil
   370  }
   371  
   372  // NewDeleteEndpointIDTooManyRequests creates a DeleteEndpointIDTooManyRequests with default headers values
   373  func NewDeleteEndpointIDTooManyRequests() *DeleteEndpointIDTooManyRequests {
   374  	return &DeleteEndpointIDTooManyRequests{}
   375  }
   376  
   377  /*
   378  DeleteEndpointIDTooManyRequests describes a response with status code 429, with default header values.
   379  
   380  Rate-limiting too many requests in the given time frame
   381  */
   382  type DeleteEndpointIDTooManyRequests struct {
   383  }
   384  
   385  // IsSuccess returns true when this delete endpoint Id too many requests response has a 2xx status code
   386  func (o *DeleteEndpointIDTooManyRequests) IsSuccess() bool {
   387  	return false
   388  }
   389  
   390  // IsRedirect returns true when this delete endpoint Id too many requests response has a 3xx status code
   391  func (o *DeleteEndpointIDTooManyRequests) IsRedirect() bool {
   392  	return false
   393  }
   394  
   395  // IsClientError returns true when this delete endpoint Id too many requests response has a 4xx status code
   396  func (o *DeleteEndpointIDTooManyRequests) IsClientError() bool {
   397  	return true
   398  }
   399  
   400  // IsServerError returns true when this delete endpoint Id too many requests response has a 5xx status code
   401  func (o *DeleteEndpointIDTooManyRequests) IsServerError() bool {
   402  	return false
   403  }
   404  
   405  // IsCode returns true when this delete endpoint Id too many requests response a status code equal to that given
   406  func (o *DeleteEndpointIDTooManyRequests) IsCode(code int) bool {
   407  	return code == 429
   408  }
   409  
   410  // Code gets the status code for the delete endpoint Id too many requests response
   411  func (o *DeleteEndpointIDTooManyRequests) Code() int {
   412  	return 429
   413  }
   414  
   415  func (o *DeleteEndpointIDTooManyRequests) Error() string {
   416  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdTooManyRequests ", 429)
   417  }
   418  
   419  func (o *DeleteEndpointIDTooManyRequests) String() string {
   420  	return fmt.Sprintf("[DELETE /endpoint/{id}][%d] deleteEndpointIdTooManyRequests ", 429)
   421  }
   422  
   423  func (o *DeleteEndpointIDTooManyRequests) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   424  
   425  	return nil
   426  }