github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/objects/objects_head_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  // ObjectsHeadNoContentCode is the HTTP code returned for type ObjectsHeadNoContent
    28  const ObjectsHeadNoContentCode int = 204
    29  
    30  /*
    31  ObjectsHeadNoContent Object exists.
    32  
    33  swagger:response objectsHeadNoContent
    34  */
    35  type ObjectsHeadNoContent struct {
    36  }
    37  
    38  // NewObjectsHeadNoContent creates ObjectsHeadNoContent with default headers values
    39  func NewObjectsHeadNoContent() *ObjectsHeadNoContent {
    40  
    41  	return &ObjectsHeadNoContent{}
    42  }
    43  
    44  // WriteResponse to the client
    45  func (o *ObjectsHeadNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    46  
    47  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    48  
    49  	rw.WriteHeader(204)
    50  }
    51  
    52  // ObjectsHeadUnauthorizedCode is the HTTP code returned for type ObjectsHeadUnauthorized
    53  const ObjectsHeadUnauthorizedCode int = 401
    54  
    55  /*
    56  ObjectsHeadUnauthorized Unauthorized or invalid credentials.
    57  
    58  swagger:response objectsHeadUnauthorized
    59  */
    60  type ObjectsHeadUnauthorized struct {
    61  }
    62  
    63  // NewObjectsHeadUnauthorized creates ObjectsHeadUnauthorized with default headers values
    64  func NewObjectsHeadUnauthorized() *ObjectsHeadUnauthorized {
    65  
    66  	return &ObjectsHeadUnauthorized{}
    67  }
    68  
    69  // WriteResponse to the client
    70  func (o *ObjectsHeadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    71  
    72  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
    73  
    74  	rw.WriteHeader(401)
    75  }
    76  
    77  // ObjectsHeadForbiddenCode is the HTTP code returned for type ObjectsHeadForbidden
    78  const ObjectsHeadForbiddenCode int = 403
    79  
    80  /*
    81  ObjectsHeadForbidden Forbidden
    82  
    83  swagger:response objectsHeadForbidden
    84  */
    85  type ObjectsHeadForbidden struct {
    86  
    87  	/*
    88  	  In: Body
    89  	*/
    90  	Payload *models.ErrorResponse `json:"body,omitempty"`
    91  }
    92  
    93  // NewObjectsHeadForbidden creates ObjectsHeadForbidden with default headers values
    94  func NewObjectsHeadForbidden() *ObjectsHeadForbidden {
    95  
    96  	return &ObjectsHeadForbidden{}
    97  }
    98  
    99  // WithPayload adds the payload to the objects head forbidden response
   100  func (o *ObjectsHeadForbidden) WithPayload(payload *models.ErrorResponse) *ObjectsHeadForbidden {
   101  	o.Payload = payload
   102  	return o
   103  }
   104  
   105  // SetPayload sets the payload to the objects head forbidden response
   106  func (o *ObjectsHeadForbidden) SetPayload(payload *models.ErrorResponse) {
   107  	o.Payload = payload
   108  }
   109  
   110  // WriteResponse to the client
   111  func (o *ObjectsHeadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   112  
   113  	rw.WriteHeader(403)
   114  	if o.Payload != nil {
   115  		payload := o.Payload
   116  		if err := producer.Produce(rw, payload); err != nil {
   117  			panic(err) // let the recovery middleware deal with this
   118  		}
   119  	}
   120  }
   121  
   122  // ObjectsHeadNotFoundCode is the HTTP code returned for type ObjectsHeadNotFound
   123  const ObjectsHeadNotFoundCode int = 404
   124  
   125  /*
   126  ObjectsHeadNotFound Object doesn't exist.
   127  
   128  swagger:response objectsHeadNotFound
   129  */
   130  type ObjectsHeadNotFound struct {
   131  }
   132  
   133  // NewObjectsHeadNotFound creates ObjectsHeadNotFound with default headers values
   134  func NewObjectsHeadNotFound() *ObjectsHeadNotFound {
   135  
   136  	return &ObjectsHeadNotFound{}
   137  }
   138  
   139  // WriteResponse to the client
   140  func (o *ObjectsHeadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   141  
   142  	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
   143  
   144  	rw.WriteHeader(404)
   145  }
   146  
   147  // ObjectsHeadInternalServerErrorCode is the HTTP code returned for type ObjectsHeadInternalServerError
   148  const ObjectsHeadInternalServerErrorCode int = 500
   149  
   150  /*
   151  ObjectsHeadInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error.
   152  
   153  swagger:response objectsHeadInternalServerError
   154  */
   155  type ObjectsHeadInternalServerError struct {
   156  
   157  	/*
   158  	  In: Body
   159  	*/
   160  	Payload *models.ErrorResponse `json:"body,omitempty"`
   161  }
   162  
   163  // NewObjectsHeadInternalServerError creates ObjectsHeadInternalServerError with default headers values
   164  func NewObjectsHeadInternalServerError() *ObjectsHeadInternalServerError {
   165  
   166  	return &ObjectsHeadInternalServerError{}
   167  }
   168  
   169  // WithPayload adds the payload to the objects head internal server error response
   170  func (o *ObjectsHeadInternalServerError) WithPayload(payload *models.ErrorResponse) *ObjectsHeadInternalServerError {
   171  	o.Payload = payload
   172  	return o
   173  }
   174  
   175  // SetPayload sets the payload to the objects head internal server error response
   176  func (o *ObjectsHeadInternalServerError) SetPayload(payload *models.ErrorResponse) {
   177  	o.Payload = payload
   178  }
   179  
   180  // WriteResponse to the client
   181  func (o *ObjectsHeadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   182  
   183  	rw.WriteHeader(500)
   184  	if o.Payload != nil {
   185  		payload := o.Payload
   186  		if err := producer.Produce(rw, payload); err != nil {
   187  			panic(err) // let the recovery middleware deal with this
   188  		}
   189  	}
   190  }