github.com/kubearmor/cilium@v1.6.12/api/v1/client/ipam/post_ip_a_m_ip_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package ipam
     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  // PostIPAMIPReader is a Reader for the PostIPAMIP structure.
    20  type PostIPAMIPReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *PostIPAMIPReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewPostIPAMIPOK()
    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 := NewPostIPAMIPInvalid()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  
    42  	case 409:
    43  		result := NewPostIPAMIPExists()
    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 := NewPostIPAMIPFailure()
    51  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    52  			return nil, err
    53  		}
    54  		return nil, result
    55  
    56  	case 501:
    57  		result := NewPostIPAMIPDisabled()
    58  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    59  			return nil, err
    60  		}
    61  		return nil, result
    62  
    63  	default:
    64  		return nil, runtime.NewAPIError("unknown error", response, response.Code())
    65  	}
    66  }
    67  
    68  // NewPostIPAMIPOK creates a PostIPAMIPOK with default headers values
    69  func NewPostIPAMIPOK() *PostIPAMIPOK {
    70  	return &PostIPAMIPOK{}
    71  }
    72  
    73  /*PostIPAMIPOK handles this case with default header values.
    74  
    75  Success
    76  */
    77  type PostIPAMIPOK struct {
    78  }
    79  
    80  func (o *PostIPAMIPOK) Error() string {
    81  	return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpAMIpOK ", 200)
    82  }
    83  
    84  func (o *PostIPAMIPOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    85  
    86  	return nil
    87  }
    88  
    89  // NewPostIPAMIPInvalid creates a PostIPAMIPInvalid with default headers values
    90  func NewPostIPAMIPInvalid() *PostIPAMIPInvalid {
    91  	return &PostIPAMIPInvalid{}
    92  }
    93  
    94  /*PostIPAMIPInvalid handles this case with default header values.
    95  
    96  Invalid IP address
    97  */
    98  type PostIPAMIPInvalid struct {
    99  }
   100  
   101  func (o *PostIPAMIPInvalid) Error() string {
   102  	return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpAMIpInvalid ", 400)
   103  }
   104  
   105  func (o *PostIPAMIPInvalid) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   106  
   107  	return nil
   108  }
   109  
   110  // NewPostIPAMIPExists creates a PostIPAMIPExists with default headers values
   111  func NewPostIPAMIPExists() *PostIPAMIPExists {
   112  	return &PostIPAMIPExists{}
   113  }
   114  
   115  /*PostIPAMIPExists handles this case with default header values.
   116  
   117  IP already allocated
   118  */
   119  type PostIPAMIPExists struct {
   120  }
   121  
   122  func (o *PostIPAMIPExists) Error() string {
   123  	return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpAMIpExists ", 409)
   124  }
   125  
   126  func (o *PostIPAMIPExists) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   127  
   128  	return nil
   129  }
   130  
   131  // NewPostIPAMIPFailure creates a PostIPAMIPFailure with default headers values
   132  func NewPostIPAMIPFailure() *PostIPAMIPFailure {
   133  	return &PostIPAMIPFailure{}
   134  }
   135  
   136  /*PostIPAMIPFailure handles this case with default header values.
   137  
   138  IP allocation failure. Details in message.
   139  */
   140  type PostIPAMIPFailure struct {
   141  	Payload models.Error
   142  }
   143  
   144  func (o *PostIPAMIPFailure) Error() string {
   145  	return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpAMIpFailure  %+v", 500, o.Payload)
   146  }
   147  
   148  func (o *PostIPAMIPFailure) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   149  
   150  	// response payload
   151  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   152  		return err
   153  	}
   154  
   155  	return nil
   156  }
   157  
   158  // NewPostIPAMIPDisabled creates a PostIPAMIPDisabled with default headers values
   159  func NewPostIPAMIPDisabled() *PostIPAMIPDisabled {
   160  	return &PostIPAMIPDisabled{}
   161  }
   162  
   163  /*PostIPAMIPDisabled handles this case with default header values.
   164  
   165  Allocation for address family disabled
   166  */
   167  type PostIPAMIPDisabled struct {
   168  }
   169  
   170  func (o *PostIPAMIPDisabled) Error() string {
   171  	return fmt.Sprintf("[POST /ipam/{ip}][%d] postIpAMIpDisabled ", 501)
   172  }
   173  
   174  func (o *PostIPAMIPDisabled) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   175  
   176  	return nil
   177  }