github.com/goharbor/go-client@v0.210.0/pkg/sdk/v2.0/client/configure/get_internalconfig_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package configure 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 // GetInternalconfigReader is a Reader for the GetInternalconfig structure. 19 type GetInternalconfigReader struct { 20 formats strfmt.Registry 21 } 22 23 // ReadResponse reads a server response into the received o. 24 func (o *GetInternalconfigReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 25 switch response.Code() { 26 case 200: 27 result := NewGetInternalconfigOK() 28 if err := result.readResponse(response, consumer, o.formats); err != nil { 29 return nil, err 30 } 31 return result, nil 32 case 401: 33 result := NewGetInternalconfigUnauthorized() 34 if err := result.readResponse(response, consumer, o.formats); err != nil { 35 return nil, err 36 } 37 return nil, result 38 case 403: 39 result := NewGetInternalconfigForbidden() 40 if err := result.readResponse(response, consumer, o.formats); err != nil { 41 return nil, err 42 } 43 return nil, result 44 case 500: 45 result := NewGetInternalconfigInternalServerError() 46 if err := result.readResponse(response, consumer, o.formats); err != nil { 47 return nil, err 48 } 49 return nil, result 50 default: 51 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 52 } 53 } 54 55 // NewGetInternalconfigOK creates a GetInternalconfigOK with default headers values 56 func NewGetInternalconfigOK() *GetInternalconfigOK { 57 return &GetInternalconfigOK{} 58 } 59 60 /* 61 GetInternalconfigOK describes a response with status code 200, with default header values. 62 63 Get system configurations successfully. The response body is a map. 64 */ 65 type GetInternalconfigOK struct { 66 Payload models.InternalConfigurationsResponse 67 } 68 69 // IsSuccess returns true when this get internalconfig o k response has a 2xx status code 70 func (o *GetInternalconfigOK) IsSuccess() bool { 71 return true 72 } 73 74 // IsRedirect returns true when this get internalconfig o k response has a 3xx status code 75 func (o *GetInternalconfigOK) IsRedirect() bool { 76 return false 77 } 78 79 // IsClientError returns true when this get internalconfig o k response has a 4xx status code 80 func (o *GetInternalconfigOK) IsClientError() bool { 81 return false 82 } 83 84 // IsServerError returns true when this get internalconfig o k response has a 5xx status code 85 func (o *GetInternalconfigOK) IsServerError() bool { 86 return false 87 } 88 89 // IsCode returns true when this get internalconfig o k response a status code equal to that given 90 func (o *GetInternalconfigOK) IsCode(code int) bool { 91 return code == 200 92 } 93 94 func (o *GetInternalconfigOK) Error() string { 95 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigOK %+v", 200, o.Payload) 96 } 97 98 func (o *GetInternalconfigOK) String() string { 99 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigOK %+v", 200, o.Payload) 100 } 101 102 func (o *GetInternalconfigOK) GetPayload() models.InternalConfigurationsResponse { 103 return o.Payload 104 } 105 106 func (o *GetInternalconfigOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 107 108 // response payload 109 if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { 110 return err 111 } 112 113 return nil 114 } 115 116 // NewGetInternalconfigUnauthorized creates a GetInternalconfigUnauthorized with default headers values 117 func NewGetInternalconfigUnauthorized() *GetInternalconfigUnauthorized { 118 return &GetInternalconfigUnauthorized{} 119 } 120 121 /* 122 GetInternalconfigUnauthorized describes a response with status code 401, with default header values. 123 124 User need to log in first. 125 */ 126 type GetInternalconfigUnauthorized struct { 127 } 128 129 // IsSuccess returns true when this get internalconfig unauthorized response has a 2xx status code 130 func (o *GetInternalconfigUnauthorized) IsSuccess() bool { 131 return false 132 } 133 134 // IsRedirect returns true when this get internalconfig unauthorized response has a 3xx status code 135 func (o *GetInternalconfigUnauthorized) IsRedirect() bool { 136 return false 137 } 138 139 // IsClientError returns true when this get internalconfig unauthorized response has a 4xx status code 140 func (o *GetInternalconfigUnauthorized) IsClientError() bool { 141 return true 142 } 143 144 // IsServerError returns true when this get internalconfig unauthorized response has a 5xx status code 145 func (o *GetInternalconfigUnauthorized) IsServerError() bool { 146 return false 147 } 148 149 // IsCode returns true when this get internalconfig unauthorized response a status code equal to that given 150 func (o *GetInternalconfigUnauthorized) IsCode(code int) bool { 151 return code == 401 152 } 153 154 func (o *GetInternalconfigUnauthorized) Error() string { 155 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigUnauthorized ", 401) 156 } 157 158 func (o *GetInternalconfigUnauthorized) String() string { 159 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigUnauthorized ", 401) 160 } 161 162 func (o *GetInternalconfigUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 163 164 return nil 165 } 166 167 // NewGetInternalconfigForbidden creates a GetInternalconfigForbidden with default headers values 168 func NewGetInternalconfigForbidden() *GetInternalconfigForbidden { 169 return &GetInternalconfigForbidden{} 170 } 171 172 /* 173 GetInternalconfigForbidden describes a response with status code 403, with default header values. 174 175 User does not have permission of admin role. 176 */ 177 type GetInternalconfigForbidden struct { 178 } 179 180 // IsSuccess returns true when this get internalconfig forbidden response has a 2xx status code 181 func (o *GetInternalconfigForbidden) IsSuccess() bool { 182 return false 183 } 184 185 // IsRedirect returns true when this get internalconfig forbidden response has a 3xx status code 186 func (o *GetInternalconfigForbidden) IsRedirect() bool { 187 return false 188 } 189 190 // IsClientError returns true when this get internalconfig forbidden response has a 4xx status code 191 func (o *GetInternalconfigForbidden) IsClientError() bool { 192 return true 193 } 194 195 // IsServerError returns true when this get internalconfig forbidden response has a 5xx status code 196 func (o *GetInternalconfigForbidden) IsServerError() bool { 197 return false 198 } 199 200 // IsCode returns true when this get internalconfig forbidden response a status code equal to that given 201 func (o *GetInternalconfigForbidden) IsCode(code int) bool { 202 return code == 403 203 } 204 205 func (o *GetInternalconfigForbidden) Error() string { 206 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigForbidden ", 403) 207 } 208 209 func (o *GetInternalconfigForbidden) String() string { 210 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigForbidden ", 403) 211 } 212 213 func (o *GetInternalconfigForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 214 215 return nil 216 } 217 218 // NewGetInternalconfigInternalServerError creates a GetInternalconfigInternalServerError with default headers values 219 func NewGetInternalconfigInternalServerError() *GetInternalconfigInternalServerError { 220 return &GetInternalconfigInternalServerError{} 221 } 222 223 /* 224 GetInternalconfigInternalServerError describes a response with status code 500, with default header values. 225 226 Unexpected internal errors. 227 */ 228 type GetInternalconfigInternalServerError struct { 229 } 230 231 // IsSuccess returns true when this get internalconfig internal server error response has a 2xx status code 232 func (o *GetInternalconfigInternalServerError) IsSuccess() bool { 233 return false 234 } 235 236 // IsRedirect returns true when this get internalconfig internal server error response has a 3xx status code 237 func (o *GetInternalconfigInternalServerError) IsRedirect() bool { 238 return false 239 } 240 241 // IsClientError returns true when this get internalconfig internal server error response has a 4xx status code 242 func (o *GetInternalconfigInternalServerError) IsClientError() bool { 243 return false 244 } 245 246 // IsServerError returns true when this get internalconfig internal server error response has a 5xx status code 247 func (o *GetInternalconfigInternalServerError) IsServerError() bool { 248 return true 249 } 250 251 // IsCode returns true when this get internalconfig internal server error response a status code equal to that given 252 func (o *GetInternalconfigInternalServerError) IsCode(code int) bool { 253 return code == 500 254 } 255 256 func (o *GetInternalconfigInternalServerError) Error() string { 257 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigInternalServerError ", 500) 258 } 259 260 func (o *GetInternalconfigInternalServerError) String() string { 261 return fmt.Sprintf("[GET /internalconfig][%d] getInternalconfigInternalServerError ", 500) 262 } 263 264 func (o *GetInternalconfigInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 265 266 return nil 267 }