github.com/josephspurrier/go-swagger@v0.2.1-0.20221129144919-1f672a142a00/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("response status code does not match any response statuses defined for this endpoint in the swagger spec", 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 returns 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 returns 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 returns 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 returns 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 returns a 4xx status code 80 func (o *OrderDeleteNoContent) IsCode(code int) bool { 81 return code == 204 82 } 83 84 func (o *OrderDeleteNoContent) Error() string { 85 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNoContent ", 204) 86 } 87 88 func (o *OrderDeleteNoContent) String() string { 89 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNoContent ", 204) 90 } 91 92 func (o *OrderDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 93 94 return nil 95 } 96 97 // NewOrderDeleteBadRequest creates a OrderDeleteBadRequest with default headers values 98 func NewOrderDeleteBadRequest() *OrderDeleteBadRequest { 99 return &OrderDeleteBadRequest{} 100 } 101 102 /* 103 OrderDeleteBadRequest describes a response with status code 400, with default header values. 104 105 Invalid ID supplied 106 */ 107 type OrderDeleteBadRequest struct { 108 } 109 110 // IsSuccess returns true when this order delete bad request response returns a 2xx status code 111 func (o *OrderDeleteBadRequest) IsSuccess() bool { 112 return false 113 } 114 115 // IsRedirect returns true when this order delete bad request response returns a 3xx status code 116 func (o *OrderDeleteBadRequest) IsRedirect() bool { 117 return false 118 } 119 120 // IsClientError returns true when this order delete bad request response returns a 4xx status code 121 func (o *OrderDeleteBadRequest) IsClientError() bool { 122 return true 123 } 124 125 // IsServerError returns true when this order delete bad request response returns a 5xx status code 126 func (o *OrderDeleteBadRequest) IsServerError() bool { 127 return false 128 } 129 130 // IsCode returns true when this order delete bad request response returns a 4xx status code 131 func (o *OrderDeleteBadRequest) IsCode(code int) bool { 132 return code == 400 133 } 134 135 func (o *OrderDeleteBadRequest) Error() string { 136 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteBadRequest ", 400) 137 } 138 139 func (o *OrderDeleteBadRequest) String() string { 140 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteBadRequest ", 400) 141 } 142 143 func (o *OrderDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 144 145 return nil 146 } 147 148 // NewOrderDeleteNotFound creates a OrderDeleteNotFound with default headers values 149 func NewOrderDeleteNotFound() *OrderDeleteNotFound { 150 return &OrderDeleteNotFound{} 151 } 152 153 /* 154 OrderDeleteNotFound describes a response with status code 404, with default header values. 155 156 Order not found 157 */ 158 type OrderDeleteNotFound struct { 159 } 160 161 // IsSuccess returns true when this order delete not found response returns a 2xx status code 162 func (o *OrderDeleteNotFound) IsSuccess() bool { 163 return false 164 } 165 166 // IsRedirect returns true when this order delete not found response returns a 3xx status code 167 func (o *OrderDeleteNotFound) IsRedirect() bool { 168 return false 169 } 170 171 // IsClientError returns true when this order delete not found response returns a 4xx status code 172 func (o *OrderDeleteNotFound) IsClientError() bool { 173 return true 174 } 175 176 // IsServerError returns true when this order delete not found response returns a 5xx status code 177 func (o *OrderDeleteNotFound) IsServerError() bool { 178 return false 179 } 180 181 // IsCode returns true when this order delete not found response returns a 4xx status code 182 func (o *OrderDeleteNotFound) IsCode(code int) bool { 183 return code == 404 184 } 185 186 func (o *OrderDeleteNotFound) Error() string { 187 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNotFound ", 404) 188 } 189 190 func (o *OrderDeleteNotFound) String() string { 191 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNotFound ", 404) 192 } 193 194 func (o *OrderDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 195 196 return nil 197 }