github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/retention/get_rentenition_metadata_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package retention 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/goharbor/go-client/pkg/sdk/v2.0/models" 16 ) 17 18 // GetRentenitionMetadataReader is a Reader for the GetRentenitionMetadata structure. 19 type GetRentenitionMetadataReader struct { 20 formats strfmt.Registry 21 } 22 23 // ReadResponse reads a server response into the received o. 24 func (o *GetRentenitionMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 switch response.Code() { 26 case 200: 27 result := NewGetRentenitionMetadataOK() 28 if err := result.readResponse(response, consumer, o.formats); err != nil { 29 return nil, err 30 } 31 return result, nil 32 default: 33 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 34 } 35 } 36 37 // NewGetRentenitionMetadataOK creates a GetRentenitionMetadataOK with default headers values 38 func NewGetRentenitionMetadataOK() *GetRentenitionMetadataOK { 39 return &GetRentenitionMetadataOK{} 40 } 41 42 /* 43 GetRentenitionMetadataOK describes a response with status code 200, with default header values. 44 45 Get Retention Metadatas successfully. 46 */ 47 type GetRentenitionMetadataOK struct { 48 Payload *models.RetentionMetadata 49 } 50 51 // IsSuccess returns true when this get rentenition metadata o k response has a 2xx status code 52 func (o *GetRentenitionMetadataOK) IsSuccess() bool { 53 return true 54 } 55 56 // IsRedirect returns true when this get rentenition metadata o k response has a 3xx status code 57 func (o *GetRentenitionMetadataOK) IsRedirect() bool { 58 return false 59 } 60 61 // IsClientError returns true when this get rentenition metadata o k response has a 4xx status code 62 func (o *GetRentenitionMetadataOK) IsClientError() bool { 63 return false 64 } 65 66 // IsServerError returns true when this get rentenition metadata o k response has a 5xx status code 67 func (o *GetRentenitionMetadataOK) IsServerError() bool { 68 return false 69 } 70 71 // IsCode returns true when this get rentenition metadata o k response a status code equal to that given 72 func (o *GetRentenitionMetadataOK) IsCode(code int) bool { 73 return code == 200 74 } 75 76 func (o *GetRentenitionMetadataOK) Error() string { 77 return fmt.Sprintf("[GET /retentions/metadatas][%d] getRentenitionMetadataOK %+v", 200, o.Payload) 78 } 79 80 func (o *GetRentenitionMetadataOK) String() string { 81 return fmt.Sprintf("[GET /retentions/metadatas][%d] getRentenitionMetadataOK %+v", 200, o.Payload) 82 } 83 84 func (o *GetRentenitionMetadataOK) GetPayload() *models.RetentionMetadata { 85 return o.Payload 86 } 87 88 func (o *GetRentenitionMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 89 90 o.Payload = new(models.RetentionMetadata) 91 92 // response payload 93 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 94 return err 95 } 96 97 return nil 98 }