github.com/kubearmor/cilium@v1.6.12/api/v1/client/daemon/get_config_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package daemon
     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  // GetConfigReader is a Reader for the GetConfig structure.
    20  type GetConfigReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *GetConfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewGetConfigOK()
    30  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    31  			return nil, err
    32  		}
    33  		return result, nil
    34  
    35  	default:
    36  		return nil, runtime.NewAPIError("unknown error", response, response.Code())
    37  	}
    38  }
    39  
    40  // NewGetConfigOK creates a GetConfigOK with default headers values
    41  func NewGetConfigOK() *GetConfigOK {
    42  	return &GetConfigOK{}
    43  }
    44  
    45  /*GetConfigOK handles this case with default header values.
    46  
    47  Success
    48  */
    49  type GetConfigOK struct {
    50  	Payload *models.DaemonConfiguration
    51  }
    52  
    53  func (o *GetConfigOK) Error() string {
    54  	return fmt.Sprintf("[GET /config][%d] getConfigOK  %+v", 200, o.Payload)
    55  }
    56  
    57  func (o *GetConfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    58  
    59  	o.Payload = new(models.DaemonConfiguration)
    60  
    61  	// response payload
    62  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
    63  		return err
    64  	}
    65  
    66  	return nil
    67  }