github.com/circl-dev/go-swagger@v0.31.0/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/strfmt" 12 "github.com/circl-dev/runtime" 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 /* OrderDeleteNoContent describes a response with status code 204, with default header values. 52 53 Deleted successfully 54 */ 55 type OrderDeleteNoContent struct { 56 } 57 58 func (o *OrderDeleteNoContent) Error() string { 59 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNoContent ", 204) 60 } 61 62 func (o *OrderDeleteNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 63 64 return nil 65 } 66 67 // NewOrderDeleteBadRequest creates a OrderDeleteBadRequest with default headers values 68 func NewOrderDeleteBadRequest() *OrderDeleteBadRequest { 69 return &OrderDeleteBadRequest{} 70 } 71 72 /* OrderDeleteBadRequest describes a response with status code 400, with default header values. 73 74 Invalid ID supplied 75 */ 76 type OrderDeleteBadRequest struct { 77 } 78 79 func (o *OrderDeleteBadRequest) Error() string { 80 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteBadRequest ", 400) 81 } 82 83 func (o *OrderDeleteBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 84 85 return nil 86 } 87 88 // NewOrderDeleteNotFound creates a OrderDeleteNotFound with default headers values 89 func NewOrderDeleteNotFound() *OrderDeleteNotFound { 90 return &OrderDeleteNotFound{} 91 } 92 93 /* OrderDeleteNotFound describes a response with status code 404, with default header values. 94 95 Order not found 96 */ 97 type OrderDeleteNotFound struct { 98 } 99 100 func (o *OrderDeleteNotFound) Error() string { 101 return fmt.Sprintf("[DELETE /store/order/{orderId}][%d] orderDeleteNotFound ", 404) 102 } 103 104 func (o *OrderDeleteNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 105 106 return nil 107 }