github.com/kubearmor/cilium@v1.6.12/api/v1/health/client/connectivity/put_status_probe_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package connectivity
     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/health/models"
    17  )
    18  
    19  // PutStatusProbeReader is a Reader for the PutStatusProbe structure.
    20  type PutStatusProbeReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *PutStatusProbeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewPutStatusProbeOK()
    30  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    31  			return nil, err
    32  		}
    33  		return result, nil
    34  
    35  	case 500:
    36  		result := NewPutStatusProbeFailed()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  
    42  	default:
    43  		return nil, runtime.NewAPIError("unknown error", response, response.Code())
    44  	}
    45  }
    46  
    47  // NewPutStatusProbeOK creates a PutStatusProbeOK with default headers values
    48  func NewPutStatusProbeOK() *PutStatusProbeOK {
    49  	return &PutStatusProbeOK{}
    50  }
    51  
    52  /*PutStatusProbeOK handles this case with default header values.
    53  
    54  Success
    55  */
    56  type PutStatusProbeOK struct {
    57  	Payload *models.HealthStatusResponse
    58  }
    59  
    60  func (o *PutStatusProbeOK) Error() string {
    61  	return fmt.Sprintf("[PUT /status/probe][%d] putStatusProbeOK  %+v", 200, o.Payload)
    62  }
    63  
    64  func (o *PutStatusProbeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    65  
    66  	o.Payload = new(models.HealthStatusResponse)
    67  
    68  	// response payload
    69  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
    70  		return err
    71  	}
    72  
    73  	return nil
    74  }
    75  
    76  // NewPutStatusProbeFailed creates a PutStatusProbeFailed with default headers values
    77  func NewPutStatusProbeFailed() *PutStatusProbeFailed {
    78  	return &PutStatusProbeFailed{}
    79  }
    80  
    81  /*PutStatusProbeFailed handles this case with default header values.
    82  
    83  Internal error occurred while conducting connectivity probe
    84  */
    85  type PutStatusProbeFailed struct {
    86  	Payload models.Error
    87  }
    88  
    89  func (o *PutStatusProbeFailed) Error() string {
    90  	return fmt.Sprintf("[PUT /status/probe][%d] putStatusProbeFailed  %+v", 500, o.Payload)
    91  }
    92  
    93  func (o *PutStatusProbeFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    94  
    95  	// response payload
    96  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
    97  		return err
    98  	}
    99  
   100  	return nil
   101  }