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