(Feat): Initial Commit
This commit is contained in:
87
internal/types/auth/delete_user_account_route_parameters.go
Normal file
87
internal/types/auth/delete_user_account_route_parameters.go
Normal 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
|
||||
}
|
||||
120
internal/types/auth/get_complete_register_route_parameters.go
Normal file
120
internal/types/auth/get_complete_register_route_parameters.go
Normal 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
|
||||
}
|
||||
55
internal/types/auth/get_user_info_route_parameters.go
Normal file
55
internal/types/auth/get_user_info_route_parameters.go
Normal 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
|
||||
}
|
||||
87
internal/types/auth/post_change_password_route_parameters.go
Normal file
87
internal/types/auth/post_change_password_route_parameters.go
Normal 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
|
||||
}
|
||||
108
internal/types/auth/post_complete_register_route_parameters.go
Normal file
108
internal/types/auth/post_complete_register_route_parameters.go
Normal 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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
87
internal/types/auth/post_forgot_password_route_parameters.go
Normal file
87
internal/types/auth/post_forgot_password_route_parameters.go
Normal 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
|
||||
}
|
||||
87
internal/types/auth/post_login_route_parameters.go
Normal file
87
internal/types/auth/post_login_route_parameters.go
Normal 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
|
||||
}
|
||||
87
internal/types/auth/post_logout_route_parameters.go
Normal file
87
internal/types/auth/post_logout_route_parameters.go
Normal 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
|
||||
}
|
||||
87
internal/types/auth/post_refresh_route_parameters.go
Normal file
87
internal/types/auth/post_refresh_route_parameters.go
Normal 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
|
||||
}
|
||||
87
internal/types/auth/post_register_route_parameters.go
Normal file
87
internal/types/auth/post_register_route_parameters.go
Normal 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
|
||||
}
|
||||
55
internal/types/common/get_healthy_route_parameters.go
Normal file
55
internal/types/common/get_healthy_route_parameters.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetHealthyRouteParams creates a new GetHealthyRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewGetHealthyRouteParams() GetHealthyRouteParams {
|
||||
|
||||
return GetHealthyRouteParams{}
|
||||
}
|
||||
|
||||
// GetHealthyRouteParams contains all the bound params for the get healthy route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters GetHealthyRoute
|
||||
type GetHealthyRouteParams 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 NewGetHealthyRouteParams() beforehand.
|
||||
func (o *GetHealthyRouteParams) 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 *GetHealthyRouteParams) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
55
internal/types/common/get_ready_route_parameters.go
Normal file
55
internal/types/common/get_ready_route_parameters.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetReadyRouteParams creates a new GetReadyRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewGetReadyRouteParams() GetReadyRouteParams {
|
||||
|
||||
return GetReadyRouteParams{}
|
||||
}
|
||||
|
||||
// GetReadyRouteParams contains all the bound params for the get ready route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters GetReadyRoute
|
||||
type GetReadyRouteParams 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 NewGetReadyRouteParams() beforehand.
|
||||
func (o *GetReadyRouteParams) 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 *GetReadyRouteParams) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
55
internal/types/common/get_swagger_route_parameters.go
Normal file
55
internal/types/common/get_swagger_route_parameters.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetSwaggerRouteParams creates a new GetSwaggerRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewGetSwaggerRouteParams() GetSwaggerRouteParams {
|
||||
|
||||
return GetSwaggerRouteParams{}
|
||||
}
|
||||
|
||||
// GetSwaggerRouteParams contains all the bound params for the get swagger route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters GetSwaggerRoute
|
||||
type GetSwaggerRouteParams 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 NewGetSwaggerRouteParams() beforehand.
|
||||
func (o *GetSwaggerRouteParams) 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 *GetSwaggerRouteParams) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
55
internal/types/common/get_version_route_parameters.go
Normal file
55
internal/types/common/get_version_route_parameters.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package common
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetVersionRouteParams creates a new GetVersionRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewGetVersionRouteParams() GetVersionRouteParams {
|
||||
|
||||
return GetVersionRouteParams{}
|
||||
}
|
||||
|
||||
// GetVersionRouteParams contains all the bound params for the get version route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters GetVersionRoute
|
||||
type GetVersionRouteParams 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 NewGetVersionRouteParams() beforehand.
|
||||
func (o *GetVersionRouteParams) 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 *GetVersionRouteParams) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
82
internal/types/delete_user_account_payload.go
Normal file
82
internal/types/delete_user_account_payload.go
Normal file
@@ -0,0 +1,82 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// DeleteUserAccountPayload delete user account payload
|
||||
//
|
||||
// swagger:model deleteUserAccountPayload
|
||||
type DeleteUserAccountPayload struct {
|
||||
|
||||
// Current password of user
|
||||
// Example: correct horse battery staple
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
// Min Length: 1
|
||||
CurrentPassword *string `json:"currentPassword"`
|
||||
}
|
||||
|
||||
// Validate validates this delete user account payload
|
||||
func (m *DeleteUserAccountPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateCurrentPassword(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *DeleteUserAccountPayload) validateCurrentPassword(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("currentPassword", "body", m.CurrentPassword); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("currentPassword", "body", *m.CurrentPassword, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("currentPassword", "body", *m.CurrentPassword, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this delete user account payload based on context it is used
|
||||
func (m *DeleteUserAccountPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *DeleteUserAccountPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *DeleteUserAccountPayload) UnmarshalBinary(b []byte) error {
|
||||
var res DeleteUserAccountPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
162
internal/types/get_user_info_response.go
Normal file
162
internal/types/get_user_info_response.go
Normal file
@@ -0,0 +1,162 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// GetUserInfoResponse get user info response
|
||||
//
|
||||
// swagger:model getUserInfoResponse
|
||||
type GetUserInfoResponse struct {
|
||||
|
||||
// Email address of user, if available
|
||||
// Example: user@example.com
|
||||
// Max Length: 255
|
||||
// Format: email
|
||||
Email strfmt.Email `json:"email,omitempty"`
|
||||
|
||||
// Auth-Scopes of the user, if available
|
||||
// Example: ["app"]
|
||||
Scopes []string `json:"scopes"`
|
||||
|
||||
// ID of user
|
||||
// Example: 82ebdfad-c586-4407-a873-4cc1c33d56fc
|
||||
// Required: true
|
||||
Sub *string `json:"sub"`
|
||||
|
||||
// Unix timestamp the user's info was last updated at
|
||||
// Example: 1591960808
|
||||
// Required: true
|
||||
UpdatedAt *int64 `json:"updated_at"`
|
||||
}
|
||||
|
||||
// Validate validates this get user info response
|
||||
func (m *GetUserInfoResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateEmail(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateScopes(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateSub(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUpdatedAt(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetUserInfoResponse) validateEmail(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Email) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("email", "body", m.Email.String(), 255); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("email", "body", "email", m.Email.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var getUserInfoResponseScopesItemsEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []string
|
||||
if err := json.Unmarshal([]byte(`["app","cms"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
getUserInfoResponseScopesItemsEnum = append(getUserInfoResponseScopesItemsEnum, v)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *GetUserInfoResponse) validateScopesItemsEnum(path, location string, value string) error {
|
||||
if err := validate.EnumCase(path, location, value, getUserInfoResponseScopesItemsEnum, true); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetUserInfoResponse) validateScopes(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.Scopes) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.Scopes); i++ {
|
||||
|
||||
// value enum
|
||||
if err := m.validateScopesItemsEnum("scopes"+"."+strconv.Itoa(i), "body", m.Scopes[i]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetUserInfoResponse) validateSub(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("sub", "body", m.Sub); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *GetUserInfoResponse) validateUpdatedAt(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this get user info response based on context it is used
|
||||
func (m *GetUserInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *GetUserInfoResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *GetUserInfoResponse) UnmarshalBinary(b []byte) error {
|
||||
var res GetUserInfoResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
105
internal/types/http_validation_error_detail.go
Normal file
105
internal/types/http_validation_error_detail.go
Normal file
@@ -0,0 +1,105 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// HTTPValidationErrorDetail http validation error detail
|
||||
//
|
||||
// swagger:model httpValidationErrorDetail
|
||||
type HTTPValidationErrorDetail struct {
|
||||
|
||||
// Error describing field validation failure
|
||||
// Required: true
|
||||
Error *string `json:"error"`
|
||||
|
||||
// Indicates how the invalid field was provided
|
||||
// Required: true
|
||||
In *string `json:"in"`
|
||||
|
||||
// Key of field failing validation
|
||||
// Required: true
|
||||
Key *string `json:"key"`
|
||||
}
|
||||
|
||||
// Validate validates this http validation error detail
|
||||
func (m *HTTPValidationErrorDetail) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateError(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateIn(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateKey(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *HTTPValidationErrorDetail) validateError(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("error", "body", m.Error); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *HTTPValidationErrorDetail) validateIn(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("in", "body", m.In); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *HTTPValidationErrorDetail) validateKey(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("key", "body", m.Key); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this http validation error detail based on context it is used
|
||||
func (m *HTTPValidationErrorDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *HTTPValidationErrorDetail) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *HTTPValidationErrorDetail) UnmarshalBinary(b []byte) error {
|
||||
var res HTTPValidationErrorDetail
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
78
internal/types/order_dir.go
Normal file
78
internal/types/order_dir.go
Normal file
@@ -0,0 +1,78 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// OrderDir order dir
|
||||
//
|
||||
// swagger:model orderDir
|
||||
type OrderDir string
|
||||
|
||||
func NewOrderDir(value OrderDir) *OrderDir {
|
||||
return &value
|
||||
}
|
||||
|
||||
// Pointer returns a pointer to a freshly-allocated OrderDir.
|
||||
func (m OrderDir) Pointer() *OrderDir {
|
||||
return &m
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
// OrderDirAsc captures enum value "asc"
|
||||
OrderDirAsc OrderDir = "asc"
|
||||
|
||||
// OrderDirDesc captures enum value "desc"
|
||||
OrderDirDesc OrderDir = "desc"
|
||||
)
|
||||
|
||||
// for schema
|
||||
var orderDirEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []OrderDir
|
||||
if err := json.Unmarshal([]byte(`["asc","desc"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
orderDirEnum = append(orderDirEnum, v)
|
||||
}
|
||||
}
|
||||
|
||||
func (m OrderDir) validateOrderDirEnum(path, location string, value OrderDir) error {
|
||||
if err := validate.EnumCase(path, location, value, orderDirEnum, true); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate validates this order dir
|
||||
func (m OrderDir) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
// value enum
|
||||
if err := m.validateOrderDirEnum("", "body", m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this order dir based on context it is used
|
||||
func (m OrderDir) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
110
internal/types/post_change_password_payload.go
Normal file
110
internal/types/post_change_password_payload.go
Normal file
@@ -0,0 +1,110 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostChangePasswordPayload post change password payload
|
||||
//
|
||||
// swagger:model postChangePasswordPayload
|
||||
type PostChangePasswordPayload struct {
|
||||
|
||||
// Current password of user
|
||||
// Example: correct horse battery staple
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
// Min Length: 1
|
||||
CurrentPassword *string `json:"currentPassword"`
|
||||
|
||||
// New password to set for user
|
||||
// Example: correct horse battery staple
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
// Min Length: 1
|
||||
NewPassword *string `json:"newPassword"`
|
||||
}
|
||||
|
||||
// Validate validates this post change password payload
|
||||
func (m *PostChangePasswordPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateCurrentPassword(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateNewPassword(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostChangePasswordPayload) validateCurrentPassword(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("currentPassword", "body", m.CurrentPassword); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("currentPassword", "body", *m.CurrentPassword, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("currentPassword", "body", *m.CurrentPassword, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostChangePasswordPayload) validateNewPassword(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("newPassword", "body", m.NewPassword); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("newPassword", "body", *m.NewPassword, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("newPassword", "body", *m.NewPassword, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post change password payload based on context it is used
|
||||
func (m *PostChangePasswordPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostChangePasswordPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostChangePasswordPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostChangePasswordPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
105
internal/types/post_forgot_password_complete_payload.go
Normal file
105
internal/types/post_forgot_password_complete_payload.go
Normal file
@@ -0,0 +1,105 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostForgotPasswordCompletePayload post forgot password complete payload
|
||||
//
|
||||
// swagger:model postForgotPasswordCompletePayload
|
||||
type PostForgotPasswordCompletePayload struct {
|
||||
|
||||
// New password to set for user
|
||||
// Example: correct horse battery staple
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
// Min Length: 1
|
||||
Password *string `json:"password"`
|
||||
|
||||
// Password reset token sent via email
|
||||
// Example: ec16f032-3c44-4148-bbcc-45557466fa74
|
||||
// Required: true
|
||||
// Format: uuid4
|
||||
Token *strfmt.UUID4 `json:"token"`
|
||||
}
|
||||
|
||||
// Validate validates this post forgot password complete payload
|
||||
func (m *PostForgotPasswordCompletePayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePassword(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostForgotPasswordCompletePayload) validatePassword(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("password", "body", m.Password); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("password", "body", *m.Password, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("password", "body", *m.Password, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostForgotPasswordCompletePayload) validateToken(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("token", "body", m.Token); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("token", "body", "uuid4", m.Token.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post forgot password complete payload based on context it is used
|
||||
func (m *PostForgotPasswordCompletePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostForgotPasswordCompletePayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostForgotPasswordCompletePayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostForgotPasswordCompletePayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
87
internal/types/post_forgot_password_payload.go
Normal file
87
internal/types/post_forgot_password_payload.go
Normal file
@@ -0,0 +1,87 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostForgotPasswordPayload post forgot password payload
|
||||
//
|
||||
// swagger:model postForgotPasswordPayload
|
||||
type PostForgotPasswordPayload struct {
|
||||
|
||||
// Username to initiate password reset for
|
||||
// Example: user@example.com
|
||||
// Required: true
|
||||
// Max Length: 255
|
||||
// Min Length: 1
|
||||
// Format: email
|
||||
Username *strfmt.Email `json:"username"`
|
||||
}
|
||||
|
||||
// Validate validates this post forgot password payload
|
||||
func (m *PostForgotPasswordPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateUsername(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostForgotPasswordPayload) validateUsername(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("username", "body", m.Username); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("username", "body", m.Username.String(), 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("username", "body", m.Username.String(), 255); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("username", "body", "email", m.Username.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post forgot password payload based on context it is used
|
||||
func (m *PostForgotPasswordPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostForgotPasswordPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostForgotPasswordPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostForgotPasswordPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
115
internal/types/post_login_payload.go
Normal file
115
internal/types/post_login_payload.go
Normal file
@@ -0,0 +1,115 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostLoginPayload post login payload
|
||||
//
|
||||
// swagger:model postLoginPayload
|
||||
type PostLoginPayload struct {
|
||||
|
||||
// Password of user to authenticate as
|
||||
// Example: correct horse battery staple
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
// Min Length: 1
|
||||
Password *string `json:"password"`
|
||||
|
||||
// Username of user to authenticate as
|
||||
// Example: user@example.com
|
||||
// Required: true
|
||||
// Max Length: 255
|
||||
// Min Length: 1
|
||||
// Format: email
|
||||
Username *strfmt.Email `json:"username"`
|
||||
}
|
||||
|
||||
// Validate validates this post login payload
|
||||
func (m *PostLoginPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePassword(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUsername(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLoginPayload) validatePassword(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("password", "body", m.Password); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("password", "body", *m.Password, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("password", "body", *m.Password, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLoginPayload) validateUsername(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("username", "body", m.Username); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("username", "body", m.Username.String(), 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("username", "body", m.Username.String(), 255); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("username", "body", "email", m.Username.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post login payload based on context it is used
|
||||
func (m *PostLoginPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostLoginPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostLoginPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostLoginPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
136
internal/types/post_login_response.go
Normal file
136
internal/types/post_login_response.go
Normal file
@@ -0,0 +1,136 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostLoginResponse post login response
|
||||
//
|
||||
// swagger:model postLoginResponse
|
||||
type PostLoginResponse struct {
|
||||
|
||||
// Access token required for accessing protected API endpoints
|
||||
// Example: c1247d8d-0d65-41c4-bc86-ec041d2ac437
|
||||
// Required: true
|
||||
// Format: uuid4
|
||||
AccessToken *strfmt.UUID4 `json:"access_token"`
|
||||
|
||||
// Access token expiry in seconds
|
||||
// Example: 86400
|
||||
// Required: true
|
||||
ExpiresIn *int64 `json:"expires_in"`
|
||||
|
||||
// Refresh token for refreshing the access token once it expires
|
||||
// Example: 1dadb3bd-50d8-485d-83a3-6111392568f0
|
||||
// Required: true
|
||||
// Format: uuid4
|
||||
RefreshToken *strfmt.UUID4 `json:"refresh_token"`
|
||||
|
||||
// Type of access token, will always be `bearer`
|
||||
// Example: bearer
|
||||
// Required: true
|
||||
TokenType *string `json:"token_type"`
|
||||
}
|
||||
|
||||
// Validate validates this post login response
|
||||
func (m *PostLoginResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateAccessToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateExpiresIn(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateRefreshToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTokenType(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLoginResponse) validateAccessToken(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("access_token", "body", m.AccessToken); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("access_token", "body", "uuid4", m.AccessToken.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLoginResponse) validateExpiresIn(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("expires_in", "body", m.ExpiresIn); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLoginResponse) validateRefreshToken(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("refresh_token", "body", m.RefreshToken); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("refresh_token", "body", "uuid4", m.RefreshToken.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLoginResponse) validateTokenType(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("token_type", "body", m.TokenType); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post login response based on context it is used
|
||||
func (m *PostLoginResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostLoginResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostLoginResponse) UnmarshalBinary(b []byte) error {
|
||||
var res PostLoginResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
75
internal/types/post_logout_payload.go
Normal file
75
internal/types/post_logout_payload.go
Normal file
@@ -0,0 +1,75 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostLogoutPayload post logout payload
|
||||
//
|
||||
// swagger:model postLogoutPayload
|
||||
type PostLogoutPayload struct {
|
||||
|
||||
// Optional refresh token to delete while logging out
|
||||
// Example: 700ebed3-40f7-4211-bc83-a89b22b9875e
|
||||
// Format: uuid4
|
||||
RefreshToken strfmt.UUID4 `json:"refresh_token,omitempty"`
|
||||
}
|
||||
|
||||
// Validate validates this post logout payload
|
||||
func (m *PostLogoutPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateRefreshToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostLogoutPayload) validateRefreshToken(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.RefreshToken) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("refresh_token", "body", "uuid4", m.RefreshToken.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post logout payload based on context it is used
|
||||
func (m *PostLogoutPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostLogoutPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostLogoutPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostLogoutPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
77
internal/types/post_refresh_payload.go
Normal file
77
internal/types/post_refresh_payload.go
Normal file
@@ -0,0 +1,77 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostRefreshPayload post refresh payload
|
||||
//
|
||||
// swagger:model postRefreshPayload
|
||||
type PostRefreshPayload struct {
|
||||
|
||||
// Refresh token to use for retrieving new token set
|
||||
// Example: 7503cd8a-c921-4368-a32d-6c1d01d86da9
|
||||
// Required: true
|
||||
// Format: uuid4
|
||||
RefreshToken *strfmt.UUID4 `json:"refresh_token"`
|
||||
}
|
||||
|
||||
// Validate validates this post refresh payload
|
||||
func (m *PostRefreshPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateRefreshToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostRefreshPayload) validateRefreshToken(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("refresh_token", "body", m.RefreshToken); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("refresh_token", "body", "uuid4", m.RefreshToken.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post refresh payload based on context it is used
|
||||
func (m *PostRefreshPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostRefreshPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostRefreshPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostRefreshPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
115
internal/types/post_register_payload.go
Normal file
115
internal/types/post_register_payload.go
Normal file
@@ -0,0 +1,115 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PostRegisterPayload post register payload
|
||||
//
|
||||
// swagger:model postRegisterPayload
|
||||
type PostRegisterPayload struct {
|
||||
|
||||
// Password to register with
|
||||
// Example: correct horse battery staple
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
// Min Length: 1
|
||||
Password *string `json:"password"`
|
||||
|
||||
// Username to register with
|
||||
// Example: user@example.com
|
||||
// Required: true
|
||||
// Max Length: 255
|
||||
// Min Length: 1
|
||||
// Format: email
|
||||
Username *strfmt.Email `json:"username"`
|
||||
}
|
||||
|
||||
// Validate validates this post register payload
|
||||
func (m *PostRegisterPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validatePassword(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateUsername(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostRegisterPayload) validatePassword(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("password", "body", m.Password); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("password", "body", *m.Password, 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("password", "body", *m.Password, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PostRegisterPayload) validateUsername(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("username", "body", m.Username); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinLength("username", "body", m.Username.String(), 1); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("username", "body", m.Username.String(), 255); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.FormatOf("username", "body", "email", m.Username.String(), formats); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this post register payload based on context it is used
|
||||
func (m *PostRegisterPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PostRegisterPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PostRegisterPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PostRegisterPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
161
internal/types/public_http_error.go
Normal file
161
internal/types/public_http_error.go
Normal file
@@ -0,0 +1,161 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PublicHTTPError public Http error
|
||||
//
|
||||
// swagger:model publicHttpError
|
||||
type PublicHTTPError struct {
|
||||
|
||||
// HTTP status code returned for the error
|
||||
// Example: 403
|
||||
// Required: true
|
||||
// Maximum: 599
|
||||
// Minimum: 100
|
||||
Code *int64 `json:"status"`
|
||||
|
||||
// More detailed, human-readable, optional explanation of the error
|
||||
// Example: User is lacking permission to access this resource
|
||||
Detail string `json:"detail,omitempty"`
|
||||
|
||||
// Short, human-readable description of the error
|
||||
// Example: Forbidden
|
||||
// Required: true
|
||||
Title *string `json:"title"`
|
||||
|
||||
// type
|
||||
// Required: true
|
||||
Type *PublicHTTPErrorType `json:"type"`
|
||||
}
|
||||
|
||||
// Validate validates this public Http error
|
||||
func (m *PublicHTTPError) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateCode(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateTitle(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateType(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicHTTPError) validateCode(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("status", "body", m.Code); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MinimumInt("status", "body", *m.Code, 100, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaximumInt("status", "body", *m.Code, 599, false); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicHTTPError) validateTitle(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("title", "body", m.Title); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicHTTPError) validateType(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("type", "body", m.Type); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.Required("type", "body", m.Type); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if m.Type != nil {
|
||||
if err := m.Type.Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("type")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("type")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this public Http error based on the context it is used
|
||||
func (m *PublicHTTPError) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.contextValidateType(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicHTTPError) contextValidateType(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
if m.Type != nil {
|
||||
if err := m.Type.ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("type")
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("type")
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PublicHTTPError) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PublicHTTPError) UnmarshalBinary(b []byte) error {
|
||||
var res PublicHTTPError
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
111
internal/types/public_http_error_type.go
Normal file
111
internal/types/public_http_error_type.go
Normal file
@@ -0,0 +1,111 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PublicHTTPErrorType Type of error returned, should be used for client-side error handling
|
||||
//
|
||||
// swagger:model publicHttpErrorType
|
||||
type PublicHTTPErrorType string
|
||||
|
||||
func NewPublicHTTPErrorType(value PublicHTTPErrorType) *PublicHTTPErrorType {
|
||||
return &value
|
||||
}
|
||||
|
||||
// Pointer returns a pointer to a freshly-allocated PublicHTTPErrorType.
|
||||
func (m PublicHTTPErrorType) Pointer() *PublicHTTPErrorType {
|
||||
return &m
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
// PublicHTTPErrorTypeGeneric captures enum value "generic"
|
||||
PublicHTTPErrorTypeGeneric PublicHTTPErrorType = "generic"
|
||||
|
||||
// PublicHTTPErrorTypePUSHTOKENALREADYEXISTS captures enum value "PUSH_TOKEN_ALREADY_EXISTS"
|
||||
PublicHTTPErrorTypePUSHTOKENALREADYEXISTS PublicHTTPErrorType = "PUSH_TOKEN_ALREADY_EXISTS"
|
||||
|
||||
// PublicHTTPErrorTypeOLDPUSHTOKENNOTFOUND captures enum value "OLD_PUSH_TOKEN_NOT_FOUND"
|
||||
PublicHTTPErrorTypeOLDPUSHTOKENNOTFOUND PublicHTTPErrorType = "OLD_PUSH_TOKEN_NOT_FOUND"
|
||||
|
||||
// PublicHTTPErrorTypeZEROFILESIZE captures enum value "ZERO_FILE_SIZE"
|
||||
PublicHTTPErrorTypeZEROFILESIZE PublicHTTPErrorType = "ZERO_FILE_SIZE"
|
||||
|
||||
// PublicHTTPErrorTypeUSERDEACTIVATED captures enum value "USER_DEACTIVATED"
|
||||
PublicHTTPErrorTypeUSERDEACTIVATED PublicHTTPErrorType = "USER_DEACTIVATED"
|
||||
|
||||
// PublicHTTPErrorTypeINVALIDPASSWORD captures enum value "INVALID_PASSWORD"
|
||||
PublicHTTPErrorTypeINVALIDPASSWORD PublicHTTPErrorType = "INVALID_PASSWORD"
|
||||
|
||||
// PublicHTTPErrorTypeNOTLOCALUSER captures enum value "NOT_LOCAL_USER"
|
||||
PublicHTTPErrorTypeNOTLOCALUSER PublicHTTPErrorType = "NOT_LOCAL_USER"
|
||||
|
||||
// PublicHTTPErrorTypeTOKENNOTFOUND captures enum value "TOKEN_NOT_FOUND"
|
||||
PublicHTTPErrorTypeTOKENNOTFOUND PublicHTTPErrorType = "TOKEN_NOT_FOUND"
|
||||
|
||||
// PublicHTTPErrorTypeTOKENEXPIRED captures enum value "TOKEN_EXPIRED"
|
||||
PublicHTTPErrorTypeTOKENEXPIRED PublicHTTPErrorType = "TOKEN_EXPIRED"
|
||||
|
||||
// PublicHTTPErrorTypeUSERALREADYEXISTS captures enum value "USER_ALREADY_EXISTS"
|
||||
PublicHTTPErrorTypeUSERALREADYEXISTS PublicHTTPErrorType = "USER_ALREADY_EXISTS"
|
||||
|
||||
// PublicHTTPErrorTypeMALFORMEDTOKEN captures enum value "MALFORMED_TOKEN"
|
||||
PublicHTTPErrorTypeMALFORMEDTOKEN PublicHTTPErrorType = "MALFORMED_TOKEN"
|
||||
|
||||
// PublicHTTPErrorTypeLASTAUTHENTICATEDATEXCEEDED captures enum value "LAST_AUTHENTICATED_AT_EXCEEDED"
|
||||
PublicHTTPErrorTypeLASTAUTHENTICATEDATEXCEEDED PublicHTTPErrorType = "LAST_AUTHENTICATED_AT_EXCEEDED"
|
||||
|
||||
// PublicHTTPErrorTypeMISSINGSCOPES captures enum value "MISSING_SCOPES"
|
||||
PublicHTTPErrorTypeMISSINGSCOPES PublicHTTPErrorType = "MISSING_SCOPES"
|
||||
)
|
||||
|
||||
// for schema
|
||||
var publicHttpErrorTypeEnum []interface{}
|
||||
|
||||
func init() {
|
||||
var res []PublicHTTPErrorType
|
||||
if err := json.Unmarshal([]byte(`["generic","PUSH_TOKEN_ALREADY_EXISTS","OLD_PUSH_TOKEN_NOT_FOUND","ZERO_FILE_SIZE","USER_DEACTIVATED","INVALID_PASSWORD","NOT_LOCAL_USER","TOKEN_NOT_FOUND","TOKEN_EXPIRED","USER_ALREADY_EXISTS","MALFORMED_TOKEN","LAST_AUTHENTICATED_AT_EXCEEDED","MISSING_SCOPES"]`), &res); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for _, v := range res {
|
||||
publicHttpErrorTypeEnum = append(publicHttpErrorTypeEnum, v)
|
||||
}
|
||||
}
|
||||
|
||||
func (m PublicHTTPErrorType) validatePublicHTTPErrorTypeEnum(path, location string, value PublicHTTPErrorType) error {
|
||||
if err := validate.EnumCase(path, location, value, publicHttpErrorTypeEnum, true); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Validate validates this public Http error type
|
||||
func (m PublicHTTPErrorType) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
// value enum
|
||||
if err := m.validatePublicHTTPErrorTypeEnum("", "body", m); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this public Http error type based on context it is used
|
||||
func (m PublicHTTPErrorType) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
175
internal/types/public_http_validation_error.go
Normal file
175
internal/types/public_http_validation_error.go
Normal file
@@ -0,0 +1,175 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PublicHTTPValidationError public Http validation error
|
||||
//
|
||||
// swagger:model publicHttpValidationError
|
||||
type PublicHTTPValidationError struct {
|
||||
PublicHTTPError
|
||||
|
||||
// List of errors received while validating payload against schema
|
||||
// Required: true
|
||||
ValidationErrors []*HTTPValidationErrorDetail `json:"validationErrors"`
|
||||
}
|
||||
|
||||
// UnmarshalJSON unmarshals this object from a JSON structure
|
||||
func (m *PublicHTTPValidationError) UnmarshalJSON(raw []byte) error {
|
||||
// AO0
|
||||
var aO0 PublicHTTPError
|
||||
if err := swag.ReadJSON(raw, &aO0); err != nil {
|
||||
return err
|
||||
}
|
||||
m.PublicHTTPError = aO0
|
||||
|
||||
// now for regular properties
|
||||
var propsPublicHTTPValidationError struct {
|
||||
ValidationErrors []*HTTPValidationErrorDetail `json:"validationErrors"`
|
||||
}
|
||||
if err := swag.ReadJSON(raw, &propsPublicHTTPValidationError); err != nil {
|
||||
return err
|
||||
}
|
||||
m.ValidationErrors = propsPublicHTTPValidationError.ValidationErrors
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON marshals this object to a JSON structure
|
||||
func (m PublicHTTPValidationError) MarshalJSON() ([]byte, error) {
|
||||
_parts := make([][]byte, 0, 1)
|
||||
|
||||
aO0, err := swag.WriteJSON(m.PublicHTTPError)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
_parts = append(_parts, aO0)
|
||||
|
||||
// now for regular properties
|
||||
var propsPublicHTTPValidationError struct {
|
||||
ValidationErrors []*HTTPValidationErrorDetail `json:"validationErrors"`
|
||||
}
|
||||
propsPublicHTTPValidationError.ValidationErrors = m.ValidationErrors
|
||||
|
||||
jsonDataPropsPublicHTTPValidationError, errPublicHTTPValidationError := swag.WriteJSON(propsPublicHTTPValidationError)
|
||||
if errPublicHTTPValidationError != nil {
|
||||
return nil, errPublicHTTPValidationError
|
||||
}
|
||||
_parts = append(_parts, jsonDataPropsPublicHTTPValidationError)
|
||||
return swag.ConcatJSON(_parts...), nil
|
||||
}
|
||||
|
||||
// Validate validates this public Http validation error
|
||||
func (m *PublicHTTPValidationError) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
// validation for a type composition with PublicHTTPError
|
||||
if err := m.PublicHTTPError.Validate(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateValidationErrors(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicHTTPValidationError) validateValidationErrors(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("validationErrors", "body", m.ValidationErrors); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for i := 0; i < len(m.ValidationErrors); i++ {
|
||||
if swag.IsZero(m.ValidationErrors[i]) { // not required
|
||||
continue
|
||||
}
|
||||
|
||||
if m.ValidationErrors[i] != nil {
|
||||
if err := m.ValidationErrors[i].Validate(formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("validationErrors" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("validationErrors" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validate this public Http validation error based on the context it is used
|
||||
func (m *PublicHTTPValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
// validation for a type composition with PublicHTTPError
|
||||
if err := m.PublicHTTPError.ContextValidate(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.contextValidateValidationErrors(ctx, formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PublicHTTPValidationError) contextValidateValidationErrors(ctx context.Context, formats strfmt.Registry) error {
|
||||
|
||||
for i := 0; i < len(m.ValidationErrors); i++ {
|
||||
|
||||
if m.ValidationErrors[i] != nil {
|
||||
if err := m.ValidationErrors[i].ContextValidate(ctx, formats); err != nil {
|
||||
if ve, ok := err.(*errors.Validation); ok {
|
||||
return ve.ValidateName("validationErrors" + "." + strconv.Itoa(i))
|
||||
} else if ce, ok := err.(*errors.CompositeError); ok {
|
||||
return ce.ValidateName("validationErrors" + "." + strconv.Itoa(i))
|
||||
}
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PublicHTTPValidationError) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PublicHTTPValidationError) UnmarshalBinary(b []byte) error {
|
||||
var res PublicHTTPValidationError
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package push
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewPutUpdatePushTokenRouteParams creates a new PutUpdatePushTokenRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewPutUpdatePushTokenRouteParams() PutUpdatePushTokenRouteParams {
|
||||
|
||||
return PutUpdatePushTokenRouteParams{}
|
||||
}
|
||||
|
||||
// PutUpdatePushTokenRouteParams contains all the bound params for the put update push token route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters PutUpdatePushTokenRoute
|
||||
type PutUpdatePushTokenRouteParams struct {
|
||||
|
||||
// HTTP Request Object
|
||||
HTTPRequest *http.Request `json:"-"`
|
||||
|
||||
/*
|
||||
In: body
|
||||
*/
|
||||
Payload *types.PutUpdatePushTokenPayload
|
||||
}
|
||||
|
||||
// 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 NewPutUpdatePushTokenRouteParams() beforehand.
|
||||
func (o *PutUpdatePushTokenRouteParams) 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.PutUpdatePushTokenPayload
|
||||
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 *PutUpdatePushTokenRouteParams) 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
|
||||
}
|
||||
121
internal/types/put_update_push_token_payload.go
Normal file
121
internal/types/put_update_push_token_payload.go
Normal file
@@ -0,0 +1,121 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// PutUpdatePushTokenPayload put update push token payload
|
||||
//
|
||||
// swagger:model putUpdatePushTokenPayload
|
||||
type PutUpdatePushTokenPayload struct {
|
||||
|
||||
// New push token for given provider.
|
||||
// Example: 1c91e550-8167-439c-8021-dee7de2f7e96
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
NewToken *string `json:"newToken"`
|
||||
|
||||
// Old token that can be deleted if present.
|
||||
// Example: 495179de-b771-48f0-aab2-8d23701b0f02
|
||||
// Max Length: 500
|
||||
OldToken *string `json:"oldToken,omitempty"`
|
||||
|
||||
// Identifier of the provider the token is for (eg. "fcm", "apn"). Currently only "fcm" is supported.
|
||||
// Example: fcm
|
||||
// Required: true
|
||||
// Max Length: 500
|
||||
Provider *string `json:"provider"`
|
||||
}
|
||||
|
||||
// Validate validates this put update push token payload
|
||||
func (m *PutUpdatePushTokenPayload) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateNewToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateOldToken(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if err := m.validateProvider(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PutUpdatePushTokenPayload) validateNewToken(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("newToken", "body", m.NewToken); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("newToken", "body", *m.NewToken, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PutUpdatePushTokenPayload) validateOldToken(formats strfmt.Registry) error {
|
||||
if swag.IsZero(m.OldToken) { // not required
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("oldToken", "body", *m.OldToken, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *PutUpdatePushTokenPayload) validateProvider(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("provider", "body", m.Provider); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := validate.MaxLength("provider", "body", *m.Provider, 500); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this put update push token payload based on context it is used
|
||||
func (m *PutUpdatePushTokenPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *PutUpdatePushTokenPayload) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *PutUpdatePushTokenPayload) UnmarshalBinary(b []byte) error {
|
||||
var res PutUpdatePushTokenPayload
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
72
internal/types/register_response.go
Normal file
72
internal/types/register_response.go
Normal file
@@ -0,0 +1,72 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
"github.com/go-openapi/strfmt"
|
||||
"github.com/go-openapi/swag"
|
||||
"github.com/go-openapi/validate"
|
||||
)
|
||||
|
||||
// RegisterResponse register response
|
||||
//
|
||||
// swagger:model registerResponse
|
||||
type RegisterResponse struct {
|
||||
|
||||
// Indicates whether the registration process requires email confirmation
|
||||
// Example: true
|
||||
// Required: true
|
||||
RequiresConfirmation *bool `json:"requiresConfirmation"`
|
||||
}
|
||||
|
||||
// Validate validates this register response
|
||||
func (m *RegisterResponse) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateRequiresConfirmation(formats); err != nil {
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *RegisterResponse) validateRequiresConfirmation(formats strfmt.Registry) error {
|
||||
|
||||
if err := validate.Required("requiresConfirmation", "body", m.RequiresConfirmation); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ContextValidate validates this register response based on context it is used
|
||||
func (m *RegisterResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalBinary interface implementation
|
||||
func (m *RegisterResponse) MarshalBinary() ([]byte, error) {
|
||||
if m == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return swag.WriteJSON(m)
|
||||
}
|
||||
|
||||
// UnmarshalBinary interface implementation
|
||||
func (m *RegisterResponse) UnmarshalBinary(b []byte) error {
|
||||
var res RegisterResponse
|
||||
if err := swag.ReadJSON(b, &res); err != nil {
|
||||
return err
|
||||
}
|
||||
*m = res
|
||||
return nil
|
||||
}
|
||||
57
internal/types/spec_handlers.go
Normal file
57
internal/types/spec_handlers.go
Normal file
@@ -0,0 +1,57 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
// NewSwaggerSpec creates a new SwaggerSpec instance
|
||||
func NewSwaggerSpec() *SwaggerSpec {
|
||||
|
||||
spec := &SwaggerSpec{
|
||||
Handlers: make(map[string]map[string]bool),
|
||||
}
|
||||
|
||||
if len(spec.Handlers) == 0 {
|
||||
spec.initHandlerCache()
|
||||
}
|
||||
|
||||
return spec
|
||||
}
|
||||
|
||||
/*SwaggerSpec API documentation */
|
||||
type SwaggerSpec struct {
|
||||
Handlers map[string]map[string]bool
|
||||
}
|
||||
|
||||
func (o *SwaggerSpec) initHandlerCache() {
|
||||
o.Handlers = make(map[string]map[string]bool)
|
||||
|
||||
// https://swagger.io/specification/v2/ fixed fields: GET, PUT, POST, DELETE, OPTIONS, HEAD, PATCH
|
||||
o.Handlers["GET"] = make(map[string]bool)
|
||||
o.Handlers["PUT"] = make(map[string]bool)
|
||||
o.Handlers["POST"] = make(map[string]bool)
|
||||
o.Handlers["DELETE"] = make(map[string]bool)
|
||||
o.Handlers["OPTIONS"] = make(map[string]bool)
|
||||
o.Handlers["HEAD"] = make(map[string]bool)
|
||||
o.Handlers["PATCH"] = make(map[string]bool)
|
||||
|
||||
o.Handlers["DELETE"]["/api/v1/auth/account"] = true
|
||||
o.Handlers["GET"]["/.well-known/assetlinks.json"] = true
|
||||
o.Handlers["GET"]["/.well-known/apple-app-site-association"] = true
|
||||
o.Handlers["GET"]["/api/v1/auth/register"] = true
|
||||
o.Handlers["GET"]["/-/healthy"] = true
|
||||
o.Handlers["GET"]["/-/ready"] = true
|
||||
o.Handlers["GET"]["/swagger.yml"] = true
|
||||
o.Handlers["GET"]["/api/v1/auth/userinfo"] = true
|
||||
o.Handlers["GET"]["/-/version"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/change-password"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/register/{registrationToken}"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/forgot-password/complete"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/forgot-password"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/login"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/logout"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/refresh"] = true
|
||||
o.Handlers["POST"]["/api/v1/auth/register"] = true
|
||||
o.Handlers["PUT"]["/api/v1/push/token"] = true
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package well_known
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAndroidDigitalAssetLinksRouteParams creates a new GetAndroidDigitalAssetLinksRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewGetAndroidDigitalAssetLinksRouteParams() GetAndroidDigitalAssetLinksRouteParams {
|
||||
|
||||
return GetAndroidDigitalAssetLinksRouteParams{}
|
||||
}
|
||||
|
||||
// GetAndroidDigitalAssetLinksRouteParams contains all the bound params for the get android digital asset links route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters GetAndroidDigitalAssetLinksRoute
|
||||
type GetAndroidDigitalAssetLinksRouteParams 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 NewGetAndroidDigitalAssetLinksRouteParams() beforehand.
|
||||
func (o *GetAndroidDigitalAssetLinksRouteParams) 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 *GetAndroidDigitalAssetLinksRouteParams) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Code generated by go-swagger; DO NOT EDIT.
|
||||
|
||||
package well_known
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// NewGetAppleAppSiteAssociationRouteParams creates a new GetAppleAppSiteAssociationRouteParams object
|
||||
// no default values defined in spec.
|
||||
func NewGetAppleAppSiteAssociationRouteParams() GetAppleAppSiteAssociationRouteParams {
|
||||
|
||||
return GetAppleAppSiteAssociationRouteParams{}
|
||||
}
|
||||
|
||||
// GetAppleAppSiteAssociationRouteParams contains all the bound params for the get apple app site association route operation
|
||||
// typically these are obtained from a http.Request
|
||||
//
|
||||
// swagger:parameters GetAppleAppSiteAssociationRoute
|
||||
type GetAppleAppSiteAssociationRouteParams 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 NewGetAppleAppSiteAssociationRouteParams() beforehand.
|
||||
func (o *GetAppleAppSiteAssociationRouteParams) 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 *GetAppleAppSiteAssociationRouteParams) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user