github.com/kubearmor/cilium@v1.6.12/api/v1/server/restapi/policy/put_policy_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package policy
     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  	"net/http"
    10  
    11  	"github.com/go-openapi/runtime"
    12  
    13  	models "github.com/cilium/cilium/api/v1/models"
    14  )
    15  
    16  // PutPolicyOKCode is the HTTP code returned for type PutPolicyOK
    17  const PutPolicyOKCode int = 200
    18  
    19  /*PutPolicyOK Success
    20  
    21  swagger:response putPolicyOK
    22  */
    23  type PutPolicyOK struct {
    24  
    25  	/*
    26  	  In: Body
    27  	*/
    28  	Payload *models.Policy `json:"body,omitempty"`
    29  }
    30  
    31  // NewPutPolicyOK creates PutPolicyOK with default headers values
    32  func NewPutPolicyOK() *PutPolicyOK {
    33  
    34  	return &PutPolicyOK{}
    35  }
    36  
    37  // WithPayload adds the payload to the put policy o k response
    38  func (o *PutPolicyOK) WithPayload(payload *models.Policy) *PutPolicyOK {
    39  	o.Payload = payload
    40  	return o
    41  }
    42  
    43  // SetPayload sets the payload to the put policy o k response
    44  func (o *PutPolicyOK) SetPayload(payload *models.Policy) {
    45  	o.Payload = payload
    46  }
    47  
    48  // WriteResponse to the client
    49  func (o *PutPolicyOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    50  
    51  	rw.WriteHeader(200)
    52  	if o.Payload != nil {
    53  		payload := o.Payload
    54  		if err := producer.Produce(rw, payload); err != nil {
    55  			panic(err) // let the recovery middleware deal with this
    56  		}
    57  	}
    58  }
    59  
    60  // PutPolicyInvalidPolicyCode is the HTTP code returned for type PutPolicyInvalidPolicy
    61  const PutPolicyInvalidPolicyCode int = 400
    62  
    63  /*PutPolicyInvalidPolicy Invalid policy
    64  
    65  swagger:response putPolicyInvalidPolicy
    66  */
    67  type PutPolicyInvalidPolicy struct {
    68  
    69  	/*
    70  	  In: Body
    71  	*/
    72  	Payload models.Error `json:"body,omitempty"`
    73  }
    74  
    75  // NewPutPolicyInvalidPolicy creates PutPolicyInvalidPolicy with default headers values
    76  func NewPutPolicyInvalidPolicy() *PutPolicyInvalidPolicy {
    77  
    78  	return &PutPolicyInvalidPolicy{}
    79  }
    80  
    81  // WithPayload adds the payload to the put policy invalid policy response
    82  func (o *PutPolicyInvalidPolicy) WithPayload(payload models.Error) *PutPolicyInvalidPolicy {
    83  	o.Payload = payload
    84  	return o
    85  }
    86  
    87  // SetPayload sets the payload to the put policy invalid policy response
    88  func (o *PutPolicyInvalidPolicy) SetPayload(payload models.Error) {
    89  	o.Payload = payload
    90  }
    91  
    92  // WriteResponse to the client
    93  func (o *PutPolicyInvalidPolicy) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    94  
    95  	rw.WriteHeader(400)
    96  	payload := o.Payload
    97  	if err := producer.Produce(rw, payload); err != nil {
    98  		panic(err) // let the recovery middleware deal with this
    99  	}
   100  }
   101  
   102  // PutPolicyInvalidPathCode is the HTTP code returned for type PutPolicyInvalidPath
   103  const PutPolicyInvalidPathCode int = 460
   104  
   105  /*PutPolicyInvalidPath Invalid path
   106  
   107  swagger:response putPolicyInvalidPath
   108  */
   109  type PutPolicyInvalidPath struct {
   110  
   111  	/*
   112  	  In: Body
   113  	*/
   114  	Payload models.Error `json:"body,omitempty"`
   115  }
   116  
   117  // NewPutPolicyInvalidPath creates PutPolicyInvalidPath with default headers values
   118  func NewPutPolicyInvalidPath() *PutPolicyInvalidPath {
   119  
   120  	return &PutPolicyInvalidPath{}
   121  }
   122  
   123  // WithPayload adds the payload to the put policy invalid path response
   124  func (o *PutPolicyInvalidPath) WithPayload(payload models.Error) *PutPolicyInvalidPath {
   125  	o.Payload = payload
   126  	return o
   127  }
   128  
   129  // SetPayload sets the payload to the put policy invalid path response
   130  func (o *PutPolicyInvalidPath) SetPayload(payload models.Error) {
   131  	o.Payload = payload
   132  }
   133  
   134  // WriteResponse to the client
   135  func (o *PutPolicyInvalidPath) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   136  
   137  	rw.WriteHeader(460)
   138  	payload := o.Payload
   139  	if err := producer.Produce(rw, payload); err != nil {
   140  		panic(err) // let the recovery middleware deal with this
   141  	}
   142  }
   143  
   144  // PutPolicyFailureCode is the HTTP code returned for type PutPolicyFailure
   145  const PutPolicyFailureCode int = 500
   146  
   147  /*PutPolicyFailure Policy import failed
   148  
   149  swagger:response putPolicyFailure
   150  */
   151  type PutPolicyFailure struct {
   152  
   153  	/*
   154  	  In: Body
   155  	*/
   156  	Payload models.Error `json:"body,omitempty"`
   157  }
   158  
   159  // NewPutPolicyFailure creates PutPolicyFailure with default headers values
   160  func NewPutPolicyFailure() *PutPolicyFailure {
   161  
   162  	return &PutPolicyFailure{}
   163  }
   164  
   165  // WithPayload adds the payload to the put policy failure response
   166  func (o *PutPolicyFailure) WithPayload(payload models.Error) *PutPolicyFailure {
   167  	o.Payload = payload
   168  	return o
   169  }
   170  
   171  // SetPayload sets the payload to the put policy failure response
   172  func (o *PutPolicyFailure) SetPayload(payload models.Error) {
   173  	o.Payload = payload
   174  }
   175  
   176  // WriteResponse to the client
   177  func (o *PutPolicyFailure) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   178  
   179  	rw.WriteHeader(500)
   180  	payload := o.Payload
   181  	if err := producer.Produce(rw, payload); err != nil {
   182  		panic(err) // let the recovery middleware deal with this
   183  	}
   184  }