github.com/weaviate/weaviate@v1.24.6/adapters/handlers/rest/operations/schema/schema_dump_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 schema 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 // SchemaDumpOKCode is the HTTP code returned for type SchemaDumpOK 28 const SchemaDumpOKCode int = 200 29 30 /* 31 SchemaDumpOK Successfully dumped the database schema. 32 33 swagger:response schemaDumpOK 34 */ 35 type SchemaDumpOK struct { 36 37 /* 38 In: Body 39 */ 40 Payload *models.Schema `json:"body,omitempty"` 41 } 42 43 // NewSchemaDumpOK creates SchemaDumpOK with default headers values 44 func NewSchemaDumpOK() *SchemaDumpOK { 45 46 return &SchemaDumpOK{} 47 } 48 49 // WithPayload adds the payload to the schema dump o k response 50 func (o *SchemaDumpOK) WithPayload(payload *models.Schema) *SchemaDumpOK { 51 o.Payload = payload 52 return o 53 } 54 55 // SetPayload sets the payload to the schema dump o k response 56 func (o *SchemaDumpOK) SetPayload(payload *models.Schema) { 57 o.Payload = payload 58 } 59 60 // WriteResponse to the client 61 func (o *SchemaDumpOK) 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 // SchemaDumpUnauthorizedCode is the HTTP code returned for type SchemaDumpUnauthorized 73 const SchemaDumpUnauthorizedCode int = 401 74 75 /* 76 SchemaDumpUnauthorized Unauthorized or invalid credentials. 77 78 swagger:response schemaDumpUnauthorized 79 */ 80 type SchemaDumpUnauthorized struct { 81 } 82 83 // NewSchemaDumpUnauthorized creates SchemaDumpUnauthorized with default headers values 84 func NewSchemaDumpUnauthorized() *SchemaDumpUnauthorized { 85 86 return &SchemaDumpUnauthorized{} 87 } 88 89 // WriteResponse to the client 90 func (o *SchemaDumpUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 91 92 rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses 93 94 rw.WriteHeader(401) 95 } 96 97 // SchemaDumpForbiddenCode is the HTTP code returned for type SchemaDumpForbidden 98 const SchemaDumpForbiddenCode int = 403 99 100 /* 101 SchemaDumpForbidden Forbidden 102 103 swagger:response schemaDumpForbidden 104 */ 105 type SchemaDumpForbidden struct { 106 107 /* 108 In: Body 109 */ 110 Payload *models.ErrorResponse `json:"body,omitempty"` 111 } 112 113 // NewSchemaDumpForbidden creates SchemaDumpForbidden with default headers values 114 func NewSchemaDumpForbidden() *SchemaDumpForbidden { 115 116 return &SchemaDumpForbidden{} 117 } 118 119 // WithPayload adds the payload to the schema dump forbidden response 120 func (o *SchemaDumpForbidden) WithPayload(payload *models.ErrorResponse) *SchemaDumpForbidden { 121 o.Payload = payload 122 return o 123 } 124 125 // SetPayload sets the payload to the schema dump forbidden response 126 func (o *SchemaDumpForbidden) SetPayload(payload *models.ErrorResponse) { 127 o.Payload = payload 128 } 129 130 // WriteResponse to the client 131 func (o *SchemaDumpForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 132 133 rw.WriteHeader(403) 134 if o.Payload != nil { 135 payload := o.Payload 136 if err := producer.Produce(rw, payload); err != nil { 137 panic(err) // let the recovery middleware deal with this 138 } 139 } 140 } 141 142 // SchemaDumpInternalServerErrorCode is the HTTP code returned for type SchemaDumpInternalServerError 143 const SchemaDumpInternalServerErrorCode int = 500 144 145 /* 146 SchemaDumpInternalServerError An error has occurred while trying to fulfill the request. Most likely the ErrorResponse will contain more information about the error. 147 148 swagger:response schemaDumpInternalServerError 149 */ 150 type SchemaDumpInternalServerError struct { 151 152 /* 153 In: Body 154 */ 155 Payload *models.ErrorResponse `json:"body,omitempty"` 156 } 157 158 // NewSchemaDumpInternalServerError creates SchemaDumpInternalServerError with default headers values 159 func NewSchemaDumpInternalServerError() *SchemaDumpInternalServerError { 160 161 return &SchemaDumpInternalServerError{} 162 } 163 164 // WithPayload adds the payload to the schema dump internal server error response 165 func (o *SchemaDumpInternalServerError) WithPayload(payload *models.ErrorResponse) *SchemaDumpInternalServerError { 166 o.Payload = payload 167 return o 168 } 169 170 // SetPayload sets the payload to the schema dump internal server error response 171 func (o *SchemaDumpInternalServerError) SetPayload(payload *models.ErrorResponse) { 172 o.Payload = payload 173 } 174 175 // WriteResponse to the client 176 func (o *SchemaDumpInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 177 178 rw.WriteHeader(500) 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 }