You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
4.2 KiB
148 lines
4.2 KiB
3 years ago
|
// Code generated by go-swagger; DO NOT EDIT.
|
||
|
|
||
|
package account_management
|
||
|
|
||
|
// This file was generated by the swagger tool.
|
||
|
// Editing this file might prove futile when you re-run the swagger generate command
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"io"
|
||
|
|
||
|
"github.com/go-openapi/runtime"
|
||
|
"github.com/go-openapi/strfmt"
|
||
|
|
||
|
"github.com/Cyclops-Labs/cyclops-4-hpc.git/services/credit-system/models"
|
||
|
)
|
||
|
|
||
|
// EnableAccountReader is a Reader for the EnableAccount structure.
|
||
|
type EnableAccountReader struct {
|
||
|
formats strfmt.Registry
|
||
|
}
|
||
|
|
||
|
// ReadResponse reads a server response into the received o.
|
||
|
func (o *EnableAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
||
|
switch response.Code() {
|
||
|
case 200:
|
||
|
result := NewEnableAccountOK()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return result, nil
|
||
|
case 404:
|
||
|
result := NewEnableAccountNotFound()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
case 500:
|
||
|
result := NewEnableAccountInternalServerError()
|
||
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return nil, result
|
||
|
|
||
|
default:
|
||
|
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// NewEnableAccountOK creates a EnableAccountOK with default headers values
|
||
|
func NewEnableAccountOK() *EnableAccountOK {
|
||
|
return &EnableAccountOK{}
|
||
|
}
|
||
|
|
||
|
/*EnableAccountOK handles this case with default header values.
|
||
|
|
||
|
Status information of the account with provided id in the system after the operation succeded
|
||
|
*/
|
||
|
type EnableAccountOK struct {
|
||
|
Payload *models.AccountStatus
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountOK) Error() string {
|
||
|
return fmt.Sprintf("[POST /account/enable/{id}][%d] enableAccountOK %+v", 200, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountOK) GetPayload() *models.AccountStatus {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
o.Payload = new(models.AccountStatus)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewEnableAccountNotFound creates a EnableAccountNotFound with default headers values
|
||
|
func NewEnableAccountNotFound() *EnableAccountNotFound {
|
||
|
return &EnableAccountNotFound{}
|
||
|
}
|
||
|
|
||
|
/*EnableAccountNotFound handles this case with default header values.
|
||
|
|
||
|
The account with the id provided doesn't exist
|
||
|
*/
|
||
|
type EnableAccountNotFound struct {
|
||
|
Payload *models.ErrorResponse
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountNotFound) Error() string {
|
||
|
return fmt.Sprintf("[POST /account/enable/{id}][%d] enableAccountNotFound %+v", 404, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountNotFound) GetPayload() *models.ErrorResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
o.Payload = new(models.ErrorResponse)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// NewEnableAccountInternalServerError creates a EnableAccountInternalServerError with default headers values
|
||
|
func NewEnableAccountInternalServerError() *EnableAccountInternalServerError {
|
||
|
return &EnableAccountInternalServerError{}
|
||
|
}
|
||
|
|
||
|
/*EnableAccountInternalServerError handles this case with default header values.
|
||
|
|
||
|
Something unexpected happend, error raised
|
||
|
*/
|
||
|
type EnableAccountInternalServerError struct {
|
||
|
Payload *models.ErrorResponse
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountInternalServerError) Error() string {
|
||
|
return fmt.Sprintf("[POST /account/enable/{id}][%d] enableAccountInternalServerError %+v", 500, o.Payload)
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountInternalServerError) GetPayload() *models.ErrorResponse {
|
||
|
return o.Payload
|
||
|
}
|
||
|
|
||
|
func (o *EnableAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
||
|
|
||
|
o.Payload = new(models.ErrorResponse)
|
||
|
|
||
|
// response payload
|
||
|
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|