github.com/cilium/cilium@v1.16.2/api/v1/client/daemon/get_cgroup_dump_metadata_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 // Copyright Authors of Cilium 4 // SPDX-License-Identifier: Apache-2.0 5 6 package daemon 7 8 // This file was generated by the swagger tool. 9 // Editing this file might prove futile when you re-run the swagger generate command 10 11 import ( 12 "fmt" 13 "io" 14 15 "github.com/go-openapi/runtime" 16 "github.com/go-openapi/strfmt" 17 18 "github.com/cilium/cilium/api/v1/models" 19 ) 20 21 // GetCgroupDumpMetadataReader is a Reader for the GetCgroupDumpMetadata structure. 22 type GetCgroupDumpMetadataReader struct { 23 formats strfmt.Registry 24 } 25 26 // ReadResponse reads a server response into the received o. 27 func (o *GetCgroupDumpMetadataReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 28 switch response.Code() { 29 case 200: 30 result := NewGetCgroupDumpMetadataOK() 31 if err := result.readResponse(response, consumer, o.formats); err != nil { 32 return nil, err 33 } 34 return result, nil 35 case 500: 36 result := NewGetCgroupDumpMetadataFailure() 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("[GET /cgroup-dump-metadata] GetCgroupDumpMetadata", response, response.Code()) 43 } 44 } 45 46 // NewGetCgroupDumpMetadataOK creates a GetCgroupDumpMetadataOK with default headers values 47 func NewGetCgroupDumpMetadataOK() *GetCgroupDumpMetadataOK { 48 return &GetCgroupDumpMetadataOK{} 49 } 50 51 /* 52 GetCgroupDumpMetadataOK describes a response with status code 200, with default header values. 53 54 Success 55 */ 56 type GetCgroupDumpMetadataOK struct { 57 Payload *models.CgroupDumpMetadata 58 } 59 60 // IsSuccess returns true when this get cgroup dump metadata o k response has a 2xx status code 61 func (o *GetCgroupDumpMetadataOK) IsSuccess() bool { 62 return true 63 } 64 65 // IsRedirect returns true when this get cgroup dump metadata o k response has a 3xx status code 66 func (o *GetCgroupDumpMetadataOK) IsRedirect() bool { 67 return false 68 } 69 70 // IsClientError returns true when this get cgroup dump metadata o k response has a 4xx status code 71 func (o *GetCgroupDumpMetadataOK) IsClientError() bool { 72 return false 73 } 74 75 // IsServerError returns true when this get cgroup dump metadata o k response has a 5xx status code 76 func (o *GetCgroupDumpMetadataOK) IsServerError() bool { 77 return false 78 } 79 80 // IsCode returns true when this get cgroup dump metadata o k response a status code equal to that given 81 func (o *GetCgroupDumpMetadataOK) IsCode(code int) bool { 82 return code == 200 83 } 84 85 // Code gets the status code for the get cgroup dump metadata o k response 86 func (o *GetCgroupDumpMetadataOK) Code() int { 87 return 200 88 } 89 90 func (o *GetCgroupDumpMetadataOK) Error() string { 91 return fmt.Sprintf("[GET /cgroup-dump-metadata][%d] getCgroupDumpMetadataOK %+v", 200, o.Payload) 92 } 93 94 func (o *GetCgroupDumpMetadataOK) String() string { 95 return fmt.Sprintf("[GET /cgroup-dump-metadata][%d] getCgroupDumpMetadataOK %+v", 200, o.Payload) 96 } 97 98 func (o *GetCgroupDumpMetadataOK) GetPayload() *models.CgroupDumpMetadata { 99 return o.Payload 100 } 101 102 func (o *GetCgroupDumpMetadataOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 103 104 o.Payload = new(models.CgroupDumpMetadata) 105 106 // response payload 107 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 108 return err 109 } 110 111 return nil 112 } 113 114 // NewGetCgroupDumpMetadataFailure creates a GetCgroupDumpMetadataFailure with default headers values 115 func NewGetCgroupDumpMetadataFailure() *GetCgroupDumpMetadataFailure { 116 return &GetCgroupDumpMetadataFailure{} 117 } 118 119 /* 120 GetCgroupDumpMetadataFailure describes a response with status code 500, with default header values. 121 122 CgroupDumpMetadata get failed 123 */ 124 type GetCgroupDumpMetadataFailure struct { 125 Payload models.Error 126 } 127 128 // IsSuccess returns true when this get cgroup dump metadata failure response has a 2xx status code 129 func (o *GetCgroupDumpMetadataFailure) IsSuccess() bool { 130 return false 131 } 132 133 // IsRedirect returns true when this get cgroup dump metadata failure response has a 3xx status code 134 func (o *GetCgroupDumpMetadataFailure) IsRedirect() bool { 135 return false 136 } 137 138 // IsClientError returns true when this get cgroup dump metadata failure response has a 4xx status code 139 func (o *GetCgroupDumpMetadataFailure) IsClientError() bool { 140 return false 141 } 142 143 // IsServerError returns true when this get cgroup dump metadata failure response has a 5xx status code 144 func (o *GetCgroupDumpMetadataFailure) IsServerError() bool { 145 return true 146 } 147 148 // IsCode returns true when this get cgroup dump metadata failure response a status code equal to that given 149 func (o *GetCgroupDumpMetadataFailure) IsCode(code int) bool { 150 return code == 500 151 } 152 153 // Code gets the status code for the get cgroup dump metadata failure response 154 func (o *GetCgroupDumpMetadataFailure) Code() int { 155 return 500 156 } 157 158 func (o *GetCgroupDumpMetadataFailure) Error() string { 159 return fmt.Sprintf("[GET /cgroup-dump-metadata][%d] getCgroupDumpMetadataFailure %+v", 500, o.Payload) 160 } 161 162 func (o *GetCgroupDumpMetadataFailure) String() string { 163 return fmt.Sprintf("[GET /cgroup-dump-metadata][%d] getCgroupDumpMetadataFailure %+v", 500, o.Payload) 164 } 165 166 func (o *GetCgroupDumpMetadataFailure) GetPayload() models.Error { 167 return o.Payload 168 } 169 170 func (o *GetCgroupDumpMetadataFailure) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 171 172 // response payload 173 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 174 return err 175 } 176 177 return nil 178 }