github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/objects/objects_validate_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 // ObjectsValidateOKCode is the HTTP code returned for type ObjectsValidateOK 28 const ObjectsValidateOKCode int = 200 29 30 /* 31 ObjectsValidateOK Successfully validated. 32 33 swagger:response objectsValidateOK 34 */ 35 type ObjectsValidateOK struct { 36 } 37 38 // NewObjectsValidateOK creates ObjectsValidateOK with default headers values 39 func NewObjectsValidateOK() *ObjectsValidateOK { 40 41 return &ObjectsValidateOK{} 42 } 43 44 // WriteResponse to the client 45 func (o *ObjectsValidateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 46 47 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 48 49 rw.WriteHeader(200) 50 } 51 52 // ObjectsValidateUnauthorizedCode is the HTTP code returned for type ObjectsValidateUnauthorized 53 const ObjectsValidateUnauthorizedCode int = 401 54 55 /* 56 ObjectsValidateUnauthorized Unauthorized or invalid credentials. 57 58 swagger:response objectsValidateUnauthorized 59 */ 60 type ObjectsValidateUnauthorized struct { 61 } 62 63 // NewObjectsValidateUnauthorized creates ObjectsValidateUnauthorized with default headers values 64 func NewObjectsValidateUnauthorized() *ObjectsValidateUnauthorized { 65 66 return &ObjectsValidateUnauthorized{} 67 } 68 69 // WriteResponse to the client 70 func (o *ObjectsValidateUnauthorized) 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 // ObjectsValidateForbiddenCode is the HTTP code returned for type ObjectsValidateForbidden 78 const ObjectsValidateForbiddenCode int = 403 79 80 /* 81 ObjectsValidateForbidden Forbidden 82 83 swagger:response objectsValidateForbidden 84 */ 85 type ObjectsValidateForbidden struct { 86 87 /* 88 In: Body 89 */ 90 Payload *models.ErrorResponse `json:"body,omitempty"` 91 } 92 93 // NewObjectsValidateForbidden creates ObjectsValidateForbidden with default headers values 94 func NewObjectsValidateForbidden() *ObjectsValidateForbidden { 95 96 return &ObjectsValidateForbidden{} 97 } 98 99 // WithPayload adds the payload to the objects validate forbidden response 100 func (o *ObjectsValidateForbidden) WithPayload(payload *models.ErrorResponse) *ObjectsValidateForbidden { 101 o.Payload = payload 102 return o 103 } 104 105 // SetPayload sets the payload to the objects validate forbidden response 106 func (o *ObjectsValidateForbidden) SetPayload(payload *models.ErrorResponse) { 107 o.Payload = payload 108 } 109 110 // WriteResponse to the client 111 func (o *ObjectsValidateForbidden) 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 // ObjectsValidateUnprocessableEntityCode is the HTTP code returned for type ObjectsValidateUnprocessableEntity 123 const ObjectsValidateUnprocessableEntityCode int = 422 124 125 /* 126 ObjectsValidateUnprocessableEntity Request body is well-formed (i.e., syntactically correct), but semantically erroneous. Are you sure the class is defined in the configuration file? 127 128 swagger:response objectsValidateUnprocessableEntity 129 */ 130 type ObjectsValidateUnprocessableEntity struct { 131 132 /* 133 In: Body 134 */ 135 Payload *models.ErrorResponse `json:"body,omitempty"` 136 } 137 138 // NewObjectsValidateUnprocessableEntity creates ObjectsValidateUnprocessableEntity with default headers values 139 func NewObjectsValidateUnprocessableEntity() *ObjectsValidateUnprocessableEntity { 140 141 return &ObjectsValidateUnprocessableEntity{} 142 } 143 144 // WithPayload adds the payload to the objects validate unprocessable entity response 145 func (o *ObjectsValidateUnprocessableEntity) WithPayload(payload *models.ErrorResponse) *ObjectsValidateUnprocessableEntity { 146 o.Payload = payload 147 return o 148 } 149 150 // SetPayload sets the payload to the objects validate unprocessable entity response 151 func (o *ObjectsValidateUnprocessableEntity) SetPayload(payload *models.ErrorResponse) { 152 o.Payload = payload 153 } 154 155 // WriteResponse to the client 156 func (o *ObjectsValidateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 157 158 rw.WriteHeader(422) 159 if o.Payload != nil { 160 payload := o.Payload 161 if err := producer.Produce(rw, payload); err != nil { 162 panic(err) // let the recovery middleware deal with this 163 } 164 } 165 } 166 167 // ObjectsValidateInternalServerErrorCode is the HTTP code returned for type ObjectsValidateInternalServerError 168 const ObjectsValidateInternalServerErrorCode int = 500 169 170 /* 171 ObjectsValidateInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error. 172 173 swagger:response objectsValidateInternalServerError 174 */ 175 type ObjectsValidateInternalServerError struct { 176 177 /* 178 In: Body 179 */ 180 Payload *models.ErrorResponse `json:"body,omitempty"` 181 } 182 183 // NewObjectsValidateInternalServerError creates ObjectsValidateInternalServerError with default headers values 184 func NewObjectsValidateInternalServerError() *ObjectsValidateInternalServerError { 185 186 return &ObjectsValidateInternalServerError{} 187 } 188 189 // WithPayload adds the payload to the objects validate internal server error response 190 func (o *ObjectsValidateInternalServerError) WithPayload(payload *models.ErrorResponse) *ObjectsValidateInternalServerError { 191 o.Payload = payload 192 return o 193 } 194 195 // SetPayload sets the payload to the objects validate internal server error response 196 func (o *ObjectsValidateInternalServerError) SetPayload(payload *models.ErrorResponse) { 197 o.Payload = payload 198 } 199 200 // WriteResponse to the client 201 func (o *ObjectsValidateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 202 203 rw.WriteHeader(500) 204 if o.Payload != nil { 205 payload := o.Payload 206 if err := producer.Produce(rw, payload); err != nil { 207 panic(err) // let the recovery middleware deal with this 208 } 209 } 210 }