github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/invoices/create_invoice_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package invoices 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 "io" 11 12 "github.com/go-openapi/runtime" 13 "github.com/go-openapi/strfmt" 14 15 "github.com/ActiveState/cli/pkg/platform/api/mono/mono_models" 16 ) 17 18 // CreateInvoiceReader is a Reader for the CreateInvoice structure. 19 type CreateInvoiceReader struct { 20 formats strfmt.Registry 21 } 22 23 // ReadResponse reads a server response into the received o. 24 func (o *CreateInvoiceReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 switch response.Code() { 26 case 200: 27 result := NewCreateInvoiceOK() 28 if err := result.readResponse(response, consumer, o.formats); err != nil { 29 return nil, err 30 } 31 return result, nil 32 case 400: 33 result := NewCreateInvoiceBadRequest() 34 if err := result.readResponse(response, consumer, o.formats); err != nil { 35 return nil, err 36 } 37 return nil, result 38 case 403: 39 result := NewCreateInvoiceForbidden() 40 if err := result.readResponse(response, consumer, o.formats); err != nil { 41 return nil, err 42 } 43 return nil, result 44 case 404: 45 result := NewCreateInvoiceNotFound() 46 if err := result.readResponse(response, consumer, o.formats); err != nil { 47 return nil, err 48 } 49 return nil, result 50 case 500: 51 result := NewCreateInvoiceInternalServerError() 52 if err := result.readResponse(response, consumer, o.formats); err != nil { 53 return nil, err 54 } 55 return nil, result 56 default: 57 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 58 } 59 } 60 61 // NewCreateInvoiceOK creates a CreateInvoiceOK with default headers values 62 func NewCreateInvoiceOK() *CreateInvoiceOK { 63 return &CreateInvoiceOK{} 64 } 65 66 /* CreateInvoiceOK describes a response with status code 200, with default header values. 67 68 Success 69 */ 70 type CreateInvoiceOK struct { 71 Payload string 72 } 73 74 func (o *CreateInvoiceOK) Error() string { 75 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/invoices][%d] createInvoiceOK %+v", 200, o.Payload) 76 } 77 func (o *CreateInvoiceOK) GetPayload() string { 78 return o.Payload 79 } 80 81 func (o *CreateInvoiceOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 82 83 // response payload 84 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 85 return err 86 } 87 88 return nil 89 } 90 91 // NewCreateInvoiceBadRequest creates a CreateInvoiceBadRequest with default headers values 92 func NewCreateInvoiceBadRequest() *CreateInvoiceBadRequest { 93 return &CreateInvoiceBadRequest{} 94 } 95 96 /* CreateInvoiceBadRequest describes a response with status code 400, with default header values. 97 98 Bad Request 99 */ 100 type CreateInvoiceBadRequest struct { 101 Payload *mono_models.Message 102 } 103 104 func (o *CreateInvoiceBadRequest) Error() string { 105 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/invoices][%d] createInvoiceBadRequest %+v", 400, o.Payload) 106 } 107 func (o *CreateInvoiceBadRequest) GetPayload() *mono_models.Message { 108 return o.Payload 109 } 110 111 func (o *CreateInvoiceBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 112 113 o.Payload = new(mono_models.Message) 114 115 // response payload 116 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 117 return err 118 } 119 120 return nil 121 } 122 123 // NewCreateInvoiceForbidden creates a CreateInvoiceForbidden with default headers values 124 func NewCreateInvoiceForbidden() *CreateInvoiceForbidden { 125 return &CreateInvoiceForbidden{} 126 } 127 128 /* CreateInvoiceForbidden describes a response with status code 403, with default header values. 129 130 Forbidden 131 */ 132 type CreateInvoiceForbidden struct { 133 Payload *mono_models.Message 134 } 135 136 func (o *CreateInvoiceForbidden) Error() string { 137 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/invoices][%d] createInvoiceForbidden %+v", 403, o.Payload) 138 } 139 func (o *CreateInvoiceForbidden) GetPayload() *mono_models.Message { 140 return o.Payload 141 } 142 143 func (o *CreateInvoiceForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 144 145 o.Payload = new(mono_models.Message) 146 147 // response payload 148 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 149 return err 150 } 151 152 return nil 153 } 154 155 // NewCreateInvoiceNotFound creates a CreateInvoiceNotFound with default headers values 156 func NewCreateInvoiceNotFound() *CreateInvoiceNotFound { 157 return &CreateInvoiceNotFound{} 158 } 159 160 /* CreateInvoiceNotFound describes a response with status code 404, with default header values. 161 162 Not Found 163 */ 164 type CreateInvoiceNotFound struct { 165 Payload *mono_models.Message 166 } 167 168 func (o *CreateInvoiceNotFound) Error() string { 169 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/invoices][%d] createInvoiceNotFound %+v", 404, o.Payload) 170 } 171 func (o *CreateInvoiceNotFound) GetPayload() *mono_models.Message { 172 return o.Payload 173 } 174 175 func (o *CreateInvoiceNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 176 177 o.Payload = new(mono_models.Message) 178 179 // response payload 180 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 181 return err 182 } 183 184 return nil 185 } 186 187 // NewCreateInvoiceInternalServerError creates a CreateInvoiceInternalServerError with default headers values 188 func NewCreateInvoiceInternalServerError() *CreateInvoiceInternalServerError { 189 return &CreateInvoiceInternalServerError{} 190 } 191 192 /* CreateInvoiceInternalServerError describes a response with status code 500, with default header values. 193 194 Server Error 195 */ 196 type CreateInvoiceInternalServerError struct { 197 Payload *mono_models.Message 198 } 199 200 func (o *CreateInvoiceInternalServerError) Error() string { 201 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/invoices][%d] createInvoiceInternalServerError %+v", 500, o.Payload) 202 } 203 func (o *CreateInvoiceInternalServerError) GetPayload() *mono_models.Message { 204 return o.Payload 205 } 206 207 func (o *CreateInvoiceInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 208 209 o.Payload = new(mono_models.Message) 210 211 // response payload 212 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 213 return err 214 } 215 216 return nil 217 }