// Code generated by go-swagger; DO NOT EDIT. package account // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" "github.com/go-openapi/swag" ) // ResetTokenReader is a Reader for the ResetToken structure. type ResetTokenReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *ResetTokenReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 200: result := NewResetTokenOK() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 404: result := NewResetTokenNotFound() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewResetTokenInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("[POST /resetToken] resetToken", response, response.Code()) } } // NewResetTokenOK creates a ResetTokenOK with default headers values func NewResetTokenOK() *ResetTokenOK { return &ResetTokenOK{} } /* ResetTokenOK describes a response with status code 200, with default header values. token reset */ type ResetTokenOK struct { Payload *ResetTokenOKBody } // IsSuccess returns true when this reset token o k response has a 2xx status code func (o *ResetTokenOK) IsSuccess() bool { return true } // IsRedirect returns true when this reset token o k response has a 3xx status code func (o *ResetTokenOK) IsRedirect() bool { return false } // IsClientError returns true when this reset token o k response has a 4xx status code func (o *ResetTokenOK) IsClientError() bool { return false } // IsServerError returns true when this reset token o k response has a 5xx status code func (o *ResetTokenOK) IsServerError() bool { return false } // IsCode returns true when this reset token o k response a status code equal to that given func (o *ResetTokenOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the reset token o k response func (o *ResetTokenOK) Code() int { return 200 } func (o *ResetTokenOK) Error() string { return fmt.Sprintf("[POST /resetToken][%d] resetTokenOK %+v", 200, o.Payload) } func (o *ResetTokenOK) String() string { return fmt.Sprintf("[POST /resetToken][%d] resetTokenOK %+v", 200, o.Payload) } func (o *ResetTokenOK) GetPayload() *ResetTokenOKBody { return o.Payload } func (o *ResetTokenOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { o.Payload = new(ResetTokenOKBody) // response payload if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { return err } return nil } // NewResetTokenNotFound creates a ResetTokenNotFound with default headers values func NewResetTokenNotFound() *ResetTokenNotFound { return &ResetTokenNotFound{} } /* ResetTokenNotFound describes a response with status code 404, with default header values. account not found */ type ResetTokenNotFound struct { } // IsSuccess returns true when this reset token not found response has a 2xx status code func (o *ResetTokenNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this reset token not found response has a 3xx status code func (o *ResetTokenNotFound) IsRedirect() bool { return false } // IsClientError returns true when this reset token not found response has a 4xx status code func (o *ResetTokenNotFound) IsClientError() bool { return true } // IsServerError returns true when this reset token not found response has a 5xx status code func (o *ResetTokenNotFound) IsServerError() bool { return false } // IsCode returns true when this reset token not found response a status code equal to that given func (o *ResetTokenNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the reset token not found response func (o *ResetTokenNotFound) Code() int { return 404 } func (o *ResetTokenNotFound) Error() string { return fmt.Sprintf("[POST /resetToken][%d] resetTokenNotFound ", 404) } func (o *ResetTokenNotFound) String() string { return fmt.Sprintf("[POST /resetToken][%d] resetTokenNotFound ", 404) } func (o *ResetTokenNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewResetTokenInternalServerError creates a ResetTokenInternalServerError with default headers values func NewResetTokenInternalServerError() *ResetTokenInternalServerError { return &ResetTokenInternalServerError{} } /* ResetTokenInternalServerError describes a response with status code 500, with default header values. internal server error */ type ResetTokenInternalServerError struct { } // IsSuccess returns true when this reset token internal server error response has a 2xx status code func (o *ResetTokenInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this reset token internal server error response has a 3xx status code func (o *ResetTokenInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this reset token internal server error response has a 4xx status code func (o *ResetTokenInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this reset token internal server error response has a 5xx status code func (o *ResetTokenInternalServerError) IsServerError() bool { return true } // IsCode returns true when this reset token internal server error response a status code equal to that given func (o *ResetTokenInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the reset token internal server error response func (o *ResetTokenInternalServerError) Code() int { return 500 } func (o *ResetTokenInternalServerError) Error() string { return fmt.Sprintf("[POST /resetToken][%d] resetTokenInternalServerError ", 500) } func (o *ResetTokenInternalServerError) String() string { return fmt.Sprintf("[POST /resetToken][%d] resetTokenInternalServerError ", 500) } func (o *ResetTokenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } /* ResetTokenBody reset token body swagger:model ResetTokenBody */ type ResetTokenBody struct { // email address EmailAddress string `json:"emailAddress,omitempty"` } // Validate validates this reset token body func (o *ResetTokenBody) Validate(formats strfmt.Registry) error { return nil } // ContextValidate validates this reset token body based on context it is used func (o *ResetTokenBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation func (o *ResetTokenBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *ResetTokenBody) UnmarshalBinary(b []byte) error { var res ResetTokenBody if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil } /* ResetTokenOKBody reset token o k body swagger:model ResetTokenOKBody */ type ResetTokenOKBody struct { // token Token string `json:"token,omitempty"` } // Validate validates this reset token o k body func (o *ResetTokenOKBody) Validate(formats strfmt.Registry) error { return nil } // ContextValidate validates this reset token o k body based on context it is used func (o *ResetTokenOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { return nil } // MarshalBinary interface implementation func (o *ResetTokenOKBody) MarshalBinary() ([]byte, error) { if o == nil { return nil, nil } return swag.WriteJSON(o) } // UnmarshalBinary interface implementation func (o *ResetTokenOKBody) UnmarshalBinary(b []byte) error { var res ResetTokenOKBody if err := swag.ReadJSON(b, &res); err != nil { return err } *o = res return nil }