github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/batch/batch_references_create_responses.go (about)

     1  //                           _       _
     2  // __      _____  __ ___   ___  __ _| |_ ___
     3  // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
     4  //  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
     5  //   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
     6  //
     7  //  Copyright © 2016 - 2024 Weaviate B.V. All rights reserved.
     8  //
     9  //  CONTACT: hello@weaviate.io
    10  //
    11  
    12  // Code generated by go-swagger; DO NOT EDIT.
    13  
    14  package batch
    15  
    16  // This file was generated by the swagger tool.
    17  // Editing this file might prove futile when you re-run the swagger generate command
    18  
    19  import (
    20  	"net/http"
    21  
    22  	"github.com/go-openapi/runtime"
    23  
    24  	"github.com/weaviate/weaviate/entities/models"
    25  )
    26  
    27  // BatchReferencesCreateOKCode is the HTTP code returned for type BatchReferencesCreateOK
    28  const BatchReferencesCreateOKCode int = 200
    29  
    30  /*
    31  BatchReferencesCreateOK Request Successful. Warning: A successful request does not guarantee that every batched reference was successfully created. Inspect the response body to see which references succeeded and which failed.
    32  
    33  swagger:response batchReferencesCreateOK
    34  */
    35  type BatchReferencesCreateOK struct {
    36  
    37  	/*
    38  	  In: Body
    39  	*/
    40  	Payload []*models.BatchReferenceResponse `json:"body,omitempty"`
    41  }
    42  
    43  // NewBatchReferencesCreateOK creates BatchReferencesCreateOK with default headers values
    44  func NewBatchReferencesCreateOK() *BatchReferencesCreateOK {
    45  
    46  	return &BatchReferencesCreateOK{}
    47  }
    48  
    49  // WithPayload adds the payload to the batch references create o k response
    50  func (o *BatchReferencesCreateOK) WithPayload(payload []*models.BatchReferenceResponse) *BatchReferencesCreateOK {
    51  	o.Payload = payload
    52  	return o
    53  }
    54  
    55  // SetPayload sets the payload to the batch references create o k response
    56  func (o *BatchReferencesCreateOK) SetPayload(payload []*models.BatchReferenceResponse) {
    57  	o.Payload = payload
    58  }
    59  
    60  // WriteResponse to the client
    61  func (o *BatchReferencesCreateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    62  
    63  	rw.WriteHeader(200)
    64  	payload := o.Payload
    65  	if payload == nil {
    66  		// return empty array
    67  		payload = make([]*models.BatchReferenceResponse, 0, 50)
    68  	}
    69  
    70  	if err := producer.Produce(rw, payload); err != nil {
    71  		panic(err) // let the recovery middleware deal with this
    72  	}
    73  }
    74  
    75  // BatchReferencesCreateBadRequestCode is the HTTP code returned for type BatchReferencesCreateBadRequest
    76  const BatchReferencesCreateBadRequestCode int = 400
    77  
    78  /*
    79  BatchReferencesCreateBadRequest Malformed request.
    80  
    81  swagger:response batchReferencesCreateBadRequest
    82  */
    83  type BatchReferencesCreateBadRequest struct {
    84  
    85  	/*
    86  	  In: Body
    87  	*/
    88  	Payload *models.ErrorResponse `json:"body,omitempty"`
    89  }
    90  
    91  // NewBatchReferencesCreateBadRequest creates BatchReferencesCreateBadRequest with default headers values
    92  func NewBatchReferencesCreateBadRequest() *BatchReferencesCreateBadRequest {
    93  
    94  	return &BatchReferencesCreateBadRequest{}
    95  }
    96  
    97  // WithPayload adds the payload to the batch references create bad request response
    98  func (o *BatchReferencesCreateBadRequest) WithPayload(payload *models.ErrorResponse) *BatchReferencesCreateBadRequest {
    99  	o.Payload = payload
   100  	return o
   101  }
   102  
   103  // SetPayload sets the payload to the batch references create bad request response
   104  func (o *BatchReferencesCreateBadRequest) SetPayload(payload *models.ErrorResponse) {
   105  	o.Payload = payload
   106  }
   107  
   108  // WriteResponse to the client
   109  func (o *BatchReferencesCreateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   110  
   111  	rw.WriteHeader(400)
   112  	if o.Payload != nil {
   113  		payload := o.Payload
   114  		if err := producer.Produce(rw, payload); err != nil {
   115  			panic(err) // let the recovery middleware deal with this
   116  		}
   117  	}
   118  }
   119  
   120  // BatchReferencesCreateUnauthorizedCode is the HTTP code returned for type BatchReferencesCreateUnauthorized
   121  const BatchReferencesCreateUnauthorizedCode int = 401
   122  
   123  /*
   124  BatchReferencesCreateUnauthorized Unauthorized or invalid credentials.
   125  
   126  swagger:response batchReferencesCreateUnauthorized
   127  */
   128  type BatchReferencesCreateUnauthorized struct {
   129  }
   130  
   131  // NewBatchReferencesCreateUnauthorized creates BatchReferencesCreateUnauthorized with default headers values
   132  func NewBatchReferencesCreateUnauthorized() *BatchReferencesCreateUnauthorized {
   133  
   134  	return &BatchReferencesCreateUnauthorized{}
   135  }
   136  
   137  // WriteResponse to the client
   138  func (o *BatchReferencesCreateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   139  
   140  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   141  
   142  	rw.WriteHeader(401)
   143  }
   144  
   145  // BatchReferencesCreateForbiddenCode is the HTTP code returned for type BatchReferencesCreateForbidden
   146  const BatchReferencesCreateForbiddenCode int = 403
   147  
   148  /*
   149  BatchReferencesCreateForbidden Forbidden
   150  
   151  swagger:response batchReferencesCreateForbidden
   152  */
   153  type BatchReferencesCreateForbidden struct {
   154  
   155  	/*
   156  	  In: Body
   157  	*/
   158  	Payload *models.ErrorResponse `json:"body,omitempty"`
   159  }
   160  
   161  // NewBatchReferencesCreateForbidden creates BatchReferencesCreateForbidden with default headers values
   162  func NewBatchReferencesCreateForbidden() *BatchReferencesCreateForbidden {
   163  
   164  	return &BatchReferencesCreateForbidden{}
   165  }
   166  
   167  // WithPayload adds the payload to the batch references create forbidden response
   168  func (o *BatchReferencesCreateForbidden) WithPayload(payload *models.ErrorResponse) *BatchReferencesCreateForbidden {
   169  	o.Payload = payload
   170  	return o
   171  }
   172  
   173  // SetPayload sets the payload to the batch references create forbidden response
   174  func (o *BatchReferencesCreateForbidden) SetPayload(payload *models.ErrorResponse) {
   175  	o.Payload = payload
   176  }
   177  
   178  // WriteResponse to the client
   179  func (o *BatchReferencesCreateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   180  
   181  	rw.WriteHeader(403)
   182  	if o.Payload != nil {
   183  		payload := o.Payload
   184  		if err := producer.Produce(rw, payload); err != nil {
   185  			panic(err) // let the recovery middleware deal with this
   186  		}
   187  	}
   188  }
   189  
   190  // BatchReferencesCreateUnprocessableEntityCode is the HTTP code returned for type BatchReferencesCreateUnprocessableEntity
   191  const BatchReferencesCreateUnprocessableEntityCode int = 422
   192  
   193  /*
   194  BatchReferencesCreateUnprocessableEntity Request body is well-formed (i.e., syntactically correct), but semantically erroneous. Are you sure the class is defined in the configuration file?
   195  
   196  swagger:response batchReferencesCreateUnprocessableEntity
   197  */
   198  type BatchReferencesCreateUnprocessableEntity struct {
   199  
   200  	/*
   201  	  In: Body
   202  	*/
   203  	Payload *models.ErrorResponse `json:"body,omitempty"`
   204  }
   205  
   206  // NewBatchReferencesCreateUnprocessableEntity creates BatchReferencesCreateUnprocessableEntity with default headers values
   207  func NewBatchReferencesCreateUnprocessableEntity() *BatchReferencesCreateUnprocessableEntity {
   208  
   209  	return &BatchReferencesCreateUnprocessableEntity{}
   210  }
   211  
   212  // WithPayload adds the payload to the batch references create unprocessable entity response
   213  func (o *BatchReferencesCreateUnprocessableEntity) WithPayload(payload *models.ErrorResponse) *BatchReferencesCreateUnprocessableEntity {
   214  	o.Payload = payload
   215  	return o
   216  }
   217  
   218  // SetPayload sets the payload to the batch references create unprocessable entity response
   219  func (o *BatchReferencesCreateUnprocessableEntity) SetPayload(payload *models.ErrorResponse) {
   220  	o.Payload = payload
   221  }
   222  
   223  // WriteResponse to the client
   224  func (o *BatchReferencesCreateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   225  
   226  	rw.WriteHeader(422)
   227  	if o.Payload != nil {
   228  		payload := o.Payload
   229  		if err := producer.Produce(rw, payload); err != nil {
   230  			panic(err) // let the recovery middleware deal with this
   231  		}
   232  	}
   233  }
   234  
   235  // BatchReferencesCreateInternalServerErrorCode is the HTTP code returned for type BatchReferencesCreateInternalServerError
   236  const BatchReferencesCreateInternalServerErrorCode int = 500
   237  
   238  /*
   239  BatchReferencesCreateInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error.
   240  
   241  swagger:response batchReferencesCreateInternalServerError
   242  */
   243  type BatchReferencesCreateInternalServerError struct {
   244  
   245  	/*
   246  	  In: Body
   247  	*/
   248  	Payload *models.ErrorResponse `json:"body,omitempty"`
   249  }
   250  
   251  // NewBatchReferencesCreateInternalServerError creates BatchReferencesCreateInternalServerError with default headers values
   252  func NewBatchReferencesCreateInternalServerError() *BatchReferencesCreateInternalServerError {
   253  
   254  	return &BatchReferencesCreateInternalServerError{}
   255  }
   256  
   257  // WithPayload adds the payload to the batch references create internal server error response
   258  func (o *BatchReferencesCreateInternalServerError) WithPayload(payload *models.ErrorResponse) *BatchReferencesCreateInternalServerError {
   259  	o.Payload = payload
   260  	return o
   261  }
   262  
   263  // SetPayload sets the payload to the batch references create internal server error response
   264  func (o *BatchReferencesCreateInternalServerError) SetPayload(payload *models.ErrorResponse) {
   265  	o.Payload = payload
   266  }
   267  
   268  // WriteResponse to the client
   269  func (o *BatchReferencesCreateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   270  
   271  	rw.WriteHeader(500)
   272  	if o.Payload != nil {
   273  		payload := o.Payload
   274  		if err := producer.Produce(rw, payload); err != nil {
   275  			panic(err) // let the recovery middleware deal with this
   276  		}
   277  	}
   278  }