github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/examples/contributed-templates/stratoscale/client/store/order_delete_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package store 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "fmt" 10 11 "github.com/go-openapi/runtime" 12 "github.com/go-openapi/strfmt" 13 ) 14 15 // OrderDeleteReader is a Reader for the OrderDelete structure. 16 type OrderDeleteReader struct { 17 formats strfmt.Registry 18 } 19 20 // ReadResponse reads a server response into the received o. 21 func (o *OrderDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 22 switch response.Code() { 23 case 204: 24 result := NewOrderDeleteNoContent() 25 if err := result.readResponse(response, consumer, o.formats); err != nil { 26 return nil, err 27 } 28 return result, nil 29 case 400: 30 result := NewOrderDeleteBadRequest() 31 if err := result.readResponse(response, consumer, o.formats); err != nil { 32 return nil, err 33 } 34 return nil, result 35 case 404: 36 result := NewOrderDeleteNotFound() 37 if err := result.readResponse(response, consumer, o.formats); err != nil { 38 return nil, err 39 } 40 return nil, result 41 default: 42 return nil, runtime.NewAPIError("[DELETE /store/order/{orderId}] OrderDelete", response, response.Code()) 43 } 44 } 45 46 // NewOrderDeleteNoContent creates a OrderDeleteNoContent with default headers values 47 func NewOrderDeleteNoContent() *OrderDeleteNoContent { 48 return &OrderDeleteNoContent{} 49 } 50 51 /* 52 OrderDeleteNoContent describes a response with status code 204, with default header values. 53 54 Deleted successfully 55 */ 56 type OrderDeleteNoContent struct { 57 } 58 59 // IsSuccess returns true when this order delete no content response has a 2xx status code 60 func (o *OrderDeleteNoContent) IsSuccess() bool { 61 return true 62 } 63 64 // IsRedirect returns true when this order delete no content response has a 3xx status code 65 func (o *OrderDeleteNoContent) IsRedirect() bool { 66 return false 67 } 68 69 // IsClientError returns true when this order delete no content response has a 4xx status code 70 func (o *OrderDeleteNoContent) IsClientError() bool { 71 return false 72 } 73 74 // IsServerError returns true when this order delete no content response has a 5xx status code 75 func (o *OrderDeleteNoContent) IsServerError() bool { 76 return false 77 } 78 79 // IsCode returns true when this order delete no content response a status code equal to that given 80 func (o *OrderDeleteNoContent) IsCode(code int) bool { 81 return code == 204 82 } 83 84 // Code gets the status code for the order delete no content response 85 func (o *OrderDeleteNoContent) Code() int { 86 return 204 87 } 88 89 func (o *OrderDeleteNoContent) Error() string { 90 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNoContent", 204) 91 } 92 93 func (o *OrderDeleteNoContent) String() string { 94 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNoContent", 204) 95 } 96 97 func (o *OrderDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 98 99 return nil 100 } 101 102 // NewOrderDeleteBadRequest creates a OrderDeleteBadRequest with default headers values 103 func NewOrderDeleteBadRequest() *OrderDeleteBadRequest { 104 return &OrderDeleteBadRequest{} 105 } 106 107 /* 108 OrderDeleteBadRequest describes a response with status code 400, with default header values. 109 110 Invalid ID supplied 111 */ 112 type OrderDeleteBadRequest struct { 113 } 114 115 // IsSuccess returns true when this order delete bad request response has a 2xx status code 116 func (o *OrderDeleteBadRequest) IsSuccess() bool { 117 return false 118 } 119 120 // IsRedirect returns true when this order delete bad request response has a 3xx status code 121 func (o *OrderDeleteBadRequest) IsRedirect() bool { 122 return false 123 } 124 125 // IsClientError returns true when this order delete bad request response has a 4xx status code 126 func (o *OrderDeleteBadRequest) IsClientError() bool { 127 return true 128 } 129 130 // IsServerError returns true when this order delete bad request response has a 5xx status code 131 func (o *OrderDeleteBadRequest) IsServerError() bool { 132 return false 133 } 134 135 // IsCode returns true when this order delete bad request response a status code equal to that given 136 func (o *OrderDeleteBadRequest) IsCode(code int) bool { 137 return code == 400 138 } 139 140 // Code gets the status code for the order delete bad request response 141 func (o *OrderDeleteBadRequest) Code() int { 142 return 400 143 } 144 145 func (o *OrderDeleteBadRequest) Error() string { 146 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteBadRequest", 400) 147 } 148 149 func (o *OrderDeleteBadRequest) String() string { 150 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteBadRequest", 400) 151 } 152 153 func (o *OrderDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 154 155 return nil 156 } 157 158 // NewOrderDeleteNotFound creates a OrderDeleteNotFound with default headers values 159 func NewOrderDeleteNotFound() *OrderDeleteNotFound { 160 return &OrderDeleteNotFound{} 161 } 162 163 /* 164 OrderDeleteNotFound describes a response with status code 404, with default header values. 165 166 Order not found 167 */ 168 type OrderDeleteNotFound struct { 169 } 170 171 // IsSuccess returns true when this order delete not found response has a 2xx status code 172 func (o *OrderDeleteNotFound) IsSuccess() bool { 173 return false 174 } 175 176 // IsRedirect returns true when this order delete not found response has a 3xx status code 177 func (o *OrderDeleteNotFound) IsRedirect() bool { 178 return false 179 } 180 181 // IsClientError returns true when this order delete not found response has a 4xx status code 182 func (o *OrderDeleteNotFound) IsClientError() bool { 183 return true 184 } 185 186 // IsServerError returns true when this order delete not found response has a 5xx status code 187 func (o *OrderDeleteNotFound) IsServerError() bool { 188 return false 189 } 190 191 // IsCode returns true when this order delete not found response a status code equal to that given 192 func (o *OrderDeleteNotFound) IsCode(code int) bool { 193 return code == 404 194 } 195 196 // Code gets the status code for the order delete not found response 197 func (o *OrderDeleteNotFound) Code() int { 198 return 404 199 } 200 201 func (o *OrderDeleteNotFound) Error() string { 202 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNotFound", 404) 203 } 204 205 func (o *OrderDeleteNotFound) String() string { 206 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNotFound", 404) 207 } 208 209 func (o *OrderDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 210 211 return nil 212 }