github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/objects/objects_get_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 objects
    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  // ObjectsGetOKCode is the HTTP code returned for type ObjectsGetOK
    28  const ObjectsGetOKCode int = 200
    29  
    30  /*
    31  ObjectsGetOK Successful response.
    32  
    33  swagger:response objectsGetOK
    34  */
    35  type ObjectsGetOK struct {
    36  
    37  	/*
    38  	  In: Body
    39  	*/
    40  	Payload *models.Object `json:"body,omitempty"`
    41  }
    42  
    43  // NewObjectsGetOK creates ObjectsGetOK with default headers values
    44  func NewObjectsGetOK() *ObjectsGetOK {
    45  
    46  	return &ObjectsGetOK{}
    47  }
    48  
    49  // WithPayload adds the payload to the objects get o k response
    50  func (o *ObjectsGetOK) WithPayload(payload *models.Object) *ObjectsGetOK {
    51  	o.Payload = payload
    52  	return o
    53  }
    54  
    55  // SetPayload sets the payload to the objects get o k response
    56  func (o *ObjectsGetOK) SetPayload(payload *models.Object) {
    57  	o.Payload = payload
    58  }
    59  
    60  // WriteResponse to the client
    61  func (o *ObjectsGetOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    62  
    63  	rw.WriteHeader(200)
    64  	if o.Payload != nil {
    65  		payload := o.Payload
    66  		if err := producer.Produce(rw, payload); err != nil {
    67  			panic(err) // let the recovery middleware deal with this
    68  		}
    69  	}
    70  }
    71  
    72  // ObjectsGetBadRequestCode is the HTTP code returned for type ObjectsGetBadRequest
    73  const ObjectsGetBadRequestCode int = 400
    74  
    75  /*
    76  ObjectsGetBadRequest Malformed request.
    77  
    78  swagger:response objectsGetBadRequest
    79  */
    80  type ObjectsGetBadRequest struct {
    81  
    82  	/*
    83  	  In: Body
    84  	*/
    85  	Payload *models.ErrorResponse `json:"body,omitempty"`
    86  }
    87  
    88  // NewObjectsGetBadRequest creates ObjectsGetBadRequest with default headers values
    89  func NewObjectsGetBadRequest() *ObjectsGetBadRequest {
    90  
    91  	return &ObjectsGetBadRequest{}
    92  }
    93  
    94  // WithPayload adds the payload to the objects get bad request response
    95  func (o *ObjectsGetBadRequest) WithPayload(payload *models.ErrorResponse) *ObjectsGetBadRequest {
    96  	o.Payload = payload
    97  	return o
    98  }
    99  
   100  // SetPayload sets the payload to the objects get bad request response
   101  func (o *ObjectsGetBadRequest) SetPayload(payload *models.ErrorResponse) {
   102  	o.Payload = payload
   103  }
   104  
   105  // WriteResponse to the client
   106  func (o *ObjectsGetBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   107  
   108  	rw.WriteHeader(400)
   109  	if o.Payload != nil {
   110  		payload := o.Payload
   111  		if err := producer.Produce(rw, payload); err != nil {
   112  			panic(err) // let the recovery middleware deal with this
   113  		}
   114  	}
   115  }
   116  
   117  // ObjectsGetUnauthorizedCode is the HTTP code returned for type ObjectsGetUnauthorized
   118  const ObjectsGetUnauthorizedCode int = 401
   119  
   120  /*
   121  ObjectsGetUnauthorized Unauthorized or invalid credentials.
   122  
   123  swagger:response objectsGetUnauthorized
   124  */
   125  type ObjectsGetUnauthorized struct {
   126  }
   127  
   128  // NewObjectsGetUnauthorized creates ObjectsGetUnauthorized with default headers values
   129  func NewObjectsGetUnauthorized() *ObjectsGetUnauthorized {
   130  
   131  	return &ObjectsGetUnauthorized{}
   132  }
   133  
   134  // WriteResponse to the client
   135  func (o *ObjectsGetUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   136  
   137  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   138  
   139  	rw.WriteHeader(401)
   140  }
   141  
   142  // ObjectsGetForbiddenCode is the HTTP code returned for type ObjectsGetForbidden
   143  const ObjectsGetForbiddenCode int = 403
   144  
   145  /*
   146  ObjectsGetForbidden Forbidden
   147  
   148  swagger:response objectsGetForbidden
   149  */
   150  type ObjectsGetForbidden struct {
   151  
   152  	/*
   153  	  In: Body
   154  	*/
   155  	Payload *models.ErrorResponse `json:"body,omitempty"`
   156  }
   157  
   158  // NewObjectsGetForbidden creates ObjectsGetForbidden with default headers values
   159  func NewObjectsGetForbidden() *ObjectsGetForbidden {
   160  
   161  	return &ObjectsGetForbidden{}
   162  }
   163  
   164  // WithPayload adds the payload to the objects get forbidden response
   165  func (o *ObjectsGetForbidden) WithPayload(payload *models.ErrorResponse) *ObjectsGetForbidden {
   166  	o.Payload = payload
   167  	return o
   168  }
   169  
   170  // SetPayload sets the payload to the objects get forbidden response
   171  func (o *ObjectsGetForbidden) SetPayload(payload *models.ErrorResponse) {
   172  	o.Payload = payload
   173  }
   174  
   175  // WriteResponse to the client
   176  func (o *ObjectsGetForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   177  
   178  	rw.WriteHeader(403)
   179  	if o.Payload != nil {
   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  	}
   185  }
   186  
   187  // ObjectsGetNotFoundCode is the HTTP code returned for type ObjectsGetNotFound
   188  const ObjectsGetNotFoundCode int = 404
   189  
   190  /*
   191  ObjectsGetNotFound Successful query result but no resource was found.
   192  
   193  swagger:response objectsGetNotFound
   194  */
   195  type ObjectsGetNotFound struct {
   196  }
   197  
   198  // NewObjectsGetNotFound creates ObjectsGetNotFound with default headers values
   199  func NewObjectsGetNotFound() *ObjectsGetNotFound {
   200  
   201  	return &ObjectsGetNotFound{}
   202  }
   203  
   204  // WriteResponse to the client
   205  func (o *ObjectsGetNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   206  
   207  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   208  
   209  	rw.WriteHeader(404)
   210  }
   211  
   212  // ObjectsGetInternalServerErrorCode is the HTTP code returned for type ObjectsGetInternalServerError
   213  const ObjectsGetInternalServerErrorCode int = 500
   214  
   215  /*
   216  ObjectsGetInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error.
   217  
   218  swagger:response objectsGetInternalServerError
   219  */
   220  type ObjectsGetInternalServerError struct {
   221  
   222  	/*
   223  	  In: Body
   224  	*/
   225  	Payload *models.ErrorResponse `json:"body,omitempty"`
   226  }
   227  
   228  // NewObjectsGetInternalServerError creates ObjectsGetInternalServerError with default headers values
   229  func NewObjectsGetInternalServerError() *ObjectsGetInternalServerError {
   230  
   231  	return &ObjectsGetInternalServerError{}
   232  }
   233  
   234  // WithPayload adds the payload to the objects get internal server error response
   235  func (o *ObjectsGetInternalServerError) WithPayload(payload *models.ErrorResponse) *ObjectsGetInternalServerError {
   236  	o.Payload = payload
   237  	return o
   238  }
   239  
   240  // SetPayload sets the payload to the objects get internal server error response
   241  func (o *ObjectsGetInternalServerError) SetPayload(payload *models.ErrorResponse) {
   242  	o.Payload = payload
   243  }
   244  
   245  // WriteResponse to the client
   246  func (o *ObjectsGetInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   247  
   248  	rw.WriteHeader(500)
   249  	if o.Payload != nil {
   250  		payload := o.Payload
   251  		if err := producer.Produce(rw, payload); err != nil {
   252  			panic(err) // let the recovery middleware deal with this
   253  		}
   254  	}
   255  }