github.com/sap/cf-mta-plugin@v2.6.3+incompatible/clients/mtaclient/operations/get_mta_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package operations 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 14 strfmt "github.com/go-openapi/strfmt" 15 16 baseclient "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/baseclient" 17 "github.com/cloudfoundry-incubator/multiapps-cli-plugin/clients/models" 18 ) 19 20 // GetMtaReader is a Reader for the GetMta structure. 21 type GetMtaReader struct { 22 formats strfmt.Registry 23 } 24 25 // ReadResponse reads a server response into the received o. 26 func (o *GetMtaReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 27 switch response.Code() { 28 29 case 200: 30 result := NewGetMtaOK() 31 if err := result.readResponse(response, consumer, o.formats); err != nil { 32 return nil, err 33 } 34 return result, nil 35 36 default: 37 return nil, baseclient.BuildErrorResponse(response, consumer, o.formats) 38 } 39 } 40 41 // NewGetMtaOK creates a GetMtaOK with default headers values 42 func NewGetMtaOK() *GetMtaOK { 43 return &GetMtaOK{} 44 } 45 46 /*GetMtaOK handles this case with default header values. 47 48 OK 49 */ 50 type GetMtaOK struct { 51 Payload *models.Mta 52 } 53 54 func (o *GetMtaOK) Error() string { 55 return fmt.Sprintf("[GET /mtas/{mta_id}][%d] getMtaOK %+v", 200, o.Payload) 56 } 57 58 func (o *GetMtaOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 59 60 o.Payload = new(models.Mta) 61 62 // response payload 63 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 64 return err 65 } 66 67 return nil 68 }