github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/ipam/post_ipam_ip_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 ipam
     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  	"net/http"
    13  
    14  	"github.com/go-openapi/runtime"
    15  
    16  	"github.com/cilium/cilium/api/v1/models"
    17  )
    18  
    19  // PostIpamIPOKCode is the HTTP code returned for type PostIpamIPOK
    20  const PostIpamIPOKCode int = 200
    21  
    22  /*
    23  PostIpamIPOK Success
    24  
    25  swagger:response postIpamIpOK
    26  */
    27  type PostIpamIPOK struct {
    28  }
    29  
    30  // NewPostIpamIPOK creates PostIpamIPOK with default headers values
    31  func NewPostIpamIPOK() *PostIpamIPOK {
    32  
    33  	return &PostIpamIPOK{}
    34  }
    35  
    36  // WriteResponse to the client
    37  func (o *PostIpamIPOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    38  
    39  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    40  
    41  	rw.WriteHeader(200)
    42  }
    43  
    44  // PostIpamIPInvalidCode is the HTTP code returned for type PostIpamIPInvalid
    45  const PostIpamIPInvalidCode int = 400
    46  
    47  /*
    48  PostIpamIPInvalid Invalid IP address
    49  
    50  swagger:response postIpamIpInvalid
    51  */
    52  type PostIpamIPInvalid struct {
    53  }
    54  
    55  // NewPostIpamIPInvalid creates PostIpamIPInvalid with default headers values
    56  func NewPostIpamIPInvalid() *PostIpamIPInvalid {
    57  
    58  	return &PostIpamIPInvalid{}
    59  }
    60  
    61  // WriteResponse to the client
    62  func (o *PostIpamIPInvalid) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    63  
    64  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    65  
    66  	rw.WriteHeader(400)
    67  }
    68  
    69  // PostIpamIPForbiddenCode is the HTTP code returned for type PostIpamIPForbidden
    70  const PostIpamIPForbiddenCode int = 403
    71  
    72  /*
    73  PostIpamIPForbidden Forbidden
    74  
    75  swagger:response postIpamIpForbidden
    76  */
    77  type PostIpamIPForbidden struct {
    78  }
    79  
    80  // NewPostIpamIPForbidden creates PostIpamIPForbidden with default headers values
    81  func NewPostIpamIPForbidden() *PostIpamIPForbidden {
    82  
    83  	return &PostIpamIPForbidden{}
    84  }
    85  
    86  // WriteResponse to the client
    87  func (o *PostIpamIPForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    88  
    89  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    90  
    91  	rw.WriteHeader(403)
    92  }
    93  
    94  // PostIpamIPExistsCode is the HTTP code returned for type PostIpamIPExists
    95  const PostIpamIPExistsCode int = 409
    96  
    97  /*
    98  PostIpamIPExists IP already allocated
    99  
   100  swagger:response postIpamIpExists
   101  */
   102  type PostIpamIPExists struct {
   103  }
   104  
   105  // NewPostIpamIPExists creates PostIpamIPExists with default headers values
   106  func NewPostIpamIPExists() *PostIpamIPExists {
   107  
   108  	return &PostIpamIPExists{}
   109  }
   110  
   111  // WriteResponse to the client
   112  func (o *PostIpamIPExists) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   113  
   114  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   115  
   116  	rw.WriteHeader(409)
   117  }
   118  
   119  // PostIpamIPFailureCode is the HTTP code returned for type PostIpamIPFailure
   120  const PostIpamIPFailureCode int = 500
   121  
   122  /*
   123  PostIpamIPFailure IP allocation failure. Details in message.
   124  
   125  swagger:response postIpamIpFailure
   126  */
   127  type PostIpamIPFailure struct {
   128  
   129  	/*
   130  	  In: Body
   131  	*/
   132  	Payload models.Error `json:"body,omitempty"`
   133  }
   134  
   135  // NewPostIpamIPFailure creates PostIpamIPFailure with default headers values
   136  func NewPostIpamIPFailure() *PostIpamIPFailure {
   137  
   138  	return &PostIpamIPFailure{}
   139  }
   140  
   141  // WithPayload adds the payload to the post ipam Ip failure response
   142  func (o *PostIpamIPFailure) WithPayload(payload models.Error) *PostIpamIPFailure {
   143  	o.Payload = payload
   144  	return o
   145  }
   146  
   147  // SetPayload sets the payload to the post ipam Ip failure response
   148  func (o *PostIpamIPFailure) SetPayload(payload models.Error) {
   149  	o.Payload = payload
   150  }
   151  
   152  // WriteResponse to the client
   153  func (o *PostIpamIPFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   154  
   155  	rw.WriteHeader(500)
   156  	payload := o.Payload
   157  	if err := producer.Produce(rw, payload); err != nil {
   158  		panic(err) // let the recovery middleware deal with this
   159  	}
   160  }
   161  
   162  // PostIpamIPDisabledCode is the HTTP code returned for type PostIpamIPDisabled
   163  const PostIpamIPDisabledCode int = 501
   164  
   165  /*
   166  PostIpamIPDisabled Allocation for address family disabled
   167  
   168  swagger:response postIpamIpDisabled
   169  */
   170  type PostIpamIPDisabled struct {
   171  }
   172  
   173  // NewPostIpamIPDisabled creates PostIpamIPDisabled with default headers values
   174  func NewPostIpamIPDisabled() *PostIpamIPDisabled {
   175  
   176  	return &PostIpamIPDisabled{}
   177  }
   178  
   179  // WriteResponse to the client
   180  func (o *PostIpamIPDisabled) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   181  
   182  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   183  
   184  	rw.WriteHeader(501)
   185  }