github.com/kubearmor/cilium@v1.6.12/api/v1/client/endpoint/patch_endpoint_id_config_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package endpoint
     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  // PatchEndpointIDConfigReader is a Reader for the PatchEndpointIDConfig structure.
    20  type PatchEndpointIDConfigReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *PatchEndpointIDConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewPatchEndpointIDConfigOK()
    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 := NewPatchEndpointIDConfigInvalid()
    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 := NewPatchEndpointIDConfigNotFound()
    44  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    45  			return nil, err
    46  		}
    47  		return nil, result
    48  
    49  	case 500:
    50  		result := NewPatchEndpointIDConfigFailed()
    51  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    52  			return nil, err
    53  		}
    54  		return nil, result
    55  
    56  	default:
    57  		return nil, runtime.NewAPIError("unknown error", response, response.Code())
    58  	}
    59  }
    60  
    61  // NewPatchEndpointIDConfigOK creates a PatchEndpointIDConfigOK with default headers values
    62  func NewPatchEndpointIDConfigOK() *PatchEndpointIDConfigOK {
    63  	return &PatchEndpointIDConfigOK{}
    64  }
    65  
    66  /*PatchEndpointIDConfigOK handles this case with default header values.
    67  
    68  Success
    69  */
    70  type PatchEndpointIDConfigOK struct {
    71  }
    72  
    73  func (o *PatchEndpointIDConfigOK) Error() string {
    74  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigOK ", 200)
    75  }
    76  
    77  func (o *PatchEndpointIDConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    78  
    79  	return nil
    80  }
    81  
    82  // NewPatchEndpointIDConfigInvalid creates a PatchEndpointIDConfigInvalid with default headers values
    83  func NewPatchEndpointIDConfigInvalid() *PatchEndpointIDConfigInvalid {
    84  	return &PatchEndpointIDConfigInvalid{}
    85  }
    86  
    87  /*PatchEndpointIDConfigInvalid handles this case with default header values.
    88  
    89  Invalid configuration request
    90  */
    91  type PatchEndpointIDConfigInvalid struct {
    92  }
    93  
    94  func (o *PatchEndpointIDConfigInvalid) Error() string {
    95  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigInvalid ", 400)
    96  }
    97  
    98  func (o *PatchEndpointIDConfigInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    99  
   100  	return nil
   101  }
   102  
   103  // NewPatchEndpointIDConfigNotFound creates a PatchEndpointIDConfigNotFound with default headers values
   104  func NewPatchEndpointIDConfigNotFound() *PatchEndpointIDConfigNotFound {
   105  	return &PatchEndpointIDConfigNotFound{}
   106  }
   107  
   108  /*PatchEndpointIDConfigNotFound handles this case with default header values.
   109  
   110  Endpoint not found
   111  */
   112  type PatchEndpointIDConfigNotFound struct {
   113  }
   114  
   115  func (o *PatchEndpointIDConfigNotFound) Error() string {
   116  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigNotFound ", 404)
   117  }
   118  
   119  func (o *PatchEndpointIDConfigNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   120  
   121  	return nil
   122  }
   123  
   124  // NewPatchEndpointIDConfigFailed creates a PatchEndpointIDConfigFailed with default headers values
   125  func NewPatchEndpointIDConfigFailed() *PatchEndpointIDConfigFailed {
   126  	return &PatchEndpointIDConfigFailed{}
   127  }
   128  
   129  /*PatchEndpointIDConfigFailed handles this case with default header values.
   130  
   131  Update failed. Details in message.
   132  */
   133  type PatchEndpointIDConfigFailed struct {
   134  	Payload models.Error
   135  }
   136  
   137  func (o *PatchEndpointIDConfigFailed) Error() string {
   138  	return fmt.Sprintf("[PATCH /endpoint/{id}/config][%d] patchEndpointIdConfigFailed  %+v", 500, o.Payload)
   139  }
   140  
   141  func (o *PatchEndpointIDConfigFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   142  
   143  	// response payload
   144  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   145  		return err
   146  	}
   147  
   148  	return nil
   149  }