// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 DO NOT EDIT.
package api

import (
	"fmt"
	"net/http"
	"time"

	"github.com/gin-gonic/gin"
	"github.com/oapi-codegen/runtime"
	openapi_types "github.com/oapi-codegen/runtime/types"
)

// Defines values for CreatePersonAndRelationshipJSONBodyType.
const (
	CreatePersonAndRelationshipJSONBodyTypeChild   CreatePersonAndRelationshipJSONBodyType = "child"
	CreatePersonAndRelationshipJSONBodyTypeParent  CreatePersonAndRelationshipJSONBodyType = "parent"
	CreatePersonAndRelationshipJSONBodyTypeSibling CreatePersonAndRelationshipJSONBodyType = "sibling"
	CreatePersonAndRelationshipJSONBodyTypeSpouse  CreatePersonAndRelationshipJSONBodyType = "spouse"
)

// Defines values for CreateRelationshipJSONBodyType.
const (
	CreateRelationshipJSONBodyTypeChild   CreateRelationshipJSONBodyType = "child"
	CreateRelationshipJSONBodyTypeParent  CreateRelationshipJSONBodyType = "parent"
	CreateRelationshipJSONBodyTypeSibling CreateRelationshipJSONBodyType = "sibling"
	CreateRelationshipJSONBodyTypeSpouse  CreateRelationshipJSONBodyType = "spouse"
)

// Admin defines model for Admin.
type Admin struct {
	EndElementId *string `json:"EndElementId,omitempty"`
	EndId        *int    `json:"EndId,omitempty"`
	Id           *int    `json:"Id,omitempty"`
	Props        *struct {
		Added *int `json:"added,omitempty"`
	} `json:"Props,omitempty"`
	StartElementId *string `json:"StartElementId,omitempty"`
	StartId        *int    `json:"StartId,omitempty"`
	Type           *string `json:"Type,omitempty"`
}

// Comment defines model for Comment.
type Comment struct {
	End   *int     `json:"end"`
	Id    *int     `json:"id"`
	Label *string  `json:"label"`
	Props *Message `json:"props,omitempty"`
	Start *int     `json:"start"`
	Type  *string  `json:"type"`
}

// FamilyRelationship defines model for FamilyRelationship.
type FamilyRelationship struct {
	From     *openapi_types.Date `json:"from"`
	Notes    *string             `json:"notes"`
	To       *openapi_types.Date `json:"to"`
	Verified *bool               `json:"verified"`
}

// FamilyTree defines model for FamilyTree.
type FamilyTree struct {
	People        *[]OptimizedPersonNode `json:"people,omitempty"`
	Relationships *[]Relationship        `json:"relationships,omitempty"`
}

// Likes defines model for Likes.
type Likes struct {
	EndElementId   *string          `json:"EndElementId,omitempty"`
	EndId          *int             `json:"EndId,omitempty"`
	Id             *int             `json:"Id,omitempty"`
	Props          *LikesProperties `json:"Props,omitempty"`
	StartElementId *string          `json:"StartElementId,omitempty"`
	StartId        *int             `json:"StartId,omitempty"`
	Type           *string          `json:"Type,omitempty"`
}

// LikesProperties defines model for LikesProperties.
type LikesProperties struct {
	CouldMakeIt *bool `json:"could_make_it"`
	Favourite   *bool `json:"favourite"`
	LikeIt      *bool `json:"like_it"`
}

// Message defines model for Message.
type Message struct {
	Edited  *time.Time `json:"edited"`
	Message *string    `json:"message,omitempty"`
	SentAt  *time.Time `json:"sent_at,omitempty"`
}

// Messages defines model for Messages.
type Messages struct {
	Comments *[]Comment             `json:"comments,omitempty"`
	People   *[]OptimizedPersonNode `json:"people,omitempty"`
}

// OptimizedPersonNode defines model for OptimizedPersonNode.
type OptimizedPersonNode struct {
	Born           *openapi_types.Date `json:"born,omitempty"`
	Died           *openapi_types.Date `json:"died"`
	FirstName      *string             `json:"first_name,omitempty"`
	Id             *int                `json:"id,omitempty"`
	Labels         *[]string           `json:"labels,omitempty"`
	LastName       *string             `json:"last_name,omitempty"`
	MiddleName     *string             `json:"middle_name,omitempty"`
	ProfilePicture *string             `json:"profile_picture"`
	Type           *string             `json:"type"`
}

// Person defines model for Person.
type Person struct {
	ElementId *string           `json:"ElementId,omitempty"`
	Id        *int              `json:"Id,omitempty"`
	Labels    *[]string         `json:"Labels,omitempty"`
	Props     *PersonProperties `json:"Props,omitempty"`
}

// PersonProperties defines model for PersonProperties.
type PersonProperties struct {
	Aliases   *[]string `json:"aliases"`
	Allergies *[]string `json:"allergies"`
	Audios    *[]struct {
		Date        *openapi_types.Date `json:"date,omitempty"`
		Description *string             `json:"description,omitempty"`
		Name        *string             `json:"name,omitempty"`
		Url         *string             `json:"url,omitempty"`
	} `json:"audios"`
	Baptized   *string             `json:"baptized"`
	BloodType  *string             `json:"blood_type"`
	Born       *openapi_types.Date `json:"born"`
	Died       *openapi_types.Date `json:"died"`
	Email      *string             `json:"email"`
	ExtraNames *[]string           `json:"extra_names"`
	EyeColour  *string             `json:"eye_colour"`
	FirstName  *string             `json:"first_name"`
	GoogleId   *string             `json:"google_id"`
	HairColour *string             `json:"hair_colour"`
	Height     *float32            `json:"height"`
	Hobbies    *[]string           `json:"hobbies"`
	Ideologies *[]string           `json:"ideologies"`
	Interests  *[]string           `json:"interests"`
	InviteCode *string             `json:"invite_code"`
	Languages  *[]struct {
		Language *string `json:"language,omitempty"`
		Level    *string `json:"level"`
	} `json:"languages"`
	LastName   *string `json:"last_name"`
	LifeEvents *[]struct {
		Description *string             `json:"description,omitempty"`
		From        *openapi_types.Date `json:"from,omitempty"`
		To          *openapi_types.Date `json:"to,omitempty"`
	} `json:"life_events"`
	Limit             *int                      `json:"limit"`
	MedicalConditions *[]map[string]interface{} `json:"medical_conditions"`
	Medications       *[]struct {
		Components  *string             `json:"components"`
		Description *string             `json:"description"`
		Dosage      *string             `json:"dosage"`
		From        *openapi_types.Date `json:"from"`
		Name        *string             `json:"name,omitempty"`
		To          *openapi_types.Date `json:"to"`
	} `json:"medications"`
	MiddleName       *string `json:"middle_name"`
	MothersFirstName *string `json:"mothers_first_name"`
	MothersLastName  *string `json:"mothers_last_name"`
	Notes            *[]struct {
		Date  *openapi_types.Date `json:"date"`
		Note  *string             `json:"note,omitempty"`
		Title *string             `json:"title"`
		Url   *string             `json:"url"`
	} `json:"notes"`
	OccupationToDisplay *string   `json:"occupation_to_display"`
	Occupations         *[]string `json:"occupations"`
	Phone               *string   `json:"phone"`
	Photos              *[]struct {
		Date        *openapi_types.Date `json:"date,omitempty"`
		Description *string             `json:"description,omitempty"`
		Name        *string             `json:"name,omitempty"`
		Url         *string             `json:"url,omitempty"`
	} `json:"photos"`
	PlaceOfBirth   *string `json:"place_of_birth"`
	PlaceOfDeath   *string `json:"place_of_death"`
	ProfilePicture *string `json:"profile_picture"`
	Religion       *string `json:"religion"`
	Residence      *struct {
		AddressLine1 *string `json:"address_line_1,omitempty"`
		AddressLine2 *string `json:"address_line_2,omitempty"`
		City         *string `json:"city,omitempty"`
		Country      *string `json:"country,omitempty"`
		ZipCode      *string `json:"zip_code,omitempty"`
	} `json:"residence"`
	SkinColour *string   `json:"skin_colour"`
	Sports     *[]string `json:"sports"`
	Suffixes   *[]string `json:"suffixes"`
	Titles     *[]string `json:"titles"`
	Verified   *bool     `json:"verified"`
	Videos     *[]struct {
		Date        *openapi_types.Date `json:"date,omitempty"`
		Description *string             `json:"description,omitempty"`
		Name        *string             `json:"name,omitempty"`
		Url         *string             `json:"url,omitempty"`
	} `json:"videos"`
	Weight *float32 `json:"weight"`
}

// PersonRegistration defines model for PersonRegistration.
type PersonRegistration struct {
	Born             openapi_types.Date   `json:"born"`
	Email            *openapi_types.Email `json:"email"`
	FirstName        string               `json:"first_name"`
	LastName         string               `json:"last_name"`
	Limit            int                  `json:"limit"`
	MothersFirstName string               `json:"mothers_first_name"`
	MothersLastName  string               `json:"mothers_last_name"`
}

// Recipe defines model for Recipe.
type Recipe struct {
	ElementId *string           `json:"ElementId,omitempty"`
	Id        *int              `json:"Id,omitempty"`
	Labels    *[]string         `json:"Labels,omitempty"`
	Props     *RecipeProperties `json:"Props,omitempty"`
}

// RecipeProperties defines model for RecipeProperties.
type RecipeProperties struct {
	AllowAdminAccess *[]struct {
		Id   *int    `json:"id,omitempty"`
		Name *string `json:"name,omitempty"`
	} `json:"allow_admin_access,omitempty"`
	Category      *string             `json:"category"`
	Description   *string             `json:"description"`
	FirstRecorded *openapi_types.Date `json:"first_recorded"`
	Ingredients   *[]string           `json:"ingredients"`
	Instructions  *[]string           `json:"instructions"`
	Name          *string             `json:"name"`
	Notes         *string             `json:"notes"`
	Origin        *string             `json:"origin"`
	OthersSaid    *[]struct {
		Id   *int    `json:"id,omitempty"`
		Name *string `json:"name,omitempty"`
		Said *string `json:"said,omitempty"`
	} `json:"others_said"`
	Photo *string `json:"photo"`
}

// Relationship defines model for Relationship.
type Relationship struct {
	End        *int                `json:"end,omitempty"`
	Id         *int                `json:"id,omitempty"`
	Label      *string             `json:"label"`
	Properties *FamilyRelationship `json:"properties,omitempty"`
	Start      *int                `json:"start,omitempty"`
	Type       *string             `json:"type"`
}

// DbtypeRelationship defines model for dbtypeRelationship.
type DbtypeRelationship struct {
	ElementId      *string             `json:"ElementId,omitempty"`
	EndElementId   *string             `json:"EndElementId,omitempty"`
	EndId          *int                `json:"EndId,omitempty"`
	Id             *int                `json:"Id,omitempty"`
	Props          *FamilyRelationship `json:"Props,omitempty"`
	StartElementId *string             `json:"StartElementId,omitempty"`
	StartId        *int                `json:"StartId,omitempty"`
	Type           *string             `json:"Type"`
}

// GetProfileAdminsParams defines parameters for GetProfileAdmins.
type GetProfileAdminsParams struct {
	XUserID int `json:"X-User-ID"`
}

// DeleteAdminRelationshipParams defines parameters for DeleteAdminRelationship.
type DeleteAdminRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetAdminRelationshipParams defines parameters for GetAdminRelationship.
type GetAdminRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreateAdminRelationshipParams defines parameters for CreateAdminRelationship.
type CreateAdminRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// DeleteCommentOnPersonParams defines parameters for DeleteCommentOnPerson.
type DeleteCommentOnPersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetCommentsOnPersonParams defines parameters for GetCommentsOnPerson.
type GetCommentsOnPersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// EditCommentParams defines parameters for EditComment.
type EditCommentParams struct {
	XUserID int `json:"X-User-ID"`
}

// CommentOnPersonParams defines parameters for CommentOnPerson.
type CommentOnPersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetFamilyTreeByIdParams defines parameters for GetFamilyTreeById.
type GetFamilyTreeByIdParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetFamilyTreeWithSpousesByIdParams defines parameters for GetFamilyTreeWithSpousesById.
type GetFamilyTreeWithSpousesByIdParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetManagedProfilesParams defines parameters for GetManagedProfiles.
type GetManagedProfilesParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreatePersonParams defines parameters for CreatePerson.
type CreatePersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreatePersonByGoogleIdAndInviteCodeJSONBody defines parameters for CreatePersonByGoogleIdAndInviteCode.
type CreatePersonByGoogleIdAndInviteCodeJSONBody struct {
	InviteCode string             `json:"invite_code"`
	Person     PersonRegistration `json:"person"`
}

// SoftDeletePersonParams defines parameters for SoftDeletePerson.
type SoftDeletePersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetPersonByIdParams defines parameters for GetPersonById.
type GetPersonByIdParams struct {
	XUserID int `json:"X-User-ID"`
}

// UpdatePersonParams defines parameters for UpdatePerson.
type UpdatePersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// HardDeletePersonParams defines parameters for HardDeletePerson.
type HardDeletePersonParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetRecipesByPersonIdParams defines parameters for GetRecipesByPersonId.
type GetRecipesByPersonIdParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreatePersonAndRelationshipJSONBody defines parameters for CreatePersonAndRelationship.
type CreatePersonAndRelationshipJSONBody struct {
	Person       PersonRegistration                       `json:"person"`
	Relationship FamilyRelationship                       `json:"relationship"`
	Type         *CreatePersonAndRelationshipJSONBodyType `json:"type,omitempty"`
}

// CreatePersonAndRelationshipParams defines parameters for CreatePersonAndRelationship.
type CreatePersonAndRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreatePersonAndRelationshipJSONBodyType defines parameters for CreatePersonAndRelationship.
type CreatePersonAndRelationshipJSONBodyType string

// SoftDeleteRecipeParams defines parameters for SoftDeleteRecipe.
type SoftDeleteRecipeParams struct {
	XUserID int `json:"X-User-ID"`
}

// UpdateRecipeParams defines parameters for UpdateRecipe.
type UpdateRecipeParams struct {
	XUserID int `json:"X-User-ID"`
}

// HardDeleteRecipeParams defines parameters for HardDeleteRecipe.
type HardDeleteRecipeParams struct {
	XUserID int `json:"X-User-ID"`
}

// DeleteRecipeRelationshipParams defines parameters for DeleteRecipeRelationship.
type DeleteRecipeRelationshipParams struct {
	PersonId int `form:"personId" json:"personId"`
	XUserID  int `json:"X-User-ID"`
}

// CreateRecipeRelationshipJSONBody defines parameters for CreateRecipeRelationship.
type CreateRecipeRelationshipJSONBody struct {
	Id           int `json:"id"`
	Relationship struct {
		Schema *LikesProperties `json:"schema,omitempty"`
	} `json:"relationship"`
}

// CreateRecipeRelationshipParams defines parameters for CreateRecipeRelationship.
type CreateRecipeRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreateRelationshipJSONBody defines parameters for CreateRelationship.
type CreateRelationshipJSONBody struct {
	Id1          *int                            `json:"id1,omitempty"`
	Id2          *int                            `json:"id2,omitempty"`
	Relationship *FamilyRelationship             `json:"relationship,omitempty"`
	Type         *CreateRelationshipJSONBodyType `json:"type,omitempty"`
}

// CreateRelationshipParams defines parameters for CreateRelationship.
type CreateRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// CreateRelationshipJSONBodyType defines parameters for CreateRelationship.
type CreateRelationshipJSONBodyType string

// DeleteRelationshipParams defines parameters for DeleteRelationship.
type DeleteRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetRelationshipParams defines parameters for GetRelationship.
type GetRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// UpdateRelationshipJSONBody defines parameters for UpdateRelationship.
type UpdateRelationshipJSONBody struct {
	Relationship *FamilyRelationship `json:"relationship,omitempty"`
}

// UpdateRelationshipParams defines parameters for UpdateRelationship.
type UpdateRelationshipParams struct {
	XUserID int `json:"X-User-ID"`
}

// GetCommentsOnPersonJSONRequestBody defines body for GetCommentsOnPerson for application/json ContentType.
type GetCommentsOnPersonJSONRequestBody = Message

// EditCommentJSONRequestBody defines body for EditComment for application/json ContentType.
type EditCommentJSONRequestBody = Message

// CommentOnPersonJSONRequestBody defines body for CommentOnPerson for application/json ContentType.
type CommentOnPersonJSONRequestBody = Message

// CreatePersonJSONRequestBody defines body for CreatePerson for application/json ContentType.
type CreatePersonJSONRequestBody = PersonRegistration

// CreatePersonByGoogleIdAndInviteCodeJSONRequestBody defines body for CreatePersonByGoogleIdAndInviteCode for application/json ContentType.
type CreatePersonByGoogleIdAndInviteCodeJSONRequestBody CreatePersonByGoogleIdAndInviteCodeJSONBody

// CreatePersonByGoogleIdJSONRequestBody defines body for CreatePersonByGoogleId for application/json ContentType.
type CreatePersonByGoogleIdJSONRequestBody = PersonRegistration

// UpdatePersonJSONRequestBody defines body for UpdatePerson for application/json ContentType.
type UpdatePersonJSONRequestBody = PersonProperties

// CreatePersonAndRelationshipJSONRequestBody defines body for CreatePersonAndRelationship for application/json ContentType.
type CreatePersonAndRelationshipJSONRequestBody CreatePersonAndRelationshipJSONBody

// UpdateRecipeJSONRequestBody defines body for UpdateRecipe for application/json ContentType.
type UpdateRecipeJSONRequestBody = RecipeProperties

// CreateRecipeRelationshipJSONRequestBody defines body for CreateRecipeRelationship for application/json ContentType.
type CreateRecipeRelationshipJSONRequestBody CreateRecipeRelationshipJSONBody

// CreateRelationshipJSONRequestBody defines body for CreateRelationship for application/json ContentType.
type CreateRelationshipJSONRequestBody CreateRelationshipJSONBody

// UpdateRelationshipJSONRequestBody defines body for UpdateRelationship for application/json ContentType.
type UpdateRelationshipJSONRequestBody UpdateRelationshipJSONBody

// ServerInterface represents all server handlers.
type ServerInterface interface {
	// Get profile Admins
	// (GET /admin/{id1})
	GetProfileAdmins(c *gin.Context, id1 int, params GetProfileAdminsParams)
	// Delete admin relationship between two persons
	// (DELETE /admin/{id1}/{id2})
	DeleteAdminRelationship(c *gin.Context, id1 int, id2 int, params DeleteAdminRelationshipParams)
	// Get admin relationship between two persons
	// (GET /admin/{id1}/{id2})
	GetAdminRelationship(c *gin.Context, id1 int, id2 int, params GetAdminRelationshipParams)
	// Create admin relationship between two persons
	// (POST /admin/{id1}/{id2})
	CreateAdminRelationship(c *gin.Context, id1 int, id2 int, params CreateAdminRelationshipParams)
	// Comment on person's profile by ID
	// (DELETE /comment/{id})
	DeleteCommentOnPerson(c *gin.Context, id int, params DeleteCommentOnPersonParams)
	// Get comments on person's profile by ID
	// (GET /comment/{id})
	GetCommentsOnPerson(c *gin.Context, id int, params GetCommentsOnPersonParams)
	// Edit comment on person's profile by ID
	// (PATCH /comment/{id})
	EditComment(c *gin.Context, id int, params EditCommentParams)
	// Comment on person's profile by ID
	// (POST /comment/{id})
	CommentOnPerson(c *gin.Context, id int, params CommentOnPersonParams)
	// Get family tree by person ID
	// (GET /family-tree)
	GetFamilyTreeById(c *gin.Context, params GetFamilyTreeByIdParams)
	// Get family tree by person ID with spouses included
	// (GET /family-tree-with-spouses)
	GetFamilyTreeWithSpousesById(c *gin.Context, params GetFamilyTreeWithSpousesByIdParams)
	// Check the health of the server
	// (GET /health)
	HealthCheck(c *gin.Context)
	// Get managed profiles
	// (GET /managed_profiles)
	GetManagedProfiles(c *gin.Context, params GetManagedProfilesParams)
	// Create a new person
	// (POST /person)
	CreatePerson(c *gin.Context, params CreatePersonParams)
	// Get a person by Google ID
	// (GET /person/google/{google_id})
	GetPersonByGoogleId(c *gin.Context, googleId string)
	// Create a new person by Google ID with invite code
	// (PATCH /person/google/{google_id})
	CreatePersonByGoogleIdAndInviteCode(c *gin.Context, googleId string)
	// Create a new person by Google ID
	// (POST /person/google/{google_id})
	CreatePersonByGoogleId(c *gin.Context, googleId string)
	// Soft delete a person by ID
	// (DELETE /person/{id})
	SoftDeletePerson(c *gin.Context, id int, params SoftDeletePersonParams)
	// Get a person by ID
	// (GET /person/{id})
	GetPersonById(c *gin.Context, id int, params GetPersonByIdParams)
	// Update a person by ID
	// (PATCH /person/{id})
	UpdatePerson(c *gin.Context, id int, params UpdatePersonParams)
	// Hard delete a person by ID
	// (DELETE /person/{id}/hard-delete)
	HardDeletePerson(c *gin.Context, id int, params HardDeletePersonParams)
	// Get recipes by person ID
	// (GET /person/{id}/recipes)
	GetRecipesByPersonId(c *gin.Context, id int, params GetRecipesByPersonIdParams)
	// Create a person and relationship
	// (POST /person_and_relationship/{id})
	CreatePersonAndRelationship(c *gin.Context, id int, params CreatePersonAndRelationshipParams)
	// Soft delete a recipe by ID
	// (DELETE /recipe/{id})
	SoftDeleteRecipe(c *gin.Context, id int, params SoftDeleteRecipeParams)
	// Update a recipe by ID
	// (PATCH /recipe/{id})
	UpdateRecipe(c *gin.Context, id int, params UpdateRecipeParams)
	// Hard delete a recipe by ID
	// (DELETE /recipe/{id}/hard-delete)
	HardDeleteRecipe(c *gin.Context, id int, params HardDeleteRecipeParams)
	// Delete a relationship with a recipe
	// (DELETE /recipe/{id}/relationship)
	DeleteRecipeRelationship(c *gin.Context, id int, params DeleteRecipeRelationshipParams)
	// Create a relationship with an existing recipe
	// (POST /recipe/{id}/relationship)
	CreateRecipeRelationship(c *gin.Context, id int, params CreateRecipeRelationshipParams)
	// Create a relationship between two persons
	// (POST /relationship)
	CreateRelationship(c *gin.Context, params CreateRelationshipParams)
	// Delete relationship between two persons
	// (DELETE /relationship/{id1}/{id2})
	DeleteRelationship(c *gin.Context, id1 int, id2 int, params DeleteRelationshipParams)
	// Get relationships between two persons
	// (GET /relationship/{id1}/{id2})
	GetRelationship(c *gin.Context, id1 int, id2 int, params GetRelationshipParams)
	// Update a relationship between two persons
	// (PATCH /relationship/{id1}/{id2})
	UpdateRelationship(c *gin.Context, id1 int, id2 int, params UpdateRelationshipParams)
}

// ServerInterfaceWrapper converts contexts to parameters.
type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandler       func(*gin.Context, error, int)
}

type MiddlewareFunc func(c *gin.Context)

// GetProfileAdmins operation middleware
func (siw *ServerInterfaceWrapper) GetProfileAdmins(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params GetProfileAdminsParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetProfileAdmins(c, id1, params)
}

// DeleteAdminRelationship operation middleware
func (siw *ServerInterfaceWrapper) DeleteAdminRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// ------------- Path parameter "id2" -------------
	var id2 int

	err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params DeleteAdminRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.DeleteAdminRelationship(c, id1, id2, params)
}

// GetAdminRelationship operation middleware
func (siw *ServerInterfaceWrapper) GetAdminRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// ------------- Path parameter "id2" -------------
	var id2 int

	err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params GetAdminRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetAdminRelationship(c, id1, id2, params)
}

// CreateAdminRelationship operation middleware
func (siw *ServerInterfaceWrapper) CreateAdminRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// ------------- Path parameter "id2" -------------
	var id2 int

	err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params CreateAdminRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreateAdminRelationship(c, id1, id2, params)
}

// DeleteCommentOnPerson operation middleware
func (siw *ServerInterfaceWrapper) DeleteCommentOnPerson(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params DeleteCommentOnPersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.DeleteCommentOnPerson(c, id, params)
}

// GetCommentsOnPerson operation middleware
func (siw *ServerInterfaceWrapper) GetCommentsOnPerson(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params GetCommentsOnPersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetCommentsOnPerson(c, id, params)
}

// EditComment operation middleware
func (siw *ServerInterfaceWrapper) EditComment(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params EditCommentParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.EditComment(c, id, params)
}

// CommentOnPerson operation middleware
func (siw *ServerInterfaceWrapper) CommentOnPerson(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params CommentOnPersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CommentOnPerson(c, id, params)
}

// GetFamilyTreeById operation middleware
func (siw *ServerInterfaceWrapper) GetFamilyTreeById(c *gin.Context) {

	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params GetFamilyTreeByIdParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetFamilyTreeById(c, params)
}

// GetFamilyTreeWithSpousesById operation middleware
func (siw *ServerInterfaceWrapper) GetFamilyTreeWithSpousesById(c *gin.Context) {

	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params GetFamilyTreeWithSpousesByIdParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetFamilyTreeWithSpousesById(c, params)
}

// HealthCheck operation middleware
func (siw *ServerInterfaceWrapper) HealthCheck(c *gin.Context) {

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.HealthCheck(c)
}

// GetManagedProfiles operation middleware
func (siw *ServerInterfaceWrapper) GetManagedProfiles(c *gin.Context) {

	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params GetManagedProfilesParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetManagedProfiles(c, params)
}

// CreatePerson operation middleware
func (siw *ServerInterfaceWrapper) CreatePerson(c *gin.Context) {

	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params CreatePersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreatePerson(c, params)
}

// GetPersonByGoogleId operation middleware
func (siw *ServerInterfaceWrapper) GetPersonByGoogleId(c *gin.Context) {

	var err error

	// ------------- Path parameter "google_id" -------------
	var googleId string

	err = runtime.BindStyledParameterWithOptions("simple", "google_id", c.Param("google_id"), &googleId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter google_id: %w", err), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetPersonByGoogleId(c, googleId)
}

// CreatePersonByGoogleIdAndInviteCode operation middleware
func (siw *ServerInterfaceWrapper) CreatePersonByGoogleIdAndInviteCode(c *gin.Context) {

	var err error

	// ------------- Path parameter "google_id" -------------
	var googleId string

	err = runtime.BindStyledParameterWithOptions("simple", "google_id", c.Param("google_id"), &googleId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter google_id: %w", err), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreatePersonByGoogleIdAndInviteCode(c, googleId)
}

// CreatePersonByGoogleId operation middleware
func (siw *ServerInterfaceWrapper) CreatePersonByGoogleId(c *gin.Context) {

	var err error

	// ------------- Path parameter "google_id" -------------
	var googleId string

	err = runtime.BindStyledParameterWithOptions("simple", "google_id", c.Param("google_id"), &googleId, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter google_id: %w", err), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreatePersonByGoogleId(c, googleId)
}

// SoftDeletePerson operation middleware
func (siw *ServerInterfaceWrapper) SoftDeletePerson(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params SoftDeletePersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.SoftDeletePerson(c, id, params)
}

// GetPersonById operation middleware
func (siw *ServerInterfaceWrapper) GetPersonById(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params GetPersonByIdParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetPersonById(c, id, params)
}

// UpdatePerson operation middleware
func (siw *ServerInterfaceWrapper) UpdatePerson(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params UpdatePersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.UpdatePerson(c, id, params)
}

// HardDeletePerson operation middleware
func (siw *ServerInterfaceWrapper) HardDeletePerson(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params HardDeletePersonParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.HardDeletePerson(c, id, params)
}

// GetRecipesByPersonId operation middleware
func (siw *ServerInterfaceWrapper) GetRecipesByPersonId(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params GetRecipesByPersonIdParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetRecipesByPersonId(c, id, params)
}

// CreatePersonAndRelationship operation middleware
func (siw *ServerInterfaceWrapper) CreatePersonAndRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params CreatePersonAndRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreatePersonAndRelationship(c, id, params)
}

// SoftDeleteRecipe operation middleware
func (siw *ServerInterfaceWrapper) SoftDeleteRecipe(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params SoftDeleteRecipeParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.SoftDeleteRecipe(c, id, params)
}

// UpdateRecipe operation middleware
func (siw *ServerInterfaceWrapper) UpdateRecipe(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params UpdateRecipeParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.UpdateRecipe(c, id, params)
}

// HardDeleteRecipe operation middleware
func (siw *ServerInterfaceWrapper) HardDeleteRecipe(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params HardDeleteRecipeParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.HardDeleteRecipe(c, id, params)
}

// DeleteRecipeRelationship operation middleware
func (siw *ServerInterfaceWrapper) DeleteRecipeRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params DeleteRecipeRelationshipParams

	// ------------- Required query parameter "personId" -------------

	if paramValue := c.Query("personId"); paramValue != "" {

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Query argument personId is required, but not found"), http.StatusBadRequest)
		return
	}

	err = runtime.BindQueryParameter("form", true, true, "personId", c.Request.URL.Query(), &params.PersonId)
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter personId: %w", err), http.StatusBadRequest)
		return
	}

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.DeleteRecipeRelationship(c, id, params)
}

// CreateRecipeRelationship operation middleware
func (siw *ServerInterfaceWrapper) CreateRecipeRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id" -------------
	var id int

	err = runtime.BindStyledParameterWithOptions("simple", "id", c.Param("id"), &id, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params CreateRecipeRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreateRecipeRelationship(c, id, params)
}

// CreateRelationship operation middleware
func (siw *ServerInterfaceWrapper) CreateRelationship(c *gin.Context) {

	var err error

	// Parameter object where we will unmarshal all parameters from the context
	var params CreateRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.CreateRelationship(c, params)
}

// DeleteRelationship operation middleware
func (siw *ServerInterfaceWrapper) DeleteRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// ------------- Path parameter "id2" -------------
	var id2 int

	err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params DeleteRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.DeleteRelationship(c, id1, id2, params)
}

// GetRelationship operation middleware
func (siw *ServerInterfaceWrapper) GetRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// ------------- Path parameter "id2" -------------
	var id2 int

	err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params GetRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.GetRelationship(c, id1, id2, params)
}

// UpdateRelationship operation middleware
func (siw *ServerInterfaceWrapper) UpdateRelationship(c *gin.Context) {

	var err error

	// ------------- Path parameter "id1" -------------
	var id1 int

	err = runtime.BindStyledParameterWithOptions("simple", "id1", c.Param("id1"), &id1, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id1: %w", err), http.StatusBadRequest)
		return
	}

	// ------------- Path parameter "id2" -------------
	var id2 int

	err = runtime.BindStyledParameterWithOptions("simple", "id2", c.Param("id2"), &id2, runtime.BindStyledParameterOptions{Explode: false, Required: true})
	if err != nil {
		siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter id2: %w", err), http.StatusBadRequest)
		return
	}

	// Parameter object where we will unmarshal all parameters from the context
	var params UpdateRelationshipParams

	headers := c.Request.Header

	// ------------- Required header parameter "X-User-ID" -------------
	if valueList, found := headers[http.CanonicalHeaderKey("X-User-ID")]; found {
		var XUserID int
		n := len(valueList)
		if n != 1 {
			siw.ErrorHandler(c, fmt.Errorf("Expected one value for X-User-ID, got %d", n), http.StatusBadRequest)
			return
		}

		err = runtime.BindStyledParameterWithOptions("simple", "X-User-ID", valueList[0], &XUserID, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: true})
		if err != nil {
			siw.ErrorHandler(c, fmt.Errorf("Invalid format for parameter X-User-ID: %w", err), http.StatusBadRequest)
			return
		}

		params.XUserID = XUserID

	} else {
		siw.ErrorHandler(c, fmt.Errorf("Header parameter X-User-ID is required, but not found"), http.StatusBadRequest)
		return
	}

	for _, middleware := range siw.HandlerMiddlewares {
		middleware(c)
		if c.IsAborted() {
			return
		}
	}

	siw.Handler.UpdateRelationship(c, id1, id2, params)
}

// GinServerOptions provides options for the Gin server.
type GinServerOptions struct {
	BaseURL      string
	Middlewares  []MiddlewareFunc
	ErrorHandler func(*gin.Context, error, int)
}

// RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlers(router gin.IRouter, si ServerInterface) {
	RegisterHandlersWithOptions(router, si, GinServerOptions{})
}

// RegisterHandlersWithOptions creates http.Handler with additional options
func RegisterHandlersWithOptions(router gin.IRouter, si ServerInterface, options GinServerOptions) {
	errorHandler := options.ErrorHandler
	if errorHandler == nil {
		errorHandler = func(c *gin.Context, err error, statusCode int) {
			c.JSON(statusCode, gin.H{"msg": err.Error()})
		}
	}

	wrapper := ServerInterfaceWrapper{
		Handler:            si,
		HandlerMiddlewares: options.Middlewares,
		ErrorHandler:       errorHandler,
	}

	router.GET(options.BaseURL+"/admin/:id1", wrapper.GetProfileAdmins)
	router.DELETE(options.BaseURL+"/admin/:id1/:id2", wrapper.DeleteAdminRelationship)
	router.GET(options.BaseURL+"/admin/:id1/:id2", wrapper.GetAdminRelationship)
	router.POST(options.BaseURL+"/admin/:id1/:id2", wrapper.CreateAdminRelationship)
	router.DELETE(options.BaseURL+"/comment/:id", wrapper.DeleteCommentOnPerson)
	router.GET(options.BaseURL+"/comment/:id", wrapper.GetCommentsOnPerson)
	router.PATCH(options.BaseURL+"/comment/:id", wrapper.EditComment)
	router.POST(options.BaseURL+"/comment/:id", wrapper.CommentOnPerson)
	router.GET(options.BaseURL+"/family-tree", wrapper.GetFamilyTreeById)
	router.GET(options.BaseURL+"/family-tree-with-spouses", wrapper.GetFamilyTreeWithSpousesById)
	router.GET(options.BaseURL+"/health", wrapper.HealthCheck)
	router.GET(options.BaseURL+"/managed_profiles", wrapper.GetManagedProfiles)
	router.POST(options.BaseURL+"/person", wrapper.CreatePerson)
	router.GET(options.BaseURL+"/person/google/:google_id", wrapper.GetPersonByGoogleId)
	router.PATCH(options.BaseURL+"/person/google/:google_id", wrapper.CreatePersonByGoogleIdAndInviteCode)
	router.POST(options.BaseURL+"/person/google/:google_id", wrapper.CreatePersonByGoogleId)
	router.DELETE(options.BaseURL+"/person/:id", wrapper.SoftDeletePerson)
	router.GET(options.BaseURL+"/person/:id", wrapper.GetPersonById)
	router.PATCH(options.BaseURL+"/person/:id", wrapper.UpdatePerson)
	router.DELETE(options.BaseURL+"/person/:id/hard-delete", wrapper.HardDeletePerson)
	router.GET(options.BaseURL+"/person/:id/recipes", wrapper.GetRecipesByPersonId)
	router.POST(options.BaseURL+"/person_and_relationship/:id", wrapper.CreatePersonAndRelationship)
	router.DELETE(options.BaseURL+"/recipe/:id", wrapper.SoftDeleteRecipe)
	router.PATCH(options.BaseURL+"/recipe/:id", wrapper.UpdateRecipe)
	router.DELETE(options.BaseURL+"/recipe/:id/hard-delete", wrapper.HardDeleteRecipe)
	router.DELETE(options.BaseURL+"/recipe/:id/relationship", wrapper.DeleteRecipeRelationship)
	router.POST(options.BaseURL+"/recipe/:id/relationship", wrapper.CreateRecipeRelationship)
	router.POST(options.BaseURL+"/relationship", wrapper.CreateRelationship)
	router.DELETE(options.BaseURL+"/relationship/:id1/:id2", wrapper.DeleteRelationship)
	router.GET(options.BaseURL+"/relationship/:id1/:id2", wrapper.GetRelationship)
	router.PATCH(options.BaseURL+"/relationship/:id1/:id2", wrapper.UpdateRelationship)
}
