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

import (
	"encoding/json"
	"errors"
	"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
}
