github.com/cilium/cilium@v1.16.2/api/v1/server/restapi/policy/get_identity_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 policy
     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  // GetIdentityOKCode is the HTTP code returned for type GetIdentityOK
    20  const GetIdentityOKCode int = 200
    21  
    22  /*
    23  GetIdentityOK Success
    24  
    25  swagger:response getIdentityOK
    26  */
    27  type GetIdentityOK struct {
    28  
    29  	/*
    30  	  In: Body
    31  	*/
    32  	Payload []*models.Identity `json:"body,omitempty"`
    33  }
    34  
    35  // NewGetIdentityOK creates GetIdentityOK with default headers values
    36  func NewGetIdentityOK() *GetIdentityOK {
    37  
    38  	return &GetIdentityOK{}
    39  }
    40  
    41  // WithPayload adds the payload to the get identity o k response
    42  func (o *GetIdentityOK) WithPayload(payload []*models.Identity) *GetIdentityOK {
    43  	o.Payload = payload
    44  	return o
    45  }
    46  
    47  // SetPayload sets the payload to the get identity o k response
    48  func (o *GetIdentityOK) SetPayload(payload []*models.Identity) {
    49  	o.Payload = payload
    50  }
    51  
    52  // WriteResponse to the client
    53  func (o *GetIdentityOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    54  
    55  	rw.WriteHeader(200)
    56  	payload := o.Payload
    57  	if payload == nil {
    58  		// return empty array
    59  		payload = make([]*models.Identity, 0, 50)
    60  	}
    61  
    62  	if err := producer.Produce(rw, payload); err != nil {
    63  		panic(err) // let the recovery middleware deal with this
    64  	}
    65  }
    66  
    67  // GetIdentityNotFoundCode is the HTTP code returned for type GetIdentityNotFound
    68  const GetIdentityNotFoundCode int = 404
    69  
    70  /*
    71  GetIdentityNotFound Identities with provided parameters not found
    72  
    73  swagger:response getIdentityNotFound
    74  */
    75  type GetIdentityNotFound struct {
    76  }
    77  
    78  // NewGetIdentityNotFound creates GetIdentityNotFound with default headers values
    79  func NewGetIdentityNotFound() *GetIdentityNotFound {
    80  
    81  	return &GetIdentityNotFound{}
    82  }
    83  
    84  // WriteResponse to the client
    85  func (o *GetIdentityNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    86  
    87  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    88  
    89  	rw.WriteHeader(404)
    90  }
    91  
    92  // GetIdentityUnreachableCode is the HTTP code returned for type GetIdentityUnreachable
    93  const GetIdentityUnreachableCode int = 520
    94  
    95  /*
    96  GetIdentityUnreachable Identity storage unreachable. Likely a network problem.
    97  
    98  swagger:response getIdentityUnreachable
    99  */
   100  type GetIdentityUnreachable struct {
   101  
   102  	/*
   103  	  In: Body
   104  	*/
   105  	Payload models.Error `json:"body,omitempty"`
   106  }
   107  
   108  // NewGetIdentityUnreachable creates GetIdentityUnreachable with default headers values
   109  func NewGetIdentityUnreachable() *GetIdentityUnreachable {
   110  
   111  	return &GetIdentityUnreachable{}
   112  }
   113  
   114  // WithPayload adds the payload to the get identity unreachable response
   115  func (o *GetIdentityUnreachable) WithPayload(payload models.Error) *GetIdentityUnreachable {
   116  	o.Payload = payload
   117  	return o
   118  }
   119  
   120  // SetPayload sets the payload to the get identity unreachable response
   121  func (o *GetIdentityUnreachable) SetPayload(payload models.Error) {
   122  	o.Payload = payload
   123  }
   124  
   125  // WriteResponse to the client
   126  func (o *GetIdentityUnreachable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   127  
   128  	rw.WriteHeader(520)
   129  	payload := o.Payload
   130  	if err := producer.Produce(rw, payload); err != nil {
   131  		panic(err) // let the recovery middleware deal with this
   132  	}
   133  }
   134  
   135  // GetIdentityInvalidStorageFormatCode is the HTTP code returned for type GetIdentityInvalidStorageFormat
   136  const GetIdentityInvalidStorageFormatCode int = 521
   137  
   138  /*
   139  GetIdentityInvalidStorageFormat Invalid identity format in storage
   140  
   141  swagger:response getIdentityInvalidStorageFormat
   142  */
   143  type GetIdentityInvalidStorageFormat struct {
   144  
   145  	/*
   146  	  In: Body
   147  	*/
   148  	Payload models.Error `json:"body,omitempty"`
   149  }
   150  
   151  // NewGetIdentityInvalidStorageFormat creates GetIdentityInvalidStorageFormat with default headers values
   152  func NewGetIdentityInvalidStorageFormat() *GetIdentityInvalidStorageFormat {
   153  
   154  	return &GetIdentityInvalidStorageFormat{}
   155  }
   156  
   157  // WithPayload adds the payload to the get identity invalid storage format response
   158  func (o *GetIdentityInvalidStorageFormat) WithPayload(payload models.Error) *GetIdentityInvalidStorageFormat {
   159  	o.Payload = payload
   160  	return o
   161  }
   162  
   163  // SetPayload sets the payload to the get identity invalid storage format response
   164  func (o *GetIdentityInvalidStorageFormat) SetPayload(payload models.Error) {
   165  	o.Payload = payload
   166  }
   167  
   168  // WriteResponse to the client
   169  func (o *GetIdentityInvalidStorageFormat) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   170  
   171  	rw.WriteHeader(521)
   172  	payload := o.Payload
   173  	if err := producer.Produce(rw, payload); err != nil {
   174  		panic(err) // let the recovery middleware deal with this
   175  	}
   176  }