(Feat): Initial Commit
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled

This commit is contained in:
2026-07-03 19:41:31 +05:30
commit 7e940c83a7
461 changed files with 45002 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewDeleteUserAccountRouteParams creates a new DeleteUserAccountRouteParams object
// no default values defined in spec.
func NewDeleteUserAccountRouteParams() DeleteUserAccountRouteParams {
return DeleteUserAccountRouteParams{}
}
// DeleteUserAccountRouteParams contains all the bound params for the delete user account route operation
// typically these are obtained from a http.Request
//
// swagger:parameters DeleteUserAccountRoute
type DeleteUserAccountRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.DeleteUserAccountPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewDeleteUserAccountRouteParams() beforehand.
func (o *DeleteUserAccountRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.DeleteUserAccountPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *DeleteUserAccountRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,120 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// NewGetCompleteRegisterRouteParams creates a new GetCompleteRegisterRouteParams object
// no default values defined in spec.
func NewGetCompleteRegisterRouteParams() GetCompleteRegisterRouteParams {
return GetCompleteRegisterRouteParams{}
}
// GetCompleteRegisterRouteParams contains all the bound params for the get complete register route operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetCompleteRegisterRoute
type GetCompleteRegisterRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*Registration token to complete the registration process
Required: true
In: query
*/
Token strfmt.UUID4 `query:"token"`
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewGetCompleteRegisterRouteParams() beforehand.
func (o *GetCompleteRegisterRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
qs := runtime.Values(r.URL.Query())
qToken, qhkToken, _ := qs.GetOK("token")
if err := o.bindToken(qToken, qhkToken, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetCompleteRegisterRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// token
// Required: true
// AllowEmptyValue: false
if err := validate.Required("token", "query", o.Token); err != nil {
res = append(res, err)
}
if err := o.validateToken(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindToken binds and validates parameter Token from query.
func (o *GetCompleteRegisterRouteParams) bindToken(rawData []string, hasKey bool, formats strfmt.Registry) error {
if !hasKey {
return errors.Required("token", "query", rawData)
}
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: true
// AllowEmptyValue: false
if err := validate.RequiredString("token", "query", raw); err != nil {
return err
}
// Format: uuid4
value, err := formats.Parse("uuid4", raw)
if err != nil {
return errors.InvalidType("token", "query", "strfmt.UUID4", raw)
}
o.Token = *(value.(*strfmt.UUID4))
if err := o.validateToken(formats); err != nil {
return err
}
return nil
}
// validateToken carries on validations for parameter Token
func (o *GetCompleteRegisterRouteParams) validateToken(formats strfmt.Registry) error {
if err := validate.FormatOf("token", "query", "uuid4", o.Token.String(), formats); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,55 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
)
// NewGetUserInfoRouteParams creates a new GetUserInfoRouteParams object
// no default values defined in spec.
func NewGetUserInfoRouteParams() GetUserInfoRouteParams {
return GetUserInfoRouteParams{}
}
// GetUserInfoRouteParams contains all the bound params for the get user info route operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetUserInfoRoute
type GetUserInfoRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewGetUserInfoRouteParams() beforehand.
func (o *GetUserInfoRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *GetUserInfoRouteParams) Validate(formats strfmt.Registry) error {
var res []error
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostChangePasswordRouteParams creates a new PostChangePasswordRouteParams object
// no default values defined in spec.
func NewPostChangePasswordRouteParams() PostChangePasswordRouteParams {
return PostChangePasswordRouteParams{}
}
// PostChangePasswordRouteParams contains all the bound params for the post change password route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostChangePasswordRoute
type PostChangePasswordRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostChangePasswordPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostChangePasswordRouteParams() beforehand.
func (o *PostChangePasswordRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostChangePasswordPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostChangePasswordRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,108 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
)
// NewPostCompleteRegisterRouteParams creates a new PostCompleteRegisterRouteParams object
// no default values defined in spec.
func NewPostCompleteRegisterRouteParams() PostCompleteRegisterRouteParams {
return PostCompleteRegisterRouteParams{}
}
// PostCompleteRegisterRouteParams contains all the bound params for the post complete register route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostCompleteRegisterRoute
type PostCompleteRegisterRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*Registration token to complete the registration process
Required: true
In: path
*/
RegistrationToken strfmt.UUID4 `param:"registrationToken"`
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostCompleteRegisterRouteParams() beforehand.
func (o *PostCompleteRegisterRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
rRegistrationToken, rhkRegistrationToken, _ := route.Params.GetOK("registrationToken")
if err := o.bindRegistrationToken(rRegistrationToken, rhkRegistrationToken, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostCompleteRegisterRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// registrationToken
// Required: true
// Parameter is provided by construction from the route
if err := o.validateRegistrationToken(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindRegistrationToken binds and validates parameter RegistrationToken from path.
func (o *PostCompleteRegisterRouteParams) bindRegistrationToken(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: true
// Parameter is provided by construction from the route
// Format: uuid4
value, err := formats.Parse("uuid4", raw)
if err != nil {
return errors.InvalidType("registrationToken", "path", "strfmt.UUID4", raw)
}
o.RegistrationToken = *(value.(*strfmt.UUID4))
if err := o.validateRegistrationToken(formats); err != nil {
return err
}
return nil
}
// validateRegistrationToken carries on validations for parameter RegistrationToken
func (o *PostCompleteRegisterRouteParams) validateRegistrationToken(formats strfmt.Registry) error {
if err := validate.FormatOf("registrationToken", "path", "uuid4", o.RegistrationToken.String(), formats); err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostForgotPasswordCompleteRouteParams creates a new PostForgotPasswordCompleteRouteParams object
// no default values defined in spec.
func NewPostForgotPasswordCompleteRouteParams() PostForgotPasswordCompleteRouteParams {
return PostForgotPasswordCompleteRouteParams{}
}
// PostForgotPasswordCompleteRouteParams contains all the bound params for the post forgot password complete route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostForgotPasswordCompleteRoute
type PostForgotPasswordCompleteRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostForgotPasswordCompletePayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostForgotPasswordCompleteRouteParams() beforehand.
func (o *PostForgotPasswordCompleteRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostForgotPasswordCompletePayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostForgotPasswordCompleteRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostForgotPasswordRouteParams creates a new PostForgotPasswordRouteParams object
// no default values defined in spec.
func NewPostForgotPasswordRouteParams() PostForgotPasswordRouteParams {
return PostForgotPasswordRouteParams{}
}
// PostForgotPasswordRouteParams contains all the bound params for the post forgot password route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostForgotPasswordRoute
type PostForgotPasswordRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostForgotPasswordPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostForgotPasswordRouteParams() beforehand.
func (o *PostForgotPasswordRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostForgotPasswordPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostForgotPasswordRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostLoginRouteParams creates a new PostLoginRouteParams object
// no default values defined in spec.
func NewPostLoginRouteParams() PostLoginRouteParams {
return PostLoginRouteParams{}
}
// PostLoginRouteParams contains all the bound params for the post login route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostLoginRoute
type PostLoginRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostLoginPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostLoginRouteParams() beforehand.
func (o *PostLoginRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostLoginPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostLoginRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostLogoutRouteParams creates a new PostLogoutRouteParams object
// no default values defined in spec.
func NewPostLogoutRouteParams() PostLogoutRouteParams {
return PostLogoutRouteParams{}
}
// PostLogoutRouteParams contains all the bound params for the post logout route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostLogoutRoute
type PostLogoutRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostLogoutPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostLogoutRouteParams() beforehand.
func (o *PostLogoutRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostLogoutPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostLogoutRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostRefreshRouteParams creates a new PostRefreshRouteParams object
// no default values defined in spec.
func NewPostRefreshRouteParams() PostRefreshRouteParams {
return PostRefreshRouteParams{}
}
// PostRefreshRouteParams contains all the bound params for the post refresh route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostRefreshRoute
type PostRefreshRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostRefreshPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostRefreshRouteParams() beforehand.
func (o *PostRefreshRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostRefreshPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostRefreshRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package auth
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"allaboutapps.dev/aw/go-starter/internal/types"
)
// NewPostRegisterRouteParams creates a new PostRegisterRouteParams object
// no default values defined in spec.
func NewPostRegisterRouteParams() PostRegisterRouteParams {
return PostRegisterRouteParams{}
}
// PostRegisterRouteParams contains all the bound params for the post register route operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostRegisterRoute
type PostRegisterRouteParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Payload *types.PostRegisterPayload
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostRegisterRouteParams() beforehand.
func (o *PostRegisterRouteParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body types.PostRegisterPayload
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("payload", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Payload = &body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *PostRegisterRouteParams) Validate(formats strfmt.Registry) error {
var res []error
// Payload
// Required: false
// body is validated in endpoint
//if err := o.Payload.Validate(formats); err != nil {
// res = append(res, err)
//}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}