// Package client 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 client

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"strings"
	"time"

	"github.com/oapi-codegen/runtime"
)

const (
	XPubAuthScopes = "XPubAuth.Scopes"
)

// Defines values for ModelsAnnotatedTransactionOutlineFormat.
const (
	ModelsAnnotatedTransactionOutlineFormatBEEF ModelsAnnotatedTransactionOutlineFormat = "BEEF"
	ModelsAnnotatedTransactionOutlineFormatRAW  ModelsAnnotatedTransactionOutlineFormat = "RAW"
)

// Defines values for ModelsDataAnnotationBucket.
const (
	Data ModelsDataAnnotationBucket = "data"
)

// Defines values for ModelsOperationTxStatus.
const (
	BROADCASTED ModelsOperationTxStatus = "BROADCASTED"
	CREATED     ModelsOperationTxStatus = "CREATED"
	MINED       ModelsOperationTxStatus = "MINED"
	PROBLEMATIC ModelsOperationTxStatus = "PROBLEMATIC"
	REVERTED    ModelsOperationTxStatus = "REVERTED"
)

// Defines values for ModelsOperationType.
const (
	Incoming ModelsOperationType = "incoming"
	Outgoing ModelsOperationType = "outgoing"
)

// Defines values for ModelsOutputAnnotationBucket.
const (
	ModelsOutputAnnotationBucketBsv ModelsOutputAnnotationBucket = "bsv"
)

// Defines values for ModelsPaymailAnnotationBucket.
const (
	ModelsPaymailAnnotationBucketBsv ModelsPaymailAnnotationBucket = "bsv"
)

// Defines values for ModelsTransactionHexFormat.
const (
	ModelsTransactionHexFormatBEEF ModelsTransactionHexFormat = "BEEF"
	ModelsTransactionHexFormatRAW  ModelsTransactionHexFormat = "RAW"
)

// Defines values for RequestsOpReturnOutputSpecificationDataType.
const (
	Hexes   RequestsOpReturnOutputSpecificationDataType = "hexes"
	Strings RequestsOpReturnOutputSpecificationDataType = "strings"
)

// Defines values for RequestsOpReturnOutputSpecificationType.
const (
	OpReturn RequestsOpReturnOutputSpecificationType = "op_return"
)

// Defines values for RequestsPaymailOutputSpecificationType.
const (
	Paymail RequestsPaymailOutputSpecificationType = "paymail"
)

// Defines values for RequestsTransactionOutlineFormat.
const (
	BEEF RequestsTransactionOutlineFormat = "BEEF"
	RAW  RequestsTransactionOutlineFormat = "RAW"
)

// Defines values for CreateTransactionOutlineParamsFormat.
const (
	Beef CreateTransactionOutlineParamsFormat = "beef"
	Raw  CreateTransactionOutlineParamsFormat = "raw"
)

// ErrorsAdminAuthOnNonAdminEndpoint defines model for errors_AdminAuthOnNonAdminEndpoint.
type ErrorsAdminAuthOnNonAdminEndpoint struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsAdminAuthorization defines model for errors_AdminAuthorization.
type ErrorsAdminAuthorization struct {
	union json.RawMessage
}

// ErrorsAnnotationIndexConversion defines model for errors_AnnotationIndexConversion.
type ErrorsAnnotationIndexConversion struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsAnnotationIndexOutOfRange defines model for errors_AnnotationIndexOutOfRange.
type ErrorsAnnotationIndexOutOfRange struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsAnyAuthorization defines model for errors_AnyAuthorization.
type ErrorsAnyAuthorization struct {
	union json.RawMessage
}

// ErrorsAuthXPubRequired defines model for errors_AuthXPubRequired.
type ErrorsAuthXPubRequired struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSBadRequest defines model for errors_BHSBadRequest.
type ErrorsBHSBadRequest struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSBadURL defines model for errors_BHSBadURL.
type ErrorsBHSBadURL struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSNoSuccessResponse defines model for errors_BHSNoSuccessResponse.
type ErrorsBHSNoSuccessResponse struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSParsingResponse defines model for errors_BHSParsingResponse.
type ErrorsBHSParsingResponse struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSUnauthorized defines model for errors_BHSUnauthorized.
type ErrorsBHSUnauthorized struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSUnhealthy defines model for errors_BHSUnhealthy.
type ErrorsBHSUnhealthy struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsBHSUnreachable defines model for errors_BHSUnreachable.
type ErrorsBHSUnreachable struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsCannotBindRequest defines model for errors_CannotBindRequest.
type ErrorsCannotBindRequest struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsCreatingUser defines model for errors_CreatingUser.
type ErrorsCreatingUser struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsDataNotFound defines model for errors_DataNotFound.
type ErrorsDataNotFound struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsGettingOutputs defines model for errors_GettingOutputs.
type ErrorsGettingOutputs struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsGettingUser defines model for errors_GettingUser.
type ErrorsGettingUser struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInternal defines model for errors_Internal.
type ErrorsInternal struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInvalidAvatarURL defines model for errors_InvalidAvatarURL.
type ErrorsInvalidAvatarURL struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInvalidBatchSize defines model for errors_InvalidBatchSize.
type ErrorsInvalidBatchSize struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInvalidDataID defines model for errors_InvalidDataID.
type ErrorsInvalidDataID struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInvalidDomain defines model for errors_InvalidDomain.
type ErrorsInvalidDomain struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInvalidPaymail defines model for errors_InvalidPaymail.
type ErrorsInvalidPaymail struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsInvalidPubKey defines model for errors_InvalidPubKey.
type ErrorsInvalidPubKey struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsMerkleRootNotFound defines model for errors_MerkleRootNotFound.
type ErrorsMerkleRootNotFound struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsMerkleRootNotInLongestChain defines model for errors_MerkleRootNotInLongestChain.
type ErrorsMerkleRootNotInLongestChain struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsNoOperations defines model for errors_NoOperations.
type ErrorsNoOperations struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsPaymailInconsistent defines model for errors_PaymailInconsistent.
type ErrorsPaymailInconsistent struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsSchema defines model for errors_Schema.
type ErrorsSchema struct {
	// Code Error code
	Code string `json:"code"`

	// Message Error message
	Message string `json:"message"`
}

// ErrorsTxBroadcast defines model for errors_TxBroadcast.
type ErrorsTxBroadcast struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxOutlineUserHasNotEnoughFunds defines model for errors_TxOutlineUserHasNotEnoughFunds.
type ErrorsTxOutlineUserHasNotEnoughFunds struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxSpecFailedToDecodeHex defines model for errors_TxSpecFailedToDecodeHex.
type ErrorsTxSpecFailedToDecodeHex struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxSpecInvalidPaymailReceiver defines model for errors_TxSpecInvalidPaymailReceiver.
type ErrorsTxSpecInvalidPaymailReceiver struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxSpecInvalidPaymailSender defines model for errors_TxSpecInvalidPaymailSender.
type ErrorsTxSpecInvalidPaymailSender struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxSpecNoDefaultPaymailAddress defines model for errors_TxSpecNoDefaultPaymailAddress.
type ErrorsTxSpecNoDefaultPaymailAddress struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxSpecOpReturnDataRequired defines model for errors_TxSpecOpReturnDataRequired.
type ErrorsTxSpecOpReturnDataRequired struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsTxSpecOutputsRequired defines model for errors_TxSpecOutputsRequired.
type ErrorsTxSpecOutputsRequired struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsUTXOSpent defines model for errors_UTXOSpent.
type ErrorsUTXOSpent struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsUnauthorized defines model for errors_Unauthorized.
type ErrorsUnauthorized struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsUserAuthOnNonUserEndpoint defines model for errors_UserAuthOnNonUserEndpoint.
type ErrorsUserAuthOnNonUserEndpoint struct {
	Code    interface{} `json:"code"`
	Message interface{} `json:"message"`
}

// ErrorsUserAuthorization defines model for errors_UserAuthorization.
type ErrorsUserAuthorization struct {
	union json.RawMessage
}

// ModelsAnnotatedTransactionOutline defines model for models_AnnotatedTransactionOutline.
type ModelsAnnotatedTransactionOutline struct {
	Annotations *ModelsOutlineAnnotations `json:"annotations,omitempty"`

	// Format Transaction format
	Format ModelsAnnotatedTransactionOutlineFormat `json:"format"`

	// Hex Transaction hex
	Hex string `json:"hex"`
}

// ModelsAnnotatedTransactionOutlineFormat Transaction format
type ModelsAnnotatedTransactionOutlineFormat string

// ModelsBucketAnnotation defines model for models_BucketAnnotation.
type ModelsBucketAnnotation struct {
	// Bucket Type of bucket where this output should be stored.
	Bucket string `json:"bucket"`
}

// ModelsChangeAnnotation defines model for models_ChangeAnnotation.
type ModelsChangeAnnotation struct {
	CustomInstructions *ModelsSPVWalletCustomInstructions `json:"customInstructions,omitempty"`
}

// ModelsCustomInstructions defines model for models_CustomInstructions.
type ModelsCustomInstructions struct {
	union json.RawMessage
}

// ModelsData defines model for models_Data.
type ModelsData struct {
	// Blob Data blob
	Blob string `json:"blob"`

	// Id User ID
	Id string `json:"id"`
}

// ModelsDataAnnotation defines model for models_DataAnnotation.
type ModelsDataAnnotation struct {
	Bucket ModelsDataAnnotationBucket `json:"bucket"`
}

// ModelsDataAnnotationBucket defines model for ModelsDataAnnotation.Bucket.
type ModelsDataAnnotationBucket string

// ModelsExclusiveStartKeySearchPage defines model for models_ExclusiveStartKeySearchPage.
type ModelsExclusiveStartKeySearchPage struct {
	// LastEvaluatedKey Last evaluated key
	LastEvaluatedKey string `json:"lastEvaluatedKey"`

	// Size Number of items in returned data
	Size int `json:"size"`

	// TotalElements Total number of items
	TotalElements int `json:"totalElements"`
}

// ModelsGetMerkleRootResult defines model for models_GetMerkleRootResult.
type ModelsGetMerkleRootResult struct {
	Content []ModelsMerkleRoot                `json:"content"`
	Page    ModelsExclusiveStartKeySearchPage `json:"page"`
}

// ModelsInputAnnotation defines model for models_InputAnnotation.
type ModelsInputAnnotation struct {
	CustomInstructions ModelsCustomInstructions `json:"customInstructions"`
}

// ModelsInputsAnnotations defines model for models_InputsAnnotations.
type ModelsInputsAnnotations struct {
	// Inputs Map of input annotations
	Inputs map[string]ModelsInputAnnotation `json:"inputs"`
}

// ModelsMerkleRoot defines model for models_MerkleRoot.
type ModelsMerkleRoot struct {
	// BlockHeight Block height
	BlockHeight int `json:"blockHeight"`

	// MerkleRoot Transaction ID
	MerkleRoot string `json:"merkleRoot"`
}

// ModelsOperation defines model for models_Operation.
type ModelsOperation struct {
	// BlockHash Block hash of underlying transaction
	BlockHash *string `json:"blockHash,omitempty"`

	// BlockHeight Block height of underlying transaction
	BlockHeight *int64 `json:"blockHeight,omitempty"`

	// Counterparty Counterparty of operation
	Counterparty string `json:"counterparty"`

	// CreatedAt Creation date of operation
	CreatedAt time.Time `json:"createdAt"`

	// TxID Transaction ID
	TxID string `json:"txID"`

	// TxStatus Status of transaction
	TxStatus ModelsOperationTxStatus `json:"txStatus"`

	// Type Type of operation
	Type ModelsOperationType `json:"type"`

	// Value Value of operation
	Value int64 `json:"value"`
}

// ModelsOperationTxStatus Status of transaction
type ModelsOperationTxStatus string

// ModelsOperationType Type of operation
type ModelsOperationType string

// ModelsOperationsSearchResult defines model for models_OperationsSearchResult.
type ModelsOperationsSearchResult struct {
	Content []ModelsOperation `json:"content"`
	Page    ModelsSearchPage  `json:"page"`
}

// ModelsOutlineAnnotations defines model for models_OutlineAnnotations.
type ModelsOutlineAnnotations struct {
	// Inputs Map of input annotations
	Inputs map[string]ModelsInputAnnotation `json:"inputs"`

	// Outputs Map of output annotations
	Outputs map[string]ModelsOutputAnnotation `json:"outputs"`
}

// ModelsOutputAnnotation defines model for models_OutputAnnotation.
type ModelsOutputAnnotation struct {
	Bucket             ModelsOutputAnnotationBucket       `json:"bucket"`
	CustomInstructions *ModelsSPVWalletCustomInstructions `json:"customInstructions,omitempty"`
	Paymail            *ModelsPaymailAnnotationDetails    `json:"paymail,omitempty"`
}

// ModelsOutputAnnotationBucket defines model for ModelsOutputAnnotation.Bucket.
type ModelsOutputAnnotationBucket string

// ModelsOutputsAnnotations defines model for models_OutputsAnnotations.
type ModelsOutputsAnnotations struct {
	// Outputs Map of output annotations
	Outputs map[string]ModelsOutputAnnotation `json:"outputs"`
}

// ModelsPaymail defines model for models_Paymail.
type ModelsPaymail struct {
	Alias      string `json:"alias"`
	Avatar     string `json:"avatar"`
	Domain     string `json:"domain"`
	Id         uint   `json:"id"`
	Paymail    string `json:"paymail"`
	PublicName string `json:"publicName"`
}

// ModelsPaymailAnnotation defines model for models_PaymailAnnotation.
type ModelsPaymailAnnotation struct {
	Bucket  *ModelsPaymailAnnotationBucket  `json:"bucket,omitempty"`
	Paymail *ModelsPaymailAnnotationDetails `json:"paymail,omitempty"`
}

// ModelsPaymailAnnotationBucket defines model for ModelsPaymailAnnotation.Bucket.
type ModelsPaymailAnnotationBucket string

// ModelsPaymailAnnotationDetails defines model for models_PaymailAnnotationDetails.
type ModelsPaymailAnnotationDetails struct {
	// Receiver Paymail address of the receiver
	Receiver string `json:"receiver"`

	// Reference Reference number used for paymail transaction
	Reference string `json:"reference"`

	// Sender Paymail address of the sender
	Sender string `json:"sender"`
}

// ModelsRecordedOutline defines model for models_RecordedOutline.
type ModelsRecordedOutline struct {
	// TxID ID of the transaction
	TxID string `json:"txID"`
}

// ModelsSPVWalletCustomInstruction defines model for models_SPVWalletCustomInstruction.
type ModelsSPVWalletCustomInstruction struct {
	// Instruction Custom instruction
	Instruction string `json:"instruction"`

	// Type Type of custom instructions
	Type string `json:"type"`
}

// ModelsSPVWalletCustomInstructions defines model for models_SPVWalletCustomInstructions.
type ModelsSPVWalletCustomInstructions = []ModelsSPVWalletCustomInstruction

// ModelsSearchPage defines model for models_SearchPage.
type ModelsSearchPage struct {
	// Number Page number for pagination
	Number int `json:"number"`

	// Size Number of items per page
	Size int `json:"size"`

	// TotalElements Total number of items
	TotalElements int `json:"totalElements"`

	// TotalPages Total number of pages
	TotalPages int `json:"totalPages"`
}

// ModelsSharedConfig Shared config
type ModelsSharedConfig struct {
	ExperimentalFeatures map[string]bool `json:"experimentalFeatures"`
	PaymailDomains       []string        `json:"paymailDomains"`
}

// ModelsTransactionHex defines model for models_TransactionHex.
type ModelsTransactionHex struct {
	// Format Transaction format
	Format ModelsTransactionHexFormat `json:"format"`

	// Hex Transaction hex
	Hex string `json:"hex"`
}

// ModelsTransactionHexFormat Transaction format
type ModelsTransactionHexFormat string

// ModelsUser defines model for models_User.
type ModelsUser struct {
	CreatedAt time.Time       `json:"createdAt"`
	Id        string          `json:"id"`
	Paymails  []ModelsPaymail `json:"paymails"`
	PublicKey string          `json:"publicKey"`
	UpdatedAt time.Time       `json:"updatedAt"`
}

// ModelsUserDefinedCustomInstructions Instructions about how to unlock this input.
type ModelsUserDefinedCustomInstructions = string

// ModelsUserInfo defines model for models_UserInfo.
type ModelsUserInfo struct {
	// CurrentBalance Current balance of user
	CurrentBalance uint64 `json:"currentBalance"`
}

// RequestsAddPaymail defines model for requests_AddPaymail.
type RequestsAddPaymail struct {
	Address   string  `json:"address"`
	Alias     string  `json:"alias"`
	AvatarURL *string `json:"avatarURL,omitempty"`
	Domain    string  `json:"domain"`

	// PublicName If not provided will default to the same value as alias
	PublicName *string `json:"publicName,omitempty"`
}

// RequestsCreateUser defines model for requests_CreateUser.
type RequestsCreateUser struct {
	Paymail   *RequestsAddPaymail `json:"paymail,omitempty"`
	PublicKey string              `json:"publicKey"`
}

// RequestsOpReturnHexesOutput defines model for requests_OpReturnHexesOutput.
type RequestsOpReturnHexesOutput = []string

// RequestsOpReturnOutputSpecification defines model for requests_OpReturnOutputSpecification.
type RequestsOpReturnOutputSpecification struct {
	Data     RequestsOpReturnOutputSpecification_Data     `json:"data"`
	DataType *RequestsOpReturnOutputSpecificationDataType `json:"dataType,omitempty"`
	Type     RequestsOpReturnOutputSpecificationType      `json:"type"`
}

// RequestsOpReturnOutputSpecification_Data defines model for RequestsOpReturnOutputSpecification.Data.
type RequestsOpReturnOutputSpecification_Data struct {
	union json.RawMessage
}

// RequestsOpReturnOutputSpecificationDataType defines model for RequestsOpReturnOutputSpecification.DataType.
type RequestsOpReturnOutputSpecificationDataType string

// RequestsOpReturnOutputSpecificationType defines model for RequestsOpReturnOutputSpecification.Type.
type RequestsOpReturnOutputSpecificationType string

// RequestsOpReturnStringsOutput defines model for requests_OpReturnStringsOutput.
type RequestsOpReturnStringsOutput = []string

// RequestsPaymailOutputSpecification defines model for requests_PaymailOutputSpecification.
type RequestsPaymailOutputSpecification struct {
	From     *string `json:"from"`
	Satoshis uint64  `json:"satoshis"`

	// Splits The number of outputs to be created from the satoshis. <br>
	// Warning: The satoshis must be evenly divisible by the number of splits. <br>
	// Warning: If the recipient responds with more than one output, the number of splits must be 1.
	Splits *uint64                                `json:"splits,omitempty"`
	To     string                                 `json:"to"`
	Type   RequestsPaymailOutputSpecificationType `json:"type"`
}

// RequestsPaymailOutputSpecificationType defines model for RequestsPaymailOutputSpecification.Type.
type RequestsPaymailOutputSpecificationType string

// RequestsTransactionOutline defines model for requests_TransactionOutline.
type RequestsTransactionOutline struct {
	Annotations *ModelsOutputsAnnotations `json:"annotations,omitempty"`

	// Format Transaction format
	Format RequestsTransactionOutlineFormat `json:"format"`

	// Hex Transaction hex
	Hex string `json:"hex"`
}

// RequestsTransactionOutlineFormat Transaction format
type RequestsTransactionOutlineFormat string

// RequestsTransactionOutlineOutputSpecification defines model for requests_TransactionOutlineOutputSpecification.
type RequestsTransactionOutlineOutputSpecification struct {
	union json.RawMessage
}

// RequestsTransactionSpecification defines model for requests_TransactionSpecification.
type RequestsTransactionSpecification struct {
	Outputs []RequestsTransactionOutlineOutputSpecification `json:"outputs"`
}

// RequestsPageNumber defines model for requests_PageNumber.
type RequestsPageNumber = int

// RequestsPageSize defines model for requests_PageSize.
type RequestsPageSize = int

// RequestsSort defines model for requests_Sort.
type RequestsSort = string

// RequestsSortBy defines model for requests_SortBy.
type RequestsSortBy = string

// ResponsesAdminAddPaymailSuccess defines model for responses_AdminAddPaymailSuccess.
type ResponsesAdminAddPaymailSuccess = ModelsPaymail

// ResponsesAdminCreateUserInternalServerError defines model for responses_AdminCreateUserInternalServerError.
type ResponsesAdminCreateUserInternalServerError = ErrorsCreatingUser

// ResponsesAdminCreateUserSuccess defines model for responses_AdminCreateUserSuccess.
type ResponsesAdminCreateUserSuccess = ModelsUser

// ResponsesAdminGetUser defines model for responses_AdminGetUser.
type ResponsesAdminGetUser = ModelsUser

// ResponsesAdminGetUserInternalServerError defines model for responses_AdminGetUserInternalServerError.
type ResponsesAdminGetUserInternalServerError = ErrorsGettingUser

// ResponsesAdminInvalidAvatarURL defines model for responses_AdminInvalidAvatarURL.
type ResponsesAdminInvalidAvatarURL struct {
	union json.RawMessage
}

// ResponsesAdminUserBadRequest defines model for responses_AdminUserBadRequest.
type ResponsesAdminUserBadRequest struct {
	union json.RawMessage
}

// ResponsesCreateTransactionOutlineBadRequest defines model for responses_CreateTransactionOutlineBadRequest.
type ResponsesCreateTransactionOutlineBadRequest struct {
	union json.RawMessage
}

// ResponsesCreateTransactionOutlineSuccess defines model for responses_CreateTransactionOutlineSuccess.
type ResponsesCreateTransactionOutlineSuccess = ModelsAnnotatedTransactionOutline

// ResponsesCreateTransactionOutlineUnprocessable defines model for responses_CreateTransactionOutlineUnprocessable.
type ResponsesCreateTransactionOutlineUnprocessable struct {
	union json.RawMessage
}

// ResponsesGetCurrentUserSuccess defines model for responses_GetCurrentUserSuccess.
type ResponsesGetCurrentUserSuccess = ModelsUserInfo

// ResponsesGetDataNotFound defines model for responses_GetDataNotFound.
type ResponsesGetDataNotFound struct {
	union json.RawMessage
}

// ResponsesGetDataSuccess defines model for responses_GetDataSuccess.
type ResponsesGetDataSuccess = ModelsData

// ResponsesGetMerklerootsBadRequest defines model for responses_GetMerklerootsBadRequest.
type ResponsesGetMerklerootsBadRequest = ErrorsInvalidBatchSize

// ResponsesGetMerklerootsConflict defines model for responses_GetMerklerootsConflict.
type ResponsesGetMerklerootsConflict = ErrorsMerkleRootNotInLongestChain

// ResponsesGetMerklerootsInternalServerError defines model for responses_GetMerklerootsInternalServerError.
type ResponsesGetMerklerootsInternalServerError struct {
	union json.RawMessage
}

// ResponsesGetMerklerootsNotFound defines model for responses_GetMerklerootsNotFound.
type ResponsesGetMerklerootsNotFound = ErrorsMerkleRootNotFound

// ResponsesGetMerklerootsSuccess defines model for responses_GetMerklerootsSuccess.
type ResponsesGetMerklerootsSuccess = ModelsGetMerkleRootResult

// ResponsesInternalServerError defines model for responses_InternalServerError.
type ResponsesInternalServerError = ErrorsInternal

// ResponsesNotAuthorized defines model for responses_NotAuthorized.
type ResponsesNotAuthorized = ErrorsAnyAuthorization

// ResponsesNotAuthorizedToAdminEndpoint defines model for responses_NotAuthorizedToAdminEndpoint.
type ResponsesNotAuthorizedToAdminEndpoint = ErrorsAdminAuthorization

// ResponsesRecordTransactionBadRequest defines model for responses_RecordTransactionBadRequest.
type ResponsesRecordTransactionBadRequest struct {
	union json.RawMessage
}

// ResponsesRecordTransactionInternalServerError defines model for responses_RecordTransactionInternalServerError.
type ResponsesRecordTransactionInternalServerError struct {
	union json.RawMessage
}

// ResponsesRecordTransactionSuccess defines model for responses_RecordTransactionSuccess.
type ResponsesRecordTransactionSuccess = ModelsRecordedOutline

// ResponsesSearchBadRequest defines model for responses_SearchBadRequest.
type ResponsesSearchBadRequest = ErrorsInvalidDataID

// ResponsesSearchOperationsSuccess defines model for responses_SearchOperationsSuccess.
type ResponsesSearchOperationsSuccess = ModelsOperationsSearchResult

// ResponsesSharedConfig Shared config
type ResponsesSharedConfig = ModelsSharedConfig

// ResponsesUserBadRequest defines model for responses_UserBadRequest.
type ResponsesUserBadRequest = ErrorsInvalidDataID

// ResponsesUserNotAuthorized defines model for responses_UserNotAuthorized.
type ResponsesUserNotAuthorized = ErrorsUserAuthorization

// MerkleRootsParams defines parameters for MerkleRoots.
type MerkleRootsParams struct {
	// BatchSize Batch size of merkleroots to be returned
	BatchSize *int `form:"batchSize,omitempty" json:"batchSize,omitempty"`

	// LastEvaluatedKey Last processed merkleroot in client's database
	LastEvaluatedKey *string `form:"lastEvaluatedKey,omitempty" json:"lastEvaluatedKey,omitempty"`
}

// SearchOperationsParams defines parameters for SearchOperations.
type SearchOperationsParams struct {
	// Page Page number for pagination
	Page *RequestsPageNumber `form:"page,omitempty" json:"page,omitempty"`

	// Size Number of items per page
	Size *RequestsPageSize `form:"size,omitempty" json:"size,omitempty"`

	// Sort Sorting order (asc or desc)
	Sort *RequestsSort `form:"sort,omitempty" json:"sort,omitempty"`

	// SortBy Field to sort by
	SortBy *RequestsSortBy `form:"sortBy,omitempty" json:"sortBy,omitempty"`
}

// CreateTransactionOutlineParams defines parameters for CreateTransactionOutline.
type CreateTransactionOutlineParams struct {
	// Format Required format of transaction hex
	Format *CreateTransactionOutlineParamsFormat `form:"format,omitempty" json:"format,omitempty"`
}

// CreateTransactionOutlineParamsFormat defines parameters for CreateTransactionOutline.
type CreateTransactionOutlineParamsFormat string

// CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserJSONRequestBody = RequestsCreateUser

// AddPaymailToUserJSONRequestBody defines body for AddPaymailToUser for application/json ContentType.
type AddPaymailToUserJSONRequestBody = RequestsAddPaymail

// RecordTransactionOutlineJSONRequestBody defines body for RecordTransactionOutline for application/json ContentType.
type RecordTransactionOutlineJSONRequestBody = RequestsTransactionOutline

// CreateTransactionOutlineJSONRequestBody defines body for CreateTransactionOutline for application/json ContentType.
type CreateTransactionOutlineJSONRequestBody = RequestsTransactionSpecification

// AsErrorsUserAuthOnNonUserEndpoint returns the union data inside the ErrorsAdminAuthorization as a ErrorsUserAuthOnNonUserEndpoint
func (t ErrorsAdminAuthorization) AsErrorsUserAuthOnNonUserEndpoint() (ErrorsUserAuthOnNonUserEndpoint, error) {
	var body ErrorsUserAuthOnNonUserEndpoint
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsUserAuthOnNonUserEndpoint overwrites any union data inside the ErrorsAdminAuthorization as the provided ErrorsUserAuthOnNonUserEndpoint
func (t *ErrorsAdminAuthorization) FromErrorsUserAuthOnNonUserEndpoint(v ErrorsUserAuthOnNonUserEndpoint) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsUserAuthOnNonUserEndpoint performs a merge with any union data inside the ErrorsAdminAuthorization, using the provided ErrorsUserAuthOnNonUserEndpoint
func (t *ErrorsAdminAuthorization) MergeErrorsUserAuthOnNonUserEndpoint(v ErrorsUserAuthOnNonUserEndpoint) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsAuthXPubRequired returns the union data inside the ErrorsAdminAuthorization as a ErrorsAuthXPubRequired
func (t ErrorsAdminAuthorization) AsErrorsAuthXPubRequired() (ErrorsAuthXPubRequired, error) {
	var body ErrorsAuthXPubRequired
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsAuthXPubRequired overwrites any union data inside the ErrorsAdminAuthorization as the provided ErrorsAuthXPubRequired
func (t *ErrorsAdminAuthorization) FromErrorsAuthXPubRequired(v ErrorsAuthXPubRequired) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsAuthXPubRequired performs a merge with any union data inside the ErrorsAdminAuthorization, using the provided ErrorsAuthXPubRequired
func (t *ErrorsAdminAuthorization) MergeErrorsAuthXPubRequired(v ErrorsAuthXPubRequired) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ErrorsAdminAuthorization) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ErrorsAdminAuthorization) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsUnauthorized returns the union data inside the ErrorsAnyAuthorization as a ErrorsUnauthorized
func (t ErrorsAnyAuthorization) AsErrorsUnauthorized() (ErrorsUnauthorized, error) {
	var body ErrorsUnauthorized
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsUnauthorized overwrites any union data inside the ErrorsAnyAuthorization as the provided ErrorsUnauthorized
func (t *ErrorsAnyAuthorization) FromErrorsUnauthorized(v ErrorsUnauthorized) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsUnauthorized performs a merge with any union data inside the ErrorsAnyAuthorization, using the provided ErrorsUnauthorized
func (t *ErrorsAnyAuthorization) MergeErrorsUnauthorized(v ErrorsUnauthorized) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsAuthXPubRequired returns the union data inside the ErrorsAnyAuthorization as a ErrorsAuthXPubRequired
func (t ErrorsAnyAuthorization) AsErrorsAuthXPubRequired() (ErrorsAuthXPubRequired, error) {
	var body ErrorsAuthXPubRequired
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsAuthXPubRequired overwrites any union data inside the ErrorsAnyAuthorization as the provided ErrorsAuthXPubRequired
func (t *ErrorsAnyAuthorization) FromErrorsAuthXPubRequired(v ErrorsAuthXPubRequired) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsAuthXPubRequired performs a merge with any union data inside the ErrorsAnyAuthorization, using the provided ErrorsAuthXPubRequired
func (t *ErrorsAnyAuthorization) MergeErrorsAuthXPubRequired(v ErrorsAuthXPubRequired) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ErrorsAnyAuthorization) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ErrorsAnyAuthorization) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsUnauthorized returns the union data inside the ErrorsUserAuthorization as a ErrorsUnauthorized
func (t ErrorsUserAuthorization) AsErrorsUnauthorized() (ErrorsUnauthorized, error) {
	var body ErrorsUnauthorized
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsUnauthorized overwrites any union data inside the ErrorsUserAuthorization as the provided ErrorsUnauthorized
func (t *ErrorsUserAuthorization) FromErrorsUnauthorized(v ErrorsUnauthorized) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsUnauthorized performs a merge with any union data inside the ErrorsUserAuthorization, using the provided ErrorsUnauthorized
func (t *ErrorsUserAuthorization) MergeErrorsUnauthorized(v ErrorsUnauthorized) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsAdminAuthOnNonAdminEndpoint returns the union data inside the ErrorsUserAuthorization as a ErrorsAdminAuthOnNonAdminEndpoint
func (t ErrorsUserAuthorization) AsErrorsAdminAuthOnNonAdminEndpoint() (ErrorsAdminAuthOnNonAdminEndpoint, error) {
	var body ErrorsAdminAuthOnNonAdminEndpoint
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsAdminAuthOnNonAdminEndpoint overwrites any union data inside the ErrorsUserAuthorization as the provided ErrorsAdminAuthOnNonAdminEndpoint
func (t *ErrorsUserAuthorization) FromErrorsAdminAuthOnNonAdminEndpoint(v ErrorsAdminAuthOnNonAdminEndpoint) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsAdminAuthOnNonAdminEndpoint performs a merge with any union data inside the ErrorsUserAuthorization, using the provided ErrorsAdminAuthOnNonAdminEndpoint
func (t *ErrorsUserAuthorization) MergeErrorsAdminAuthOnNonAdminEndpoint(v ErrorsAdminAuthOnNonAdminEndpoint) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsAuthXPubRequired returns the union data inside the ErrorsUserAuthorization as a ErrorsAuthXPubRequired
func (t ErrorsUserAuthorization) AsErrorsAuthXPubRequired() (ErrorsAuthXPubRequired, error) {
	var body ErrorsAuthXPubRequired
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsAuthXPubRequired overwrites any union data inside the ErrorsUserAuthorization as the provided ErrorsAuthXPubRequired
func (t *ErrorsUserAuthorization) FromErrorsAuthXPubRequired(v ErrorsAuthXPubRequired) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsAuthXPubRequired performs a merge with any union data inside the ErrorsUserAuthorization, using the provided ErrorsAuthXPubRequired
func (t *ErrorsUserAuthorization) MergeErrorsAuthXPubRequired(v ErrorsAuthXPubRequired) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ErrorsUserAuthorization) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ErrorsUserAuthorization) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsModelsSPVWalletCustomInstructions returns the union data inside the ModelsCustomInstructions as a ModelsSPVWalletCustomInstructions
func (t ModelsCustomInstructions) AsModelsSPVWalletCustomInstructions() (ModelsSPVWalletCustomInstructions, error) {
	var body ModelsSPVWalletCustomInstructions
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromModelsSPVWalletCustomInstructions overwrites any union data inside the ModelsCustomInstructions as the provided ModelsSPVWalletCustomInstructions
func (t *ModelsCustomInstructions) FromModelsSPVWalletCustomInstructions(v ModelsSPVWalletCustomInstructions) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeModelsSPVWalletCustomInstructions performs a merge with any union data inside the ModelsCustomInstructions, using the provided ModelsSPVWalletCustomInstructions
func (t *ModelsCustomInstructions) MergeModelsSPVWalletCustomInstructions(v ModelsSPVWalletCustomInstructions) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsModelsUserDefinedCustomInstructions returns the union data inside the ModelsCustomInstructions as a ModelsUserDefinedCustomInstructions
func (t ModelsCustomInstructions) AsModelsUserDefinedCustomInstructions() (ModelsUserDefinedCustomInstructions, error) {
	var body ModelsUserDefinedCustomInstructions
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromModelsUserDefinedCustomInstructions overwrites any union data inside the ModelsCustomInstructions as the provided ModelsUserDefinedCustomInstructions
func (t *ModelsCustomInstructions) FromModelsUserDefinedCustomInstructions(v ModelsUserDefinedCustomInstructions) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeModelsUserDefinedCustomInstructions performs a merge with any union data inside the ModelsCustomInstructions, using the provided ModelsUserDefinedCustomInstructions
func (t *ModelsCustomInstructions) MergeModelsUserDefinedCustomInstructions(v ModelsUserDefinedCustomInstructions) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ModelsCustomInstructions) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ModelsCustomInstructions) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsRequestsOpReturnHexesOutput returns the union data inside the RequestsOpReturnOutputSpecification_Data as a RequestsOpReturnHexesOutput
func (t RequestsOpReturnOutputSpecification_Data) AsRequestsOpReturnHexesOutput() (RequestsOpReturnHexesOutput, error) {
	var body RequestsOpReturnHexesOutput
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromRequestsOpReturnHexesOutput overwrites any union data inside the RequestsOpReturnOutputSpecification_Data as the provided RequestsOpReturnHexesOutput
func (t *RequestsOpReturnOutputSpecification_Data) FromRequestsOpReturnHexesOutput(v RequestsOpReturnHexesOutput) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeRequestsOpReturnHexesOutput performs a merge with any union data inside the RequestsOpReturnOutputSpecification_Data, using the provided RequestsOpReturnHexesOutput
func (t *RequestsOpReturnOutputSpecification_Data) MergeRequestsOpReturnHexesOutput(v RequestsOpReturnHexesOutput) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsRequestsOpReturnStringsOutput returns the union data inside the RequestsOpReturnOutputSpecification_Data as a RequestsOpReturnStringsOutput
func (t RequestsOpReturnOutputSpecification_Data) AsRequestsOpReturnStringsOutput() (RequestsOpReturnStringsOutput, error) {
	var body RequestsOpReturnStringsOutput
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromRequestsOpReturnStringsOutput overwrites any union data inside the RequestsOpReturnOutputSpecification_Data as the provided RequestsOpReturnStringsOutput
func (t *RequestsOpReturnOutputSpecification_Data) FromRequestsOpReturnStringsOutput(v RequestsOpReturnStringsOutput) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeRequestsOpReturnStringsOutput performs a merge with any union data inside the RequestsOpReturnOutputSpecification_Data, using the provided RequestsOpReturnStringsOutput
func (t *RequestsOpReturnOutputSpecification_Data) MergeRequestsOpReturnStringsOutput(v RequestsOpReturnStringsOutput) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t RequestsOpReturnOutputSpecification_Data) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *RequestsOpReturnOutputSpecification_Data) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsRequestsOpReturnOutputSpecification returns the union data inside the RequestsTransactionOutlineOutputSpecification as a RequestsOpReturnOutputSpecification
func (t RequestsTransactionOutlineOutputSpecification) AsRequestsOpReturnOutputSpecification() (RequestsOpReturnOutputSpecification, error) {
	var body RequestsOpReturnOutputSpecification
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromRequestsOpReturnOutputSpecification overwrites any union data inside the RequestsTransactionOutlineOutputSpecification as the provided RequestsOpReturnOutputSpecification
func (t *RequestsTransactionOutlineOutputSpecification) FromRequestsOpReturnOutputSpecification(v RequestsOpReturnOutputSpecification) error {
	v.Type = "op_return"
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeRequestsOpReturnOutputSpecification performs a merge with any union data inside the RequestsTransactionOutlineOutputSpecification, using the provided RequestsOpReturnOutputSpecification
func (t *RequestsTransactionOutlineOutputSpecification) MergeRequestsOpReturnOutputSpecification(v RequestsOpReturnOutputSpecification) error {
	v.Type = "op_return"
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsRequestsPaymailOutputSpecification returns the union data inside the RequestsTransactionOutlineOutputSpecification as a RequestsPaymailOutputSpecification
func (t RequestsTransactionOutlineOutputSpecification) AsRequestsPaymailOutputSpecification() (RequestsPaymailOutputSpecification, error) {
	var body RequestsPaymailOutputSpecification
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromRequestsPaymailOutputSpecification overwrites any union data inside the RequestsTransactionOutlineOutputSpecification as the provided RequestsPaymailOutputSpecification
func (t *RequestsTransactionOutlineOutputSpecification) FromRequestsPaymailOutputSpecification(v RequestsPaymailOutputSpecification) error {
	v.Type = "paymail"
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeRequestsPaymailOutputSpecification performs a merge with any union data inside the RequestsTransactionOutlineOutputSpecification, using the provided RequestsPaymailOutputSpecification
func (t *RequestsTransactionOutlineOutputSpecification) MergeRequestsPaymailOutputSpecification(v RequestsPaymailOutputSpecification) error {
	v.Type = "paymail"
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t RequestsTransactionOutlineOutputSpecification) Discriminator() (string, error) {
	var discriminator struct {
		Discriminator string `json:"type"`
	}
	err := json.Unmarshal(t.union, &discriminator)
	return discriminator.Discriminator, err
}

func (t RequestsTransactionOutlineOutputSpecification) ValueByDiscriminator() (interface{}, error) {
	discriminator, err := t.Discriminator()
	if err != nil {
		return nil, err
	}
	switch discriminator {
	case "op_return":
		return t.AsRequestsOpReturnOutputSpecification()
	case "paymail":
		return t.AsRequestsPaymailOutputSpecification()
	default:
		return nil, errors.New("unknown discriminator value: " + discriminator)
	}
}

func (t RequestsTransactionOutlineOutputSpecification) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *RequestsTransactionOutlineOutputSpecification) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsInvalidAvatarURL returns the union data inside the ResponsesAdminInvalidAvatarURL as a ErrorsInvalidAvatarURL
func (t ResponsesAdminInvalidAvatarURL) AsErrorsInvalidAvatarURL() (ErrorsInvalidAvatarURL, error) {
	var body ErrorsInvalidAvatarURL
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsInvalidAvatarURL overwrites any union data inside the ResponsesAdminInvalidAvatarURL as the provided ErrorsInvalidAvatarURL
func (t *ResponsesAdminInvalidAvatarURL) FromErrorsInvalidAvatarURL(v ErrorsInvalidAvatarURL) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsInvalidAvatarURL performs a merge with any union data inside the ResponsesAdminInvalidAvatarURL, using the provided ErrorsInvalidAvatarURL
func (t *ResponsesAdminInvalidAvatarURL) MergeErrorsInvalidAvatarURL(v ErrorsInvalidAvatarURL) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesAdminInvalidAvatarURL) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesAdminInvalidAvatarURL) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsCannotBindRequest returns the union data inside the ResponsesAdminUserBadRequest as a ErrorsCannotBindRequest
func (t ResponsesAdminUserBadRequest) AsErrorsCannotBindRequest() (ErrorsCannotBindRequest, error) {
	var body ErrorsCannotBindRequest
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsCannotBindRequest overwrites any union data inside the ResponsesAdminUserBadRequest as the provided ErrorsCannotBindRequest
func (t *ResponsesAdminUserBadRequest) FromErrorsCannotBindRequest(v ErrorsCannotBindRequest) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsCannotBindRequest performs a merge with any union data inside the ResponsesAdminUserBadRequest, using the provided ErrorsCannotBindRequest
func (t *ResponsesAdminUserBadRequest) MergeErrorsCannotBindRequest(v ErrorsCannotBindRequest) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsInvalidPubKey returns the union data inside the ResponsesAdminUserBadRequest as a ErrorsInvalidPubKey
func (t ResponsesAdminUserBadRequest) AsErrorsInvalidPubKey() (ErrorsInvalidPubKey, error) {
	var body ErrorsInvalidPubKey
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsInvalidPubKey overwrites any union data inside the ResponsesAdminUserBadRequest as the provided ErrorsInvalidPubKey
func (t *ResponsesAdminUserBadRequest) FromErrorsInvalidPubKey(v ErrorsInvalidPubKey) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsInvalidPubKey performs a merge with any union data inside the ResponsesAdminUserBadRequest, using the provided ErrorsInvalidPubKey
func (t *ResponsesAdminUserBadRequest) MergeErrorsInvalidPubKey(v ErrorsInvalidPubKey) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsInvalidPaymail returns the union data inside the ResponsesAdminUserBadRequest as a ErrorsInvalidPaymail
func (t ResponsesAdminUserBadRequest) AsErrorsInvalidPaymail() (ErrorsInvalidPaymail, error) {
	var body ErrorsInvalidPaymail
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsInvalidPaymail overwrites any union data inside the ResponsesAdminUserBadRequest as the provided ErrorsInvalidPaymail
func (t *ResponsesAdminUserBadRequest) FromErrorsInvalidPaymail(v ErrorsInvalidPaymail) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsInvalidPaymail performs a merge with any union data inside the ResponsesAdminUserBadRequest, using the provided ErrorsInvalidPaymail
func (t *ResponsesAdminUserBadRequest) MergeErrorsInvalidPaymail(v ErrorsInvalidPaymail) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsPaymailInconsistent returns the union data inside the ResponsesAdminUserBadRequest as a ErrorsPaymailInconsistent
func (t ResponsesAdminUserBadRequest) AsErrorsPaymailInconsistent() (ErrorsPaymailInconsistent, error) {
	var body ErrorsPaymailInconsistent
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsPaymailInconsistent overwrites any union data inside the ResponsesAdminUserBadRequest as the provided ErrorsPaymailInconsistent
func (t *ResponsesAdminUserBadRequest) FromErrorsPaymailInconsistent(v ErrorsPaymailInconsistent) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsPaymailInconsistent performs a merge with any union data inside the ResponsesAdminUserBadRequest, using the provided ErrorsPaymailInconsistent
func (t *ResponsesAdminUserBadRequest) MergeErrorsPaymailInconsistent(v ErrorsPaymailInconsistent) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsInvalidDomain returns the union data inside the ResponsesAdminUserBadRequest as a ErrorsInvalidDomain
func (t ResponsesAdminUserBadRequest) AsErrorsInvalidDomain() (ErrorsInvalidDomain, error) {
	var body ErrorsInvalidDomain
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsInvalidDomain overwrites any union data inside the ResponsesAdminUserBadRequest as the provided ErrorsInvalidDomain
func (t *ResponsesAdminUserBadRequest) FromErrorsInvalidDomain(v ErrorsInvalidDomain) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsInvalidDomain performs a merge with any union data inside the ResponsesAdminUserBadRequest, using the provided ErrorsInvalidDomain
func (t *ResponsesAdminUserBadRequest) MergeErrorsInvalidDomain(v ErrorsInvalidDomain) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesAdminUserBadRequest) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesAdminUserBadRequest) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsTxSpecNoDefaultPaymailAddress returns the union data inside the ResponsesCreateTransactionOutlineBadRequest as a ErrorsTxSpecNoDefaultPaymailAddress
func (t ResponsesCreateTransactionOutlineBadRequest) AsErrorsTxSpecNoDefaultPaymailAddress() (ErrorsTxSpecNoDefaultPaymailAddress, error) {
	var body ErrorsTxSpecNoDefaultPaymailAddress
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxSpecNoDefaultPaymailAddress overwrites any union data inside the ResponsesCreateTransactionOutlineBadRequest as the provided ErrorsTxSpecNoDefaultPaymailAddress
func (t *ResponsesCreateTransactionOutlineBadRequest) FromErrorsTxSpecNoDefaultPaymailAddress(v ErrorsTxSpecNoDefaultPaymailAddress) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxSpecNoDefaultPaymailAddress performs a merge with any union data inside the ResponsesCreateTransactionOutlineBadRequest, using the provided ErrorsTxSpecNoDefaultPaymailAddress
func (t *ResponsesCreateTransactionOutlineBadRequest) MergeErrorsTxSpecNoDefaultPaymailAddress(v ErrorsTxSpecNoDefaultPaymailAddress) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsTxSpecOutputsRequired returns the union data inside the ResponsesCreateTransactionOutlineBadRequest as a ErrorsTxSpecOutputsRequired
func (t ResponsesCreateTransactionOutlineBadRequest) AsErrorsTxSpecOutputsRequired() (ErrorsTxSpecOutputsRequired, error) {
	var body ErrorsTxSpecOutputsRequired
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxSpecOutputsRequired overwrites any union data inside the ResponsesCreateTransactionOutlineBadRequest as the provided ErrorsTxSpecOutputsRequired
func (t *ResponsesCreateTransactionOutlineBadRequest) FromErrorsTxSpecOutputsRequired(v ErrorsTxSpecOutputsRequired) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxSpecOutputsRequired performs a merge with any union data inside the ResponsesCreateTransactionOutlineBadRequest, using the provided ErrorsTxSpecOutputsRequired
func (t *ResponsesCreateTransactionOutlineBadRequest) MergeErrorsTxSpecOutputsRequired(v ErrorsTxSpecOutputsRequired) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsTxSpecOpReturnDataRequired returns the union data inside the ResponsesCreateTransactionOutlineBadRequest as a ErrorsTxSpecOpReturnDataRequired
func (t ResponsesCreateTransactionOutlineBadRequest) AsErrorsTxSpecOpReturnDataRequired() (ErrorsTxSpecOpReturnDataRequired, error) {
	var body ErrorsTxSpecOpReturnDataRequired
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxSpecOpReturnDataRequired overwrites any union data inside the ResponsesCreateTransactionOutlineBadRequest as the provided ErrorsTxSpecOpReturnDataRequired
func (t *ResponsesCreateTransactionOutlineBadRequest) FromErrorsTxSpecOpReturnDataRequired(v ErrorsTxSpecOpReturnDataRequired) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxSpecOpReturnDataRequired performs a merge with any union data inside the ResponsesCreateTransactionOutlineBadRequest, using the provided ErrorsTxSpecOpReturnDataRequired
func (t *ResponsesCreateTransactionOutlineBadRequest) MergeErrorsTxSpecOpReturnDataRequired(v ErrorsTxSpecOpReturnDataRequired) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsTxSpecFailedToDecodeHex returns the union data inside the ResponsesCreateTransactionOutlineBadRequest as a ErrorsTxSpecFailedToDecodeHex
func (t ResponsesCreateTransactionOutlineBadRequest) AsErrorsTxSpecFailedToDecodeHex() (ErrorsTxSpecFailedToDecodeHex, error) {
	var body ErrorsTxSpecFailedToDecodeHex
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxSpecFailedToDecodeHex overwrites any union data inside the ResponsesCreateTransactionOutlineBadRequest as the provided ErrorsTxSpecFailedToDecodeHex
func (t *ResponsesCreateTransactionOutlineBadRequest) FromErrorsTxSpecFailedToDecodeHex(v ErrorsTxSpecFailedToDecodeHex) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxSpecFailedToDecodeHex performs a merge with any union data inside the ResponsesCreateTransactionOutlineBadRequest, using the provided ErrorsTxSpecFailedToDecodeHex
func (t *ResponsesCreateTransactionOutlineBadRequest) MergeErrorsTxSpecFailedToDecodeHex(v ErrorsTxSpecFailedToDecodeHex) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsTxSpecInvalidPaymailReceiver returns the union data inside the ResponsesCreateTransactionOutlineBadRequest as a ErrorsTxSpecInvalidPaymailReceiver
func (t ResponsesCreateTransactionOutlineBadRequest) AsErrorsTxSpecInvalidPaymailReceiver() (ErrorsTxSpecInvalidPaymailReceiver, error) {
	var body ErrorsTxSpecInvalidPaymailReceiver
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxSpecInvalidPaymailReceiver overwrites any union data inside the ResponsesCreateTransactionOutlineBadRequest as the provided ErrorsTxSpecInvalidPaymailReceiver
func (t *ResponsesCreateTransactionOutlineBadRequest) FromErrorsTxSpecInvalidPaymailReceiver(v ErrorsTxSpecInvalidPaymailReceiver) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxSpecInvalidPaymailReceiver performs a merge with any union data inside the ResponsesCreateTransactionOutlineBadRequest, using the provided ErrorsTxSpecInvalidPaymailReceiver
func (t *ResponsesCreateTransactionOutlineBadRequest) MergeErrorsTxSpecInvalidPaymailReceiver(v ErrorsTxSpecInvalidPaymailReceiver) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsTxSpecInvalidPaymailSender returns the union data inside the ResponsesCreateTransactionOutlineBadRequest as a ErrorsTxSpecInvalidPaymailSender
func (t ResponsesCreateTransactionOutlineBadRequest) AsErrorsTxSpecInvalidPaymailSender() (ErrorsTxSpecInvalidPaymailSender, error) {
	var body ErrorsTxSpecInvalidPaymailSender
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxSpecInvalidPaymailSender overwrites any union data inside the ResponsesCreateTransactionOutlineBadRequest as the provided ErrorsTxSpecInvalidPaymailSender
func (t *ResponsesCreateTransactionOutlineBadRequest) FromErrorsTxSpecInvalidPaymailSender(v ErrorsTxSpecInvalidPaymailSender) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxSpecInvalidPaymailSender performs a merge with any union data inside the ResponsesCreateTransactionOutlineBadRequest, using the provided ErrorsTxSpecInvalidPaymailSender
func (t *ResponsesCreateTransactionOutlineBadRequest) MergeErrorsTxSpecInvalidPaymailSender(v ErrorsTxSpecInvalidPaymailSender) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesCreateTransactionOutlineBadRequest) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesCreateTransactionOutlineBadRequest) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsTxOutlineUserHasNotEnoughFunds returns the union data inside the ResponsesCreateTransactionOutlineUnprocessable as a ErrorsTxOutlineUserHasNotEnoughFunds
func (t ResponsesCreateTransactionOutlineUnprocessable) AsErrorsTxOutlineUserHasNotEnoughFunds() (ErrorsTxOutlineUserHasNotEnoughFunds, error) {
	var body ErrorsTxOutlineUserHasNotEnoughFunds
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxOutlineUserHasNotEnoughFunds overwrites any union data inside the ResponsesCreateTransactionOutlineUnprocessable as the provided ErrorsTxOutlineUserHasNotEnoughFunds
func (t *ResponsesCreateTransactionOutlineUnprocessable) FromErrorsTxOutlineUserHasNotEnoughFunds(v ErrorsTxOutlineUserHasNotEnoughFunds) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxOutlineUserHasNotEnoughFunds performs a merge with any union data inside the ResponsesCreateTransactionOutlineUnprocessable, using the provided ErrorsTxOutlineUserHasNotEnoughFunds
func (t *ResponsesCreateTransactionOutlineUnprocessable) MergeErrorsTxOutlineUserHasNotEnoughFunds(v ErrorsTxOutlineUserHasNotEnoughFunds) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesCreateTransactionOutlineUnprocessable) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesCreateTransactionOutlineUnprocessable) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsDataNotFound returns the union data inside the ResponsesGetDataNotFound as a ErrorsDataNotFound
func (t ResponsesGetDataNotFound) AsErrorsDataNotFound() (ErrorsDataNotFound, error) {
	var body ErrorsDataNotFound
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsDataNotFound overwrites any union data inside the ResponsesGetDataNotFound as the provided ErrorsDataNotFound
func (t *ResponsesGetDataNotFound) FromErrorsDataNotFound(v ErrorsDataNotFound) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsDataNotFound performs a merge with any union data inside the ResponsesGetDataNotFound, using the provided ErrorsDataNotFound
func (t *ResponsesGetDataNotFound) MergeErrorsDataNotFound(v ErrorsDataNotFound) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesGetDataNotFound) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesGetDataNotFound) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsBHSUnreachable returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSUnreachable
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSUnreachable() (ErrorsBHSUnreachable, error) {
	var body ErrorsBHSUnreachable
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSUnreachable overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSUnreachable
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSUnreachable(v ErrorsBHSUnreachable) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSUnreachable performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSUnreachable
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSUnreachable(v ErrorsBHSUnreachable) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsBHSNoSuccessResponse returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSNoSuccessResponse
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSNoSuccessResponse() (ErrorsBHSNoSuccessResponse, error) {
	var body ErrorsBHSNoSuccessResponse
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSNoSuccessResponse overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSNoSuccessResponse
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSNoSuccessResponse(v ErrorsBHSNoSuccessResponse) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSNoSuccessResponse performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSNoSuccessResponse
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSNoSuccessResponse(v ErrorsBHSNoSuccessResponse) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsBHSUnauthorized returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSUnauthorized
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSUnauthorized() (ErrorsBHSUnauthorized, error) {
	var body ErrorsBHSUnauthorized
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSUnauthorized overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSUnauthorized
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSUnauthorized(v ErrorsBHSUnauthorized) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSUnauthorized performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSUnauthorized
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSUnauthorized(v ErrorsBHSUnauthorized) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsBHSBadRequest returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSBadRequest
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSBadRequest() (ErrorsBHSBadRequest, error) {
	var body ErrorsBHSBadRequest
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSBadRequest overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSBadRequest
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSBadRequest(v ErrorsBHSBadRequest) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSBadRequest performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSBadRequest
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSBadRequest(v ErrorsBHSBadRequest) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsBHSUnhealthy returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSUnhealthy
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSUnhealthy() (ErrorsBHSUnhealthy, error) {
	var body ErrorsBHSUnhealthy
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSUnhealthy overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSUnhealthy
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSUnhealthy(v ErrorsBHSUnhealthy) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSUnhealthy performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSUnhealthy
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSUnhealthy(v ErrorsBHSUnhealthy) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsBHSBadURL returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSBadURL
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSBadURL() (ErrorsBHSBadURL, error) {
	var body ErrorsBHSBadURL
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSBadURL overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSBadURL
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSBadURL(v ErrorsBHSBadURL) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSBadURL performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSBadURL
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSBadURL(v ErrorsBHSBadURL) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsBHSParsingResponse returns the union data inside the ResponsesGetMerklerootsInternalServerError as a ErrorsBHSParsingResponse
func (t ResponsesGetMerklerootsInternalServerError) AsErrorsBHSParsingResponse() (ErrorsBHSParsingResponse, error) {
	var body ErrorsBHSParsingResponse
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsBHSParsingResponse overwrites any union data inside the ResponsesGetMerklerootsInternalServerError as the provided ErrorsBHSParsingResponse
func (t *ResponsesGetMerklerootsInternalServerError) FromErrorsBHSParsingResponse(v ErrorsBHSParsingResponse) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsBHSParsingResponse performs a merge with any union data inside the ResponsesGetMerklerootsInternalServerError, using the provided ErrorsBHSParsingResponse
func (t *ResponsesGetMerklerootsInternalServerError) MergeErrorsBHSParsingResponse(v ErrorsBHSParsingResponse) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesGetMerklerootsInternalServerError) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesGetMerklerootsInternalServerError) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsInvalidDataID returns the union data inside the ResponsesRecordTransactionBadRequest as a ErrorsInvalidDataID
func (t ResponsesRecordTransactionBadRequest) AsErrorsInvalidDataID() (ErrorsInvalidDataID, error) {
	var body ErrorsInvalidDataID
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsInvalidDataID overwrites any union data inside the ResponsesRecordTransactionBadRequest as the provided ErrorsInvalidDataID
func (t *ResponsesRecordTransactionBadRequest) FromErrorsInvalidDataID(v ErrorsInvalidDataID) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsInvalidDataID performs a merge with any union data inside the ResponsesRecordTransactionBadRequest, using the provided ErrorsInvalidDataID
func (t *ResponsesRecordTransactionBadRequest) MergeErrorsInvalidDataID(v ErrorsInvalidDataID) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsAnnotationIndexOutOfRange returns the union data inside the ResponsesRecordTransactionBadRequest as a ErrorsAnnotationIndexOutOfRange
func (t ResponsesRecordTransactionBadRequest) AsErrorsAnnotationIndexOutOfRange() (ErrorsAnnotationIndexOutOfRange, error) {
	var body ErrorsAnnotationIndexOutOfRange
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsAnnotationIndexOutOfRange overwrites any union data inside the ResponsesRecordTransactionBadRequest as the provided ErrorsAnnotationIndexOutOfRange
func (t *ResponsesRecordTransactionBadRequest) FromErrorsAnnotationIndexOutOfRange(v ErrorsAnnotationIndexOutOfRange) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsAnnotationIndexOutOfRange performs a merge with any union data inside the ResponsesRecordTransactionBadRequest, using the provided ErrorsAnnotationIndexOutOfRange
func (t *ResponsesRecordTransactionBadRequest) MergeErrorsAnnotationIndexOutOfRange(v ErrorsAnnotationIndexOutOfRange) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsUTXOSpent returns the union data inside the ResponsesRecordTransactionBadRequest as a ErrorsUTXOSpent
func (t ResponsesRecordTransactionBadRequest) AsErrorsUTXOSpent() (ErrorsUTXOSpent, error) {
	var body ErrorsUTXOSpent
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsUTXOSpent overwrites any union data inside the ResponsesRecordTransactionBadRequest as the provided ErrorsUTXOSpent
func (t *ResponsesRecordTransactionBadRequest) FromErrorsUTXOSpent(v ErrorsUTXOSpent) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsUTXOSpent performs a merge with any union data inside the ResponsesRecordTransactionBadRequest, using the provided ErrorsUTXOSpent
func (t *ResponsesRecordTransactionBadRequest) MergeErrorsUTXOSpent(v ErrorsUTXOSpent) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsAnnotationIndexConversion returns the union data inside the ResponsesRecordTransactionBadRequest as a ErrorsAnnotationIndexConversion
func (t ResponsesRecordTransactionBadRequest) AsErrorsAnnotationIndexConversion() (ErrorsAnnotationIndexConversion, error) {
	var body ErrorsAnnotationIndexConversion
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsAnnotationIndexConversion overwrites any union data inside the ResponsesRecordTransactionBadRequest as the provided ErrorsAnnotationIndexConversion
func (t *ResponsesRecordTransactionBadRequest) FromErrorsAnnotationIndexConversion(v ErrorsAnnotationIndexConversion) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsAnnotationIndexConversion performs a merge with any union data inside the ResponsesRecordTransactionBadRequest, using the provided ErrorsAnnotationIndexConversion
func (t *ResponsesRecordTransactionBadRequest) MergeErrorsAnnotationIndexConversion(v ErrorsAnnotationIndexConversion) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsNoOperations returns the union data inside the ResponsesRecordTransactionBadRequest as a ErrorsNoOperations
func (t ResponsesRecordTransactionBadRequest) AsErrorsNoOperations() (ErrorsNoOperations, error) {
	var body ErrorsNoOperations
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsNoOperations overwrites any union data inside the ResponsesRecordTransactionBadRequest as the provided ErrorsNoOperations
func (t *ResponsesRecordTransactionBadRequest) FromErrorsNoOperations(v ErrorsNoOperations) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsNoOperations performs a merge with any union data inside the ResponsesRecordTransactionBadRequest, using the provided ErrorsNoOperations
func (t *ResponsesRecordTransactionBadRequest) MergeErrorsNoOperations(v ErrorsNoOperations) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesRecordTransactionBadRequest) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesRecordTransactionBadRequest) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// AsErrorsInternal returns the union data inside the ResponsesRecordTransactionInternalServerError as a ErrorsInternal
func (t ResponsesRecordTransactionInternalServerError) AsErrorsInternal() (ErrorsInternal, error) {
	var body ErrorsInternal
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsInternal overwrites any union data inside the ResponsesRecordTransactionInternalServerError as the provided ErrorsInternal
func (t *ResponsesRecordTransactionInternalServerError) FromErrorsInternal(v ErrorsInternal) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsInternal performs a merge with any union data inside the ResponsesRecordTransactionInternalServerError, using the provided ErrorsInternal
func (t *ResponsesRecordTransactionInternalServerError) MergeErrorsInternal(v ErrorsInternal) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsGettingOutputs returns the union data inside the ResponsesRecordTransactionInternalServerError as a ErrorsGettingOutputs
func (t ResponsesRecordTransactionInternalServerError) AsErrorsGettingOutputs() (ErrorsGettingOutputs, error) {
	var body ErrorsGettingOutputs
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsGettingOutputs overwrites any union data inside the ResponsesRecordTransactionInternalServerError as the provided ErrorsGettingOutputs
func (t *ResponsesRecordTransactionInternalServerError) FromErrorsGettingOutputs(v ErrorsGettingOutputs) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsGettingOutputs performs a merge with any union data inside the ResponsesRecordTransactionInternalServerError, using the provided ErrorsGettingOutputs
func (t *ResponsesRecordTransactionInternalServerError) MergeErrorsGettingOutputs(v ErrorsGettingOutputs) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

// AsErrorsTxBroadcast returns the union data inside the ResponsesRecordTransactionInternalServerError as a ErrorsTxBroadcast
func (t ResponsesRecordTransactionInternalServerError) AsErrorsTxBroadcast() (ErrorsTxBroadcast, error) {
	var body ErrorsTxBroadcast
	err := json.Unmarshal(t.union, &body)
	return body, err
}

// FromErrorsTxBroadcast overwrites any union data inside the ResponsesRecordTransactionInternalServerError as the provided ErrorsTxBroadcast
func (t *ResponsesRecordTransactionInternalServerError) FromErrorsTxBroadcast(v ErrorsTxBroadcast) error {
	b, err := json.Marshal(v)
	t.union = b
	return err
}

// MergeErrorsTxBroadcast performs a merge with any union data inside the ResponsesRecordTransactionInternalServerError, using the provided ErrorsTxBroadcast
func (t *ResponsesRecordTransactionInternalServerError) MergeErrorsTxBroadcast(v ErrorsTxBroadcast) error {
	b, err := json.Marshal(v)
	if err != nil {
		return err
	}

	merged, err := runtime.JSONMerge(t.union, b)
	t.union = merged
	return err
}

func (t ResponsesRecordTransactionInternalServerError) MarshalJSON() ([]byte, error) {
	b, err := t.union.MarshalJSON()
	return b, err
}

func (t *ResponsesRecordTransactionInternalServerError) UnmarshalJSON(b []byte) error {
	err := t.union.UnmarshalJSON(b)
	return err
}

// RequestEditorFn  is the function signature for the RequestEditor callback function
type RequestEditorFn func(ctx context.Context, req *http.Request) error

// Doer performs HTTP requests.
//
// The standard http.Client implements this interface.
type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

// Client which conforms to the OpenAPI3 specification for this service.
type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

// ClientOption allows setting custom parameters during construction
type ClientOption func(*Client) error

// Creates a new Client, with reasonable defaults
func NewClient(server string, opts ...ClientOption) (*Client, error) {
	// create a client with sane default values
	client := Client{
		Server: server,
	}
	// mutate client and add all optional params
	for _, o := range opts {
		if err := o(&client); err != nil {
			return nil, err
		}
	}
	// ensure the server URL always has a trailing slash
	if !strings.HasSuffix(client.Server, "/") {
		client.Server += "/"
	}
	// create httpClient, if not already present
	if client.Client == nil {
		client.Client = &http.Client{}
	}
	return &client, nil
}

// WithHTTPClient allows overriding the default Doer, which is
// automatically created using http.Client. This is useful for tests.
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
	return func(c *Client) error {
		c.Client = doer
		return nil
	}
}

// WithRequestEditorFn allows setting up a callback function, which will be
// called right before sending the request. This can be used to mutate the request.
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
	return func(c *Client) error {
		c.RequestEditors = append(c.RequestEditors, fn)
		return nil
	}
}

// The interface specification for the client above.
type ClientInterface interface {
	// AdminStatus request
	AdminStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateUserWithBody request with any body
	CreateUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateUser(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UserById request
	UserById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// AddPaymailToUserWithBody request with any body
	AddPaymailToUserWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	AddPaymailToUser(ctx context.Context, id string, body AddPaymailToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SharedConfig request
	SharedConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DataById request
	DataById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// MerkleRoots request
	MerkleRoots(ctx context.Context, params *MerkleRootsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// SearchOperations request
	SearchOperations(ctx context.Context, params *SearchOperationsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// RecordTransactionOutlineWithBody request with any body
	RecordTransactionOutlineWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	RecordTransactionOutline(ctx context.Context, body RecordTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateTransactionOutlineWithBody request with any body
	CreateTransactionOutlineWithBody(ctx context.Context, params *CreateTransactionOutlineParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateTransactionOutline(ctx context.Context, params *CreateTransactionOutlineParams, body CreateTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CurrentUser request
	CurrentUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}

func (c *Client) AdminStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewAdminStatusRequest(c.Server)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) CreateUserWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateUserRequestWithBody(c.Server, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) CreateUser(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateUserRequest(c.Server, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) UserById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewUserByIdRequest(c.Server, id)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) AddPaymailToUserWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewAddPaymailToUserRequestWithBody(c.Server, id, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) AddPaymailToUser(ctx context.Context, id string, body AddPaymailToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewAddPaymailToUserRequest(c.Server, id, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) SharedConfig(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewSharedConfigRequest(c.Server)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) DataById(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewDataByIdRequest(c.Server, id)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) MerkleRoots(ctx context.Context, params *MerkleRootsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewMerkleRootsRequest(c.Server, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) SearchOperations(ctx context.Context, params *SearchOperationsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewSearchOperationsRequest(c.Server, params)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) RecordTransactionOutlineWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewRecordTransactionOutlineRequestWithBody(c.Server, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) RecordTransactionOutline(ctx context.Context, body RecordTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewRecordTransactionOutlineRequest(c.Server, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) CreateTransactionOutlineWithBody(ctx context.Context, params *CreateTransactionOutlineParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateTransactionOutlineRequestWithBody(c.Server, params, contentType, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) CreateTransactionOutline(ctx context.Context, params *CreateTransactionOutlineParams, body CreateTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCreateTransactionOutlineRequest(c.Server, params, body)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

func (c *Client) CurrentUser(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
	req, err := NewCurrentUserRequest(c.Server)
	if err != nil {
		return nil, err
	}
	req = req.WithContext(ctx)
	if err := c.applyEditors(ctx, req, reqEditors); err != nil {
		return nil, err
	}
	return c.Client.Do(req)
}

// NewAdminStatusRequest generates requests for AdminStatus
func NewAdminStatusRequest(server string) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/admin/status")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewCreateUserRequest calls the generic CreateUser builder with application/json body
func NewCreateUserRequest(server string, body CreateUserJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateUserRequestWithBody(server, "application/json", bodyReader)
}

// NewCreateUserRequestWithBody generates requests for CreateUser with any type of body
func NewCreateUserRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/admin/users")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewUserByIdRequest generates requests for UserById
func NewUserByIdRequest(server string, id string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/admin/users/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewAddPaymailToUserRequest calls the generic AddPaymailToUser builder with application/json body
func NewAddPaymailToUserRequest(server string, id string, body AddPaymailToUserJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewAddPaymailToUserRequestWithBody(server, id, "application/json", bodyReader)
}

// NewAddPaymailToUserRequestWithBody generates requests for AddPaymailToUser with any type of body
func NewAddPaymailToUserRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/admin/users/%s/paymails", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewSharedConfigRequest generates requests for SharedConfig
func NewSharedConfigRequest(server string) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/configs/shared")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewDataByIdRequest generates requests for DataById
func NewDataByIdRequest(server string, id string) (*http.Request, error) {
	var err error

	var pathParam0 string

	pathParam0, err = runtime.StyleParamWithLocation("simple", false, "id", runtime.ParamLocationPath, id)
	if err != nil {
		return nil, err
	}

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/data/%s", pathParam0)
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewMerkleRootsRequest generates requests for MerkleRoots
func NewMerkleRootsRequest(server string, params *MerkleRootsParams) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/merkleroots")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.BatchSize != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "batchSize", runtime.ParamLocationQuery, *params.BatchSize); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.LastEvaluatedKey != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "lastEvaluatedKey", runtime.ParamLocationQuery, *params.LastEvaluatedKey); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewSearchOperationsRequest generates requests for SearchOperations
func NewSearchOperationsRequest(server string, params *SearchOperationsParams) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/operations/search")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Page != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "page", runtime.ParamLocationQuery, *params.Page); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Size != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "size", runtime.ParamLocationQuery, *params.Size); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.Sort != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sort", runtime.ParamLocationQuery, *params.Sort); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		if params.SortBy != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "sortBy", runtime.ParamLocationQuery, *params.SortBy); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

// NewRecordTransactionOutlineRequest calls the generic RecordTransactionOutline builder with application/json body
func NewRecordTransactionOutlineRequest(server string, body RecordTransactionOutlineJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewRecordTransactionOutlineRequestWithBody(server, "application/json", bodyReader)
}

// NewRecordTransactionOutlineRequestWithBody generates requests for RecordTransactionOutline with any type of body
func NewRecordTransactionOutlineRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/transactions")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewCreateTransactionOutlineRequest calls the generic CreateTransactionOutline builder with application/json body
func NewCreateTransactionOutlineRequest(server string, params *CreateTransactionOutlineParams, body CreateTransactionOutlineJSONRequestBody) (*http.Request, error) {
	var bodyReader io.Reader
	buf, err := json.Marshal(body)
	if err != nil {
		return nil, err
	}
	bodyReader = bytes.NewReader(buf)
	return NewCreateTransactionOutlineRequestWithBody(server, params, "application/json", bodyReader)
}

// NewCreateTransactionOutlineRequestWithBody generates requests for CreateTransactionOutline with any type of body
func NewCreateTransactionOutlineRequestWithBody(server string, params *CreateTransactionOutlineParams, contentType string, body io.Reader) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/transactions/outlines")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	if params != nil {
		queryValues := queryURL.Query()

		if params.Format != nil {

			if queryFrag, err := runtime.StyleParamWithLocation("form", true, "format", runtime.ParamLocationQuery, *params.Format); err != nil {
				return nil, err
			} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
				return nil, err
			} else {
				for k, v := range parsed {
					for _, v2 := range v {
						queryValues.Add(k, v2)
					}
				}
			}

		}

		queryURL.RawQuery = queryValues.Encode()
	}

	req, err := http.NewRequest("POST", queryURL.String(), body)
	if err != nil {
		return nil, err
	}

	req.Header.Add("Content-Type", contentType)

	return req, nil
}

// NewCurrentUserRequest generates requests for CurrentUser
func NewCurrentUserRequest(server string) (*http.Request, error) {
	var err error

	serverURL, err := url.Parse(server)
	if err != nil {
		return nil, err
	}

	operationPath := fmt.Sprintf("/api/v2/users/current")
	if operationPath[0] == '/' {
		operationPath = "." + operationPath
	}

	queryURL, err := serverURL.Parse(operationPath)
	if err != nil {
		return nil, err
	}

	req, err := http.NewRequest("GET", queryURL.String(), nil)
	if err != nil {
		return nil, err
	}

	return req, nil
}

func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
	for _, r := range c.RequestEditors {
		if err := r(ctx, req); err != nil {
			return err
		}
	}
	for _, r := range additionalEditors {
		if err := r(ctx, req); err != nil {
			return err
		}
	}
	return nil
}

// ClientWithResponses builds on ClientInterface to offer response payloads
type ClientWithResponses struct {
	ClientInterface
}

// NewClientWithResponses creates a new ClientWithResponses, which wraps
// Client with return type handling
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
	client, err := NewClient(server, opts...)
	if err != nil {
		return nil, err
	}
	return &ClientWithResponses{client}, nil
}

// WithBaseURL overrides the baseURL.
func WithBaseURL(baseURL string) ClientOption {
	return func(c *Client) error {
		newBaseURL, err := url.Parse(baseURL)
		if err != nil {
			return err
		}
		c.Server = newBaseURL.String()
		return nil
	}
}

// ClientWithResponsesInterface is the interface specification for the client with responses above.
type ClientWithResponsesInterface interface {
	// AdminStatusWithResponse request
	AdminStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AdminStatusResponse, error)

	// CreateUserWithBodyWithResponse request with any body
	CreateUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)

	CreateUserWithResponse(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error)

	// UserByIdWithResponse request
	UserByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*UserByIdResponse, error)

	// AddPaymailToUserWithBodyWithResponse request with any body
	AddPaymailToUserWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddPaymailToUserResponse, error)

	AddPaymailToUserWithResponse(ctx context.Context, id string, body AddPaymailToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AddPaymailToUserResponse, error)

	// SharedConfigWithResponse request
	SharedConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SharedConfigResponse, error)

	// DataByIdWithResponse request
	DataByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DataByIdResponse, error)

	// MerkleRootsWithResponse request
	MerkleRootsWithResponse(ctx context.Context, params *MerkleRootsParams, reqEditors ...RequestEditorFn) (*MerkleRootsResponse, error)

	// SearchOperationsWithResponse request
	SearchOperationsWithResponse(ctx context.Context, params *SearchOperationsParams, reqEditors ...RequestEditorFn) (*SearchOperationsResponse, error)

	// RecordTransactionOutlineWithBodyWithResponse request with any body
	RecordTransactionOutlineWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RecordTransactionOutlineResponse, error)

	RecordTransactionOutlineWithResponse(ctx context.Context, body RecordTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*RecordTransactionOutlineResponse, error)

	// CreateTransactionOutlineWithBodyWithResponse request with any body
	CreateTransactionOutlineWithBodyWithResponse(ctx context.Context, params *CreateTransactionOutlineParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTransactionOutlineResponse, error)

	CreateTransactionOutlineWithResponse(ctx context.Context, params *CreateTransactionOutlineParams, body CreateTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTransactionOutlineResponse, error)

	// CurrentUserWithResponse request
	CurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CurrentUserResponse, error)
}

type AdminStatusResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON401      *ResponsesNotAuthorizedToAdminEndpoint
}

// Status returns HTTPResponse.Status
func (r AdminStatusResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r AdminStatusResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r AdminStatusResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r AdminStatusResponse) Bytes() []byte {
	return r.Body
}

type CreateUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *ResponsesAdminCreateUserSuccess
	JSON400      *ResponsesAdminUserBadRequest
	JSON401      *ResponsesNotAuthorizedToAdminEndpoint
	JSON422      *ResponsesAdminInvalidAvatarURL
	JSON500      *ResponsesAdminCreateUserInternalServerError
}

// Status returns HTTPResponse.Status
func (r CreateUserResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateUserResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r CreateUserResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r CreateUserResponse) Bytes() []byte {
	return r.Body
}

type UserByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesAdminGetUser
	JSON500      *ResponsesAdminGetUserInternalServerError
}

// Status returns HTTPResponse.Status
func (r UserByIdResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r UserByIdResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r UserByIdResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r UserByIdResponse) Bytes() []byte {
	return r.Body
}

type AddPaymailToUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *ResponsesAdminAddPaymailSuccess
	JSON400      *ResponsesAdminUserBadRequest
	JSON401      *ResponsesNotAuthorizedToAdminEndpoint
	JSON422      *ResponsesAdminInvalidAvatarURL
}

// Status returns HTTPResponse.Status
func (r AddPaymailToUserResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r AddPaymailToUserResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r AddPaymailToUserResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r AddPaymailToUserResponse) Bytes() []byte {
	return r.Body
}

type SharedConfigResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesSharedConfig
	JSON401      *ResponsesNotAuthorized
}

// Status returns HTTPResponse.Status
func (r SharedConfigResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r SharedConfigResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r SharedConfigResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r SharedConfigResponse) Bytes() []byte {
	return r.Body
}

type DataByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesGetDataSuccess
	JSON400      *ResponsesUserBadRequest
	JSON401      *ResponsesUserNotAuthorized
	JSON404      *ResponsesGetDataNotFound
	JSON500      *ResponsesInternalServerError
}

// Status returns HTTPResponse.Status
func (r DataByIdResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r DataByIdResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r DataByIdResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r DataByIdResponse) Bytes() []byte {
	return r.Body
}

type MerkleRootsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesGetMerklerootsSuccess
	JSON400      *ResponsesGetMerklerootsBadRequest
	JSON401      *ResponsesUserNotAuthorized
	JSON404      *ResponsesGetMerklerootsNotFound
	JSON409      *ResponsesGetMerklerootsConflict
	JSON500      *ResponsesGetMerklerootsInternalServerError
}

// Status returns HTTPResponse.Status
func (r MerkleRootsResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r MerkleRootsResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r MerkleRootsResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r MerkleRootsResponse) Bytes() []byte {
	return r.Body
}

type SearchOperationsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesSearchOperationsSuccess
	JSON400      *ResponsesSearchBadRequest
	JSON401      *ResponsesUserNotAuthorized
	JSON500      *ResponsesInternalServerError
}

// Status returns HTTPResponse.Status
func (r SearchOperationsResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r SearchOperationsResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r SearchOperationsResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r SearchOperationsResponse) Bytes() []byte {
	return r.Body
}

type RecordTransactionOutlineResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *ResponsesRecordTransactionSuccess
	JSON400      *ResponsesRecordTransactionBadRequest
	JSON401      *ResponsesUserNotAuthorized
	JSON500      *ResponsesRecordTransactionInternalServerError
}

// Status returns HTTPResponse.Status
func (r RecordTransactionOutlineResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r RecordTransactionOutlineResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r RecordTransactionOutlineResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r RecordTransactionOutlineResponse) Bytes() []byte {
	return r.Body
}

type CreateTransactionOutlineResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesCreateTransactionOutlineSuccess
	JSON400      *ResponsesCreateTransactionOutlineBadRequest
	JSON401      *ResponsesUserNotAuthorized
	JSON422      *ResponsesCreateTransactionOutlineUnprocessable
	JSON500      *ResponsesInternalServerError
}

// Status returns HTTPResponse.Status
func (r CreateTransactionOutlineResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CreateTransactionOutlineResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r CreateTransactionOutlineResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r CreateTransactionOutlineResponse) Bytes() []byte {
	return r.Body
}

type CurrentUserResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *ResponsesGetCurrentUserSuccess
	JSON401      *ResponsesUserNotAuthorized
	JSON500      *ResponsesInternalServerError
}

// Status returns HTTPResponse.Status
func (r CurrentUserResponse) Status() string {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.Status
	}
	return http.StatusText(0)
}

// StatusCode returns HTTPResponse.StatusCode
func (r CurrentUserResponse) StatusCode() int {
	if r.HTTPResponse != nil {
		return r.HTTPResponse.StatusCode
	}
	return 0
}

// HTTPResponse returns http.Response from which this response was parsed.
func (r CurrentUserResponse) Response() *http.Response {
	return r.HTTPResponse
}

// Bytes is a convenience method to retrieve the raw bytes from the HTTP response
func (r CurrentUserResponse) Bytes() []byte {
	return r.Body
}

// AdminStatusWithResponse request returning *AdminStatusResponse
func (c *ClientWithResponses) AdminStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AdminStatusResponse, error) {
	rsp, err := c.AdminStatus(ctx, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseAdminStatusResponse(rsp)
}

// CreateUserWithBodyWithResponse request with arbitrary body returning *CreateUserResponse
func (c *ClientWithResponses) CreateUserWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) {
	rsp, err := c.CreateUserWithBody(ctx, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateUserResponse(rsp)
}

func (c *ClientWithResponses) CreateUserWithResponse(ctx context.Context, body CreateUserJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateUserResponse, error) {
	rsp, err := c.CreateUser(ctx, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateUserResponse(rsp)
}

// UserByIdWithResponse request returning *UserByIdResponse
func (c *ClientWithResponses) UserByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*UserByIdResponse, error) {
	rsp, err := c.UserById(ctx, id, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseUserByIdResponse(rsp)
}

// AddPaymailToUserWithBodyWithResponse request with arbitrary body returning *AddPaymailToUserResponse
func (c *ClientWithResponses) AddPaymailToUserWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AddPaymailToUserResponse, error) {
	rsp, err := c.AddPaymailToUserWithBody(ctx, id, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseAddPaymailToUserResponse(rsp)
}

func (c *ClientWithResponses) AddPaymailToUserWithResponse(ctx context.Context, id string, body AddPaymailToUserJSONRequestBody, reqEditors ...RequestEditorFn) (*AddPaymailToUserResponse, error) {
	rsp, err := c.AddPaymailToUser(ctx, id, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseAddPaymailToUserResponse(rsp)
}

// SharedConfigWithResponse request returning *SharedConfigResponse
func (c *ClientWithResponses) SharedConfigWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*SharedConfigResponse, error) {
	rsp, err := c.SharedConfig(ctx, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseSharedConfigResponse(rsp)
}

// DataByIdWithResponse request returning *DataByIdResponse
func (c *ClientWithResponses) DataByIdWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DataByIdResponse, error) {
	rsp, err := c.DataById(ctx, id, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseDataByIdResponse(rsp)
}

// MerkleRootsWithResponse request returning *MerkleRootsResponse
func (c *ClientWithResponses) MerkleRootsWithResponse(ctx context.Context, params *MerkleRootsParams, reqEditors ...RequestEditorFn) (*MerkleRootsResponse, error) {
	rsp, err := c.MerkleRoots(ctx, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseMerkleRootsResponse(rsp)
}

// SearchOperationsWithResponse request returning *SearchOperationsResponse
func (c *ClientWithResponses) SearchOperationsWithResponse(ctx context.Context, params *SearchOperationsParams, reqEditors ...RequestEditorFn) (*SearchOperationsResponse, error) {
	rsp, err := c.SearchOperations(ctx, params, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseSearchOperationsResponse(rsp)
}

// RecordTransactionOutlineWithBodyWithResponse request with arbitrary body returning *RecordTransactionOutlineResponse
func (c *ClientWithResponses) RecordTransactionOutlineWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RecordTransactionOutlineResponse, error) {
	rsp, err := c.RecordTransactionOutlineWithBody(ctx, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseRecordTransactionOutlineResponse(rsp)
}

func (c *ClientWithResponses) RecordTransactionOutlineWithResponse(ctx context.Context, body RecordTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*RecordTransactionOutlineResponse, error) {
	rsp, err := c.RecordTransactionOutline(ctx, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseRecordTransactionOutlineResponse(rsp)
}

// CreateTransactionOutlineWithBodyWithResponse request with arbitrary body returning *CreateTransactionOutlineResponse
func (c *ClientWithResponses) CreateTransactionOutlineWithBodyWithResponse(ctx context.Context, params *CreateTransactionOutlineParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTransactionOutlineResponse, error) {
	rsp, err := c.CreateTransactionOutlineWithBody(ctx, params, contentType, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateTransactionOutlineResponse(rsp)
}

func (c *ClientWithResponses) CreateTransactionOutlineWithResponse(ctx context.Context, params *CreateTransactionOutlineParams, body CreateTransactionOutlineJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTransactionOutlineResponse, error) {
	rsp, err := c.CreateTransactionOutline(ctx, params, body, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCreateTransactionOutlineResponse(rsp)
}

// CurrentUserWithResponse request returning *CurrentUserResponse
func (c *ClientWithResponses) CurrentUserWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CurrentUserResponse, error) {
	rsp, err := c.CurrentUser(ctx, reqEditors...)
	if err != nil {
		return nil, err
	}
	return ParseCurrentUserResponse(rsp)
}

// ParseAdminStatusResponse parses an HTTP response from a AdminStatusWithResponse call
func ParseAdminStatusResponse(rsp *http.Response) (*AdminStatusResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &AdminStatusResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesNotAuthorizedToAdminEndpoint
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	}

	return response, nil
}

// ParseCreateUserResponse parses an HTTP response from a CreateUserWithResponse call
func ParseCreateUserResponse(rsp *http.Response) (*CreateUserResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &CreateUserResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
		var dest ResponsesAdminCreateUserSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON201 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesAdminUserBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesNotAuthorizedToAdminEndpoint
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422:
		var dest ResponsesAdminInvalidAvatarURL
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON422 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesAdminCreateUserInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseUserByIdResponse parses an HTTP response from a UserByIdWithResponse call
func ParseUserByIdResponse(rsp *http.Response) (*UserByIdResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &UserByIdResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesAdminGetUser
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesAdminGetUserInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseAddPaymailToUserResponse parses an HTTP response from a AddPaymailToUserWithResponse call
func ParseAddPaymailToUserResponse(rsp *http.Response) (*AddPaymailToUserResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &AddPaymailToUserResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
		var dest ResponsesAdminAddPaymailSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON201 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesAdminUserBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesNotAuthorizedToAdminEndpoint
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422:
		var dest ResponsesAdminInvalidAvatarURL
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON422 = &dest

	}

	return response, nil
}

// ParseSharedConfigResponse parses an HTTP response from a SharedConfigWithResponse call
func ParseSharedConfigResponse(rsp *http.Response) (*SharedConfigResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &SharedConfigResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesSharedConfig
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	}

	return response, nil
}

// ParseDataByIdResponse parses an HTTP response from a DataByIdWithResponse call
func ParseDataByIdResponse(rsp *http.Response) (*DataByIdResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &DataByIdResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesGetDataSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesUserBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesUserNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
		var dest ResponsesGetDataNotFound
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseMerkleRootsResponse parses an HTTP response from a MerkleRootsWithResponse call
func ParseMerkleRootsResponse(rsp *http.Response) (*MerkleRootsResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &MerkleRootsResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesGetMerklerootsSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesGetMerklerootsBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesUserNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
		var dest ResponsesGetMerklerootsNotFound
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON404 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
		var dest ResponsesGetMerklerootsConflict
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON409 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesGetMerklerootsInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseSearchOperationsResponse parses an HTTP response from a SearchOperationsWithResponse call
func ParseSearchOperationsResponse(rsp *http.Response) (*SearchOperationsResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &SearchOperationsResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesSearchOperationsSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesSearchBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesUserNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseRecordTransactionOutlineResponse parses an HTTP response from a RecordTransactionOutlineWithResponse call
func ParseRecordTransactionOutlineResponse(rsp *http.Response) (*RecordTransactionOutlineResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &RecordTransactionOutlineResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
		var dest ResponsesRecordTransactionSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON201 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesRecordTransactionBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesUserNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesRecordTransactionInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseCreateTransactionOutlineResponse parses an HTTP response from a CreateTransactionOutlineWithResponse call
func ParseCreateTransactionOutlineResponse(rsp *http.Response) (*CreateTransactionOutlineResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &CreateTransactionOutlineResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesCreateTransactionOutlineSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
		var dest ResponsesCreateTransactionOutlineBadRequest
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON400 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesUserNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 422:
		var dest ResponsesCreateTransactionOutlineUnprocessable
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON422 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}

// ParseCurrentUserResponse parses an HTTP response from a CurrentUserWithResponse call
func ParseCurrentUserResponse(rsp *http.Response) (*CurrentUserResponse, error) {
	bodyBytes, err := io.ReadAll(rsp.Body)
	defer func() { _ = rsp.Body.Close() }()
	if err != nil {
		return nil, err
	}

	response := &CurrentUserResponse{
		Body:         bodyBytes,
		HTTPResponse: rsp,
	}

	switch {
	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
		var dest ResponsesGetCurrentUserSuccess
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON200 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
		var dest ResponsesUserNotAuthorized
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON401 = &dest

	case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500:
		var dest ResponsesInternalServerError
		if err := json.Unmarshal(bodyBytes, &dest); err != nil {
			return nil, err
		}
		response.JSON500 = &dest

	}

	return response, nil
}
