github.com/cilium/cilium@v1.16.2/api/v1/client/daemon/get_map_name_events_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 19 // GetMapNameEventsReader is a Reader for the GetMapNameEvents structure. 20 type GetMapNameEventsReader struct { 21 formats strfmt.Registry 22 writer io.Writer 23 } 24 25 // ReadResponse reads a server response into the received o. 26 func (o *GetMapNameEventsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 27 switch response.Code() { 28 case 200: 29 result := NewGetMapNameEventsOK(o.writer) 30 if err := result.readResponse(response, consumer, o.formats); err != nil { 31 return nil, err 32 } 33 return result, nil 34 case 404: 35 result := NewGetMapNameEventsNotFound() 36 if err := result.readResponse(response, consumer, o.formats); err != nil { 37 return nil, err 38 } 39 return nil, result 40 default: 41 return nil, runtime.NewAPIError("[GET /map/{name}/events] GetMapNameEvents", response, response.Code()) 42 } 43 } 44 45 // NewGetMapNameEventsOK creates a GetMapNameEventsOK with default headers values 46 func NewGetMapNameEventsOK(writer io.Writer) *GetMapNameEventsOK { 47 return &GetMapNameEventsOK{ 48 49 Payload: writer, 50 } 51 } 52 53 /* 54 GetMapNameEventsOK describes a response with status code 200, with default header values. 55 56 Success 57 */ 58 type GetMapNameEventsOK struct { 59 Payload io.Writer 60 } 61 62 // IsSuccess returns true when this get map name events o k response has a 2xx status code 63 func (o *GetMapNameEventsOK) IsSuccess() bool { 64 return true 65 } 66 67 // IsRedirect returns true when this get map name events o k response has a 3xx status code 68 func (o *GetMapNameEventsOK) IsRedirect() bool { 69 return false 70 } 71 72 // IsClientError returns true when this get map name events o k response has a 4xx status code 73 func (o *GetMapNameEventsOK) IsClientError() bool { 74 return false 75 } 76 77 // IsServerError returns true when this get map name events o k response has a 5xx status code 78 func (o *GetMapNameEventsOK) IsServerError() bool { 79 return false 80 } 81 82 // IsCode returns true when this get map name events o k response a status code equal to that given 83 func (o *GetMapNameEventsOK) IsCode(code int) bool { 84 return code == 200 85 } 86 87 // Code gets the status code for the get map name events o k response 88 func (o *GetMapNameEventsOK) Code() int { 89 return 200 90 } 91 92 func (o *GetMapNameEventsOK) Error() string { 93 return fmt.Sprintf("[GET /map/{name}/events][%d] getMapNameEventsOK %+v", 200, o.Payload) 94 } 95 96 func (o *GetMapNameEventsOK) String() string { 97 return fmt.Sprintf("[GET /map/{name}/events][%d] getMapNameEventsOK %+v", 200, o.Payload) 98 } 99 100 func (o *GetMapNameEventsOK) GetPayload() io.Writer { 101 return o.Payload 102 } 103 104 func (o *GetMapNameEventsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 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 // NewGetMapNameEventsNotFound creates a GetMapNameEventsNotFound with default headers values 115 func NewGetMapNameEventsNotFound() *GetMapNameEventsNotFound { 116 return &GetMapNameEventsNotFound{} 117 } 118 119 /* 120 GetMapNameEventsNotFound describes a response with status code 404, with default header values. 121 122 Map not found 123 */ 124 type GetMapNameEventsNotFound struct { 125 } 126 127 // IsSuccess returns true when this get map name events not found response has a 2xx status code 128 func (o *GetMapNameEventsNotFound) IsSuccess() bool { 129 return false 130 } 131 132 // IsRedirect returns true when this get map name events not found response has a 3xx status code 133 func (o *GetMapNameEventsNotFound) IsRedirect() bool { 134 return false 135 } 136 137 // IsClientError returns true when this get map name events not found response has a 4xx status code 138 func (o *GetMapNameEventsNotFound) IsClientError() bool { 139 return true 140 } 141 142 // IsServerError returns true when this get map name events not found response has a 5xx status code 143 func (o *GetMapNameEventsNotFound) IsServerError() bool { 144 return false 145 } 146 147 // IsCode returns true when this get map name events not found response a status code equal to that given 148 func (o *GetMapNameEventsNotFound) IsCode(code int) bool { 149 return code == 404 150 } 151 152 // Code gets the status code for the get map name events not found response 153 func (o *GetMapNameEventsNotFound) Code() int { 154 return 404 155 } 156 157 func (o *GetMapNameEventsNotFound) Error() string { 158 return fmt.Sprintf("[GET /map/{name}/events][%d] getMapNameEventsNotFound ", 404) 159 } 160 161 func (o *GetMapNameEventsNotFound) String() string { 162 return fmt.Sprintf("[GET /map/{name}/events][%d] getMapNameEventsNotFound ", 404) 163 } 164 165 func (o *GetMapNameEventsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 166 167 return nil 168 }