// Code generated by go-swagger; DO NOT EDIT. package identity // 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/openziti-test-kitchen/zrok/rest_model_zrok" ) // CreateAccountReader is a Reader for the CreateAccount structure. type CreateAccountReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *CreateAccountReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 201: result := NewCreateAccountCreated() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 400: result := NewCreateAccountBadRequest() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewCreateAccountInternalServerError() 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()) } } // NewCreateAccountCreated creates a CreateAccountCreated with default headers values func NewCreateAccountCreated() *CreateAccountCreated { return &CreateAccountCreated{} } /* CreateAccountCreated describes a response with status code 201, with default header values. account created */ type CreateAccountCreated struct { } // IsSuccess returns true when this create account created response has a 2xx status code func (o *CreateAccountCreated) IsSuccess() bool { return true } // IsRedirect returns true when this create account created response has a 3xx status code func (o *CreateAccountCreated) IsRedirect() bool { return false } // IsClientError returns true when this create account created response has a 4xx status code func (o *CreateAccountCreated) IsClientError() bool { return false } // IsServerError returns true when this create account created response has a 5xx status code func (o *CreateAccountCreated) IsServerError() bool { return false } // IsCode returns true when this create account created response a status code equal to that given func (o *CreateAccountCreated) IsCode(code int) bool { return code == 201 } func (o *CreateAccountCreated) Error() string { return fmt.Sprintf("[POST /account][%d] createAccountCreated ", 201) } func (o *CreateAccountCreated) String() string { return fmt.Sprintf("[POST /account][%d] createAccountCreated ", 201) } func (o *CreateAccountCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewCreateAccountBadRequest creates a CreateAccountBadRequest with default headers values func NewCreateAccountBadRequest() *CreateAccountBadRequest { return &CreateAccountBadRequest{} } /* CreateAccountBadRequest describes a response with status code 400, with default header values. account not created (already exists) */ type CreateAccountBadRequest struct { Payload rest_model_zrok.ErrorMessage } // IsSuccess returns true when this create account bad request response has a 2xx status code func (o *CreateAccountBadRequest) IsSuccess() bool { return false } // IsRedirect returns true when this create account bad request response has a 3xx status code func (o *CreateAccountBadRequest) IsRedirect() bool { return false } // IsClientError returns true when this create account bad request response has a 4xx status code func (o *CreateAccountBadRequest) IsClientError() bool { return true } // IsServerError returns true when this create account bad request response has a 5xx status code func (o *CreateAccountBadRequest) IsServerError() bool { return false } // IsCode returns true when this create account bad request response a status code equal to that given func (o *CreateAccountBadRequest) IsCode(code int) bool { return code == 400 } func (o *CreateAccountBadRequest) Error() string { return fmt.Sprintf("[POST /account][%d] createAccountBadRequest %+v", 400, o.Payload) } func (o *CreateAccountBadRequest) String() string { return fmt.Sprintf("[POST /account][%d] createAccountBadRequest %+v", 400, o.Payload) } func (o *CreateAccountBadRequest) GetPayload() rest_model_zrok.ErrorMessage { return o.Payload } func (o *CreateAccountBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } return nil } // NewCreateAccountInternalServerError creates a CreateAccountInternalServerError with default headers values func NewCreateAccountInternalServerError() *CreateAccountInternalServerError { return &CreateAccountInternalServerError{} } /* CreateAccountInternalServerError describes a response with status code 500, with default header values. internal server error */ type CreateAccountInternalServerError struct { Payload rest_model_zrok.ErrorMessage } // IsSuccess returns true when this create account internal server error response has a 2xx status code func (o *CreateAccountInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this create account internal server error response has a 3xx status code func (o *CreateAccountInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this create account internal server error response has a 4xx status code func (o *CreateAccountInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this create account internal server error response has a 5xx status code func (o *CreateAccountInternalServerError) IsServerError() bool { return true } // IsCode returns true when this create account internal server error response a status code equal to that given func (o *CreateAccountInternalServerError) IsCode(code int) bool { return code == 500 } func (o *CreateAccountInternalServerError) Error() string { return fmt.Sprintf("[POST /account][%d] createAccountInternalServerError %+v", 500, o.Payload) } func (o *CreateAccountInternalServerError) String() string { return fmt.Sprintf("[POST /account][%d] createAccountInternalServerError %+v", 500, o.Payload) } func (o *CreateAccountInternalServerError) GetPayload() rest_model_zrok.ErrorMessage { return o.Payload } func (o *CreateAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } return nil }