github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_client/projects/move_project_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package projects 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 "context" 10 "fmt" 11 "io" 12 13 "github.com/go-openapi/runtime" 14 "github.com/go-openapi/strfmt" 15 "github.com/go-openapi/swag" 16 17 "github.com/ActiveState/cli/pkg/platform/api/mono/mono_models" 18 ) 19 20 // MoveProjectReader is a Reader for the MoveProject structure. 21 type MoveProjectReader struct { 22 formats strfmt.Registry 23 } 24 25 // ReadResponse reads a server response into the received o. 26 func (o *MoveProjectReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { 27 switch response.Code() { 28 case 200: 29 result := NewMoveProjectOK() 30 if err := result.readResponse(response, consumer, o.formats); err != nil { 31 return nil, err 32 } 33 return result, nil 34 case 400: 35 result := NewMoveProjectBadRequest() 36 if err := result.readResponse(response, consumer, o.formats); err != nil { 37 return nil, err 38 } 39 return nil, result 40 case 403: 41 result := NewMoveProjectForbidden() 42 if err := result.readResponse(response, consumer, o.formats); err != nil { 43 return nil, err 44 } 45 return nil, result 46 case 404: 47 result := NewMoveProjectNotFound() 48 if err := result.readResponse(response, consumer, o.formats); err != nil { 49 return nil, err 50 } 51 return nil, result 52 case 409: 53 result := NewMoveProjectConflict() 54 if err := result.readResponse(response, consumer, o.formats); err != nil { 55 return nil, err 56 } 57 return nil, result 58 case 500: 59 result := NewMoveProjectInternalServerError() 60 if err := result.readResponse(response, consumer, o.formats); err != nil { 61 return nil, err 62 } 63 return nil, result 64 default: 65 return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) 66 } 67 } 68 69 // NewMoveProjectOK creates a MoveProjectOK with default headers values 70 func NewMoveProjectOK() *MoveProjectOK { 71 return &MoveProjectOK{} 72 } 73 74 /* MoveProjectOK describes a response with status code 200, with default header values. 75 76 Project moved 77 */ 78 type MoveProjectOK struct { 79 Payload *mono_models.Project 80 } 81 82 func (o *MoveProjectOK) Error() string { 83 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/projects/{projectName}/move][%d] moveProjectOK %+v", 200, o.Payload) 84 } 85 func (o *MoveProjectOK) GetPayload() *mono_models.Project { 86 return o.Payload 87 } 88 89 func (o *MoveProjectOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 90 91 o.Payload = new(mono_models.Project) 92 93 // response payload 94 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 95 return err 96 } 97 98 return nil 99 } 100 101 // NewMoveProjectBadRequest creates a MoveProjectBadRequest with default headers values 102 func NewMoveProjectBadRequest() *MoveProjectBadRequest { 103 return &MoveProjectBadRequest{} 104 } 105 106 /* MoveProjectBadRequest describes a response with status code 400, with default header values. 107 108 Bad Request 109 */ 110 type MoveProjectBadRequest struct { 111 Payload *mono_models.Message 112 } 113 114 func (o *MoveProjectBadRequest) Error() string { 115 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/projects/{projectName}/move][%d] moveProjectBadRequest %+v", 400, o.Payload) 116 } 117 func (o *MoveProjectBadRequest) GetPayload() *mono_models.Message { 118 return o.Payload 119 } 120 121 func (o *MoveProjectBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 122 123 o.Payload = new(mono_models.Message) 124 125 // response payload 126 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 127 return err 128 } 129 130 return nil 131 } 132 133 // NewMoveProjectForbidden creates a MoveProjectForbidden with default headers values 134 func NewMoveProjectForbidden() *MoveProjectForbidden { 135 return &MoveProjectForbidden{} 136 } 137 138 /* MoveProjectForbidden describes a response with status code 403, with default header values. 139 140 Unauthorized 141 */ 142 type MoveProjectForbidden struct { 143 Payload *mono_models.Message 144 } 145 146 func (o *MoveProjectForbidden) Error() string { 147 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/projects/{projectName}/move][%d] moveProjectForbidden %+v", 403, o.Payload) 148 } 149 func (o *MoveProjectForbidden) GetPayload() *mono_models.Message { 150 return o.Payload 151 } 152 153 func (o *MoveProjectForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 154 155 o.Payload = new(mono_models.Message) 156 157 // response payload 158 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 159 return err 160 } 161 162 return nil 163 } 164 165 // NewMoveProjectNotFound creates a MoveProjectNotFound with default headers values 166 func NewMoveProjectNotFound() *MoveProjectNotFound { 167 return &MoveProjectNotFound{} 168 } 169 170 /* MoveProjectNotFound describes a response with status code 404, with default header values. 171 172 Not Found 173 */ 174 type MoveProjectNotFound struct { 175 Payload *mono_models.Message 176 } 177 178 func (o *MoveProjectNotFound) Error() string { 179 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/projects/{projectName}/move][%d] moveProjectNotFound %+v", 404, o.Payload) 180 } 181 func (o *MoveProjectNotFound) GetPayload() *mono_models.Message { 182 return o.Payload 183 } 184 185 func (o *MoveProjectNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 186 187 o.Payload = new(mono_models.Message) 188 189 // response payload 190 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 191 return err 192 } 193 194 return nil 195 } 196 197 // NewMoveProjectConflict creates a MoveProjectConflict with default headers values 198 func NewMoveProjectConflict() *MoveProjectConflict { 199 return &MoveProjectConflict{} 200 } 201 202 /* MoveProjectConflict describes a response with status code 409, with default header values. 203 204 Conflict 205 */ 206 type MoveProjectConflict struct { 207 Payload *mono_models.Message 208 } 209 210 func (o *MoveProjectConflict) Error() string { 211 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/projects/{projectName}/move][%d] moveProjectConflict %+v", 409, o.Payload) 212 } 213 func (o *MoveProjectConflict) GetPayload() *mono_models.Message { 214 return o.Payload 215 } 216 217 func (o *MoveProjectConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 218 219 o.Payload = new(mono_models.Message) 220 221 // response payload 222 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 223 return err 224 } 225 226 return nil 227 } 228 229 // NewMoveProjectInternalServerError creates a MoveProjectInternalServerError with default headers values 230 func NewMoveProjectInternalServerError() *MoveProjectInternalServerError { 231 return &MoveProjectInternalServerError{} 232 } 233 234 /* MoveProjectInternalServerError describes a response with status code 500, with default header values. 235 236 Server Error 237 */ 238 type MoveProjectInternalServerError struct { 239 Payload *mono_models.Message 240 } 241 242 func (o *MoveProjectInternalServerError) Error() string { 243 return fmt.Sprintf("[POST /organizations/{organizationIdentifier}/projects/{projectName}/move][%d] moveProjectInternalServerError %+v", 500, o.Payload) 244 } 245 func (o *MoveProjectInternalServerError) GetPayload() *mono_models.Message { 246 return o.Payload 247 } 248 249 func (o *MoveProjectInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { 250 251 o.Payload = new(mono_models.Message) 252 253 // response payload 254 if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { 255 return err 256 } 257 258 return nil 259 } 260 261 /*MoveProjectBody move project body 262 swagger:model MoveProjectBody 263 */ 264 type MoveProjectBody struct { 265 266 // Destination organization name for the moved project. 267 Destination string `json:"destination,omitempty"` 268 } 269 270 // Validate validates this move project body 271 func (o *MoveProjectBody) Validate(formats strfmt.Registry) error { 272 return nil 273 } 274 275 // ContextValidate validates this move project body based on context it is used 276 func (o *MoveProjectBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 277 return nil 278 } 279 280 // MarshalBinary interface implementation 281 func (o *MoveProjectBody) MarshalBinary() ([]byte, error) { 282 if o == nil { 283 return nil, nil 284 } 285 return swag.WriteJSON(o) 286 } 287 288 // UnmarshalBinary interface implementation 289 func (o *MoveProjectBody) UnmarshalBinary(b []byte) error { 290 var res MoveProjectBody 291 if err := swag.ReadJSON(b, &res); err != nil { 292 return err 293 } 294 *o = res 295 return nil 296 }