github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/classifications/classifications_post_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 classifications 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 // ClassificationsPostCreatedCode is the HTTP code returned for type ClassificationsPostCreated 28 const ClassificationsPostCreatedCode int = 201 29 30 /* 31 ClassificationsPostCreated Successfully started classification. 32 33 swagger:response classificationsPostCreated 34 */ 35 type ClassificationsPostCreated struct { 36 37 /* 38 In: Body 39 */ 40 Payload *models.Classification `json:"body,omitempty"` 41 } 42 43 // NewClassificationsPostCreated creates ClassificationsPostCreated with default headers values 44 func NewClassificationsPostCreated() *ClassificationsPostCreated { 45 46 return &ClassificationsPostCreated{} 47 } 48 49 // WithPayload adds the payload to the classifications post created response 50 func (o *ClassificationsPostCreated) WithPayload(payload *models.Classification) *ClassificationsPostCreated { 51 o.Payload = payload 52 return o 53 } 54 55 // SetPayload sets the payload to the classifications post created response 56 func (o *ClassificationsPostCreated) SetPayload(payload *models.Classification) { 57 o.Payload = payload 58 } 59 60 // WriteResponse to the client 61 func (o *ClassificationsPostCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 62 63 rw.WriteHeader(201) 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 // ClassificationsPostBadRequestCode is the HTTP code returned for type ClassificationsPostBadRequest 73 const ClassificationsPostBadRequestCode int = 400 74 75 /* 76 ClassificationsPostBadRequest Incorrect request 77 78 swagger:response classificationsPostBadRequest 79 */ 80 type ClassificationsPostBadRequest struct { 81 82 /* 83 In: Body 84 */ 85 Payload *models.ErrorResponse `json:"body,omitempty"` 86 } 87 88 // NewClassificationsPostBadRequest creates ClassificationsPostBadRequest with default headers values 89 func NewClassificationsPostBadRequest() *ClassificationsPostBadRequest { 90 91 return &ClassificationsPostBadRequest{} 92 } 93 94 // WithPayload adds the payload to the classifications post bad request response 95 func (o *ClassificationsPostBadRequest) WithPayload(payload *models.ErrorResponse) *ClassificationsPostBadRequest { 96 o.Payload = payload 97 return o 98 } 99 100 // SetPayload sets the payload to the classifications post bad request response 101 func (o *ClassificationsPostBadRequest) SetPayload(payload *models.ErrorResponse) { 102 o.Payload = payload 103 } 104 105 // WriteResponse to the client 106 func (o *ClassificationsPostBadRequest) 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 // ClassificationsPostUnauthorizedCode is the HTTP code returned for type ClassificationsPostUnauthorized 118 const ClassificationsPostUnauthorizedCode int = 401 119 120 /* 121 ClassificationsPostUnauthorized Unauthorized or invalid credentials. 122 123 swagger:response classificationsPostUnauthorized 124 */ 125 type ClassificationsPostUnauthorized struct { 126 } 127 128 // NewClassificationsPostUnauthorized creates ClassificationsPostUnauthorized with default headers values 129 func NewClassificationsPostUnauthorized() *ClassificationsPostUnauthorized { 130 131 return &ClassificationsPostUnauthorized{} 132 } 133 134 // WriteResponse to the client 135 func (o *ClassificationsPostUnauthorized) 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 // ClassificationsPostForbiddenCode is the HTTP code returned for type ClassificationsPostForbidden 143 const ClassificationsPostForbiddenCode int = 403 144 145 /* 146 ClassificationsPostForbidden Forbidden 147 148 swagger:response classificationsPostForbidden 149 */ 150 type ClassificationsPostForbidden struct { 151 152 /* 153 In: Body 154 */ 155 Payload *models.ErrorResponse `json:"body,omitempty"` 156 } 157 158 // NewClassificationsPostForbidden creates ClassificationsPostForbidden with default headers values 159 func NewClassificationsPostForbidden() *ClassificationsPostForbidden { 160 161 return &ClassificationsPostForbidden{} 162 } 163 164 // WithPayload adds the payload to the classifications post forbidden response 165 func (o *ClassificationsPostForbidden) WithPayload(payload *models.ErrorResponse) *ClassificationsPostForbidden { 166 o.Payload = payload 167 return o 168 } 169 170 // SetPayload sets the payload to the classifications post forbidden response 171 func (o *ClassificationsPostForbidden) SetPayload(payload *models.ErrorResponse) { 172 o.Payload = payload 173 } 174 175 // WriteResponse to the client 176 func (o *ClassificationsPostForbidden) 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 // ClassificationsPostInternalServerErrorCode is the HTTP code returned for type ClassificationsPostInternalServerError 188 const ClassificationsPostInternalServerErrorCode int = 500 189 190 /* 191 ClassificationsPostInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error. 192 193 swagger:response classificationsPostInternalServerError 194 */ 195 type ClassificationsPostInternalServerError struct { 196 197 /* 198 In: Body 199 */ 200 Payload *models.ErrorResponse `json:"body,omitempty"` 201 } 202 203 // NewClassificationsPostInternalServerError creates ClassificationsPostInternalServerError with default headers values 204 func NewClassificationsPostInternalServerError() *ClassificationsPostInternalServerError { 205 206 return &ClassificationsPostInternalServerError{} 207 } 208 209 // WithPayload adds the payload to the classifications post internal server error response 210 func (o *ClassificationsPostInternalServerError) WithPayload(payload *models.ErrorResponse) *ClassificationsPostInternalServerError { 211 o.Payload = payload 212 return o 213 } 214 215 // SetPayload sets the payload to the classifications post internal server error response 216 func (o *ClassificationsPostInternalServerError) SetPayload(payload *models.ErrorResponse) { 217 o.Payload = payload 218 } 219 220 // WriteResponse to the client 221 func (o *ClassificationsPostInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 222 223 rw.WriteHeader(500) 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 }