github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/objects/objects_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 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 // ObjectsCreateOKCode is the HTTP code returned for type ObjectsCreateOK 28 const ObjectsCreateOKCode int = 200 29 30 /* 31 ObjectsCreateOK Object created. 32 33 swagger:response objectsCreateOK 34 */ 35 type ObjectsCreateOK struct { 36 37 /* 38 In: Body 39 */ 40 Payload *models.Object `json:"body,omitempty"` 41 } 42 43 // NewObjectsCreateOK creates ObjectsCreateOK with default headers values 44 func NewObjectsCreateOK() *ObjectsCreateOK { 45 46 return &ObjectsCreateOK{} 47 } 48 49 // WithPayload adds the payload to the objects create o k response 50 func (o *ObjectsCreateOK) WithPayload(payload *models.Object) *ObjectsCreateOK { 51 o.Payload = payload 52 return o 53 } 54 55 // SetPayload sets the payload to the objects create o k response 56 func (o *ObjectsCreateOK) SetPayload(payload *models.Object) { 57 o.Payload = payload 58 } 59 60 // WriteResponse to the client 61 func (o *ObjectsCreateOK) 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 // ObjectsCreateBadRequestCode is the HTTP code returned for type ObjectsCreateBadRequest 73 const ObjectsCreateBadRequestCode int = 400 74 75 /* 76 ObjectsCreateBadRequest Malformed request. 77 78 swagger:response objectsCreateBadRequest 79 */ 80 type ObjectsCreateBadRequest struct { 81 82 /* 83 In: Body 84 */ 85 Payload *models.ErrorResponse `json:"body,omitempty"` 86 } 87 88 // NewObjectsCreateBadRequest creates ObjectsCreateBadRequest with default headers values 89 func NewObjectsCreateBadRequest() *ObjectsCreateBadRequest { 90 91 return &ObjectsCreateBadRequest{} 92 } 93 94 // WithPayload adds the payload to the objects create bad request response 95 func (o *ObjectsCreateBadRequest) WithPayload(payload *models.ErrorResponse) *ObjectsCreateBadRequest { 96 o.Payload = payload 97 return o 98 } 99 100 // SetPayload sets the payload to the objects create bad request response 101 func (o *ObjectsCreateBadRequest) SetPayload(payload *models.ErrorResponse) { 102 o.Payload = payload 103 } 104 105 // WriteResponse to the client 106 func (o *ObjectsCreateBadRequest) 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 // ObjectsCreateUnauthorizedCode is the HTTP code returned for type ObjectsCreateUnauthorized 118 const ObjectsCreateUnauthorizedCode int = 401 119 120 /* 121 ObjectsCreateUnauthorized Unauthorized or invalid credentials. 122 123 swagger:response objectsCreateUnauthorized 124 */ 125 type ObjectsCreateUnauthorized struct { 126 } 127 128 // NewObjectsCreateUnauthorized creates ObjectsCreateUnauthorized with default headers values 129 func NewObjectsCreateUnauthorized() *ObjectsCreateUnauthorized { 130 131 return &ObjectsCreateUnauthorized{} 132 } 133 134 // WriteResponse to the client 135 func (o *ObjectsCreateUnauthorized) 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 // ObjectsCreateForbiddenCode is the HTTP code returned for type ObjectsCreateForbidden 143 const ObjectsCreateForbiddenCode int = 403 144 145 /* 146 ObjectsCreateForbidden Forbidden 147 148 swagger:response objectsCreateForbidden 149 */ 150 type ObjectsCreateForbidden struct { 151 152 /* 153 In: Body 154 */ 155 Payload *models.ErrorResponse `json:"body,omitempty"` 156 } 157 158 // NewObjectsCreateForbidden creates ObjectsCreateForbidden with default headers values 159 func NewObjectsCreateForbidden() *ObjectsCreateForbidden { 160 161 return &ObjectsCreateForbidden{} 162 } 163 164 // WithPayload adds the payload to the objects create forbidden response 165 func (o *ObjectsCreateForbidden) WithPayload(payload *models.ErrorResponse) *ObjectsCreateForbidden { 166 o.Payload = payload 167 return o 168 } 169 170 // SetPayload sets the payload to the objects create forbidden response 171 func (o *ObjectsCreateForbidden) SetPayload(payload *models.ErrorResponse) { 172 o.Payload = payload 173 } 174 175 // WriteResponse to the client 176 func (o *ObjectsCreateForbidden) 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 // ObjectsCreateUnprocessableEntityCode is the HTTP code returned for type ObjectsCreateUnprocessableEntity 188 const ObjectsCreateUnprocessableEntityCode int = 422 189 190 /* 191 ObjectsCreateUnprocessableEntity Request body is well-formed (i.e., syntactically correct), but semantically erroneous. Are you sure the class is defined in the configuration file? 192 193 swagger:response objectsCreateUnprocessableEntity 194 */ 195 type ObjectsCreateUnprocessableEntity struct { 196 197 /* 198 In: Body 199 */ 200 Payload *models.ErrorResponse `json:"body,omitempty"` 201 } 202 203 // NewObjectsCreateUnprocessableEntity creates ObjectsCreateUnprocessableEntity with default headers values 204 func NewObjectsCreateUnprocessableEntity() *ObjectsCreateUnprocessableEntity { 205 206 return &ObjectsCreateUnprocessableEntity{} 207 } 208 209 // WithPayload adds the payload to the objects create unprocessable entity response 210 func (o *ObjectsCreateUnprocessableEntity) WithPayload(payload *models.ErrorResponse) *ObjectsCreateUnprocessableEntity { 211 o.Payload = payload 212 return o 213 } 214 215 // SetPayload sets the payload to the objects create unprocessable entity response 216 func (o *ObjectsCreateUnprocessableEntity) SetPayload(payload *models.ErrorResponse) { 217 o.Payload = payload 218 } 219 220 // WriteResponse to the client 221 func (o *ObjectsCreateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 222 223 rw.WriteHeader(422) 224 if o.Payload != nil { 225 payload := o.Payload 226 if err := producer.Produce(rw, payload); err != nil { 227 panic(err) // let the recovery middleware deal with this 228 } 229 } 230 } 231 232 // ObjectsCreateInternalServerErrorCode is the HTTP code returned for type ObjectsCreateInternalServerError 233 const ObjectsCreateInternalServerErrorCode int = 500 234 235 /* 236 ObjectsCreateInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error. 237 238 swagger:response objectsCreateInternalServerError 239 */ 240 type ObjectsCreateInternalServerError struct { 241 242 /* 243 In: Body 244 */ 245 Payload *models.ErrorResponse `json:"body,omitempty"` 246 } 247 248 // NewObjectsCreateInternalServerError creates ObjectsCreateInternalServerError with default headers values 249 func NewObjectsCreateInternalServerError() *ObjectsCreateInternalServerError { 250 251 return &ObjectsCreateInternalServerError{} 252 } 253 254 // WithPayload adds the payload to the objects create internal server error response 255 func (o *ObjectsCreateInternalServerError) WithPayload(payload *models.ErrorResponse) *ObjectsCreateInternalServerError { 256 o.Payload = payload 257 return o 258 } 259 260 // SetPayload sets the payload to the objects create internal server error response 261 func (o *ObjectsCreateInternalServerError) SetPayload(payload *models.ErrorResponse) { 262 o.Payload = payload 263 } 264 265 // WriteResponse to the client 266 func (o *ObjectsCreateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 267 268 rw.WriteHeader(500) 269 if o.Payload != nil { 270 payload := o.Payload 271 if err := producer.Produce(rw, payload); err != nil { 272 panic(err) // let the recovery middleware deal with this 273 } 274 } 275 }