"use strict";
/**
 * This code was AUTOGENERATED using the kinobi library.
 * Please DO NOT EDIT THIS FILE, instead use visitors
 * to add features, then rerun kinobi to update it.
 *
 * @see https://github.com/metaplex-foundation/kinobi
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDelegateArgs = exports.delegateArgs = exports.getDelegateArgsSerializer = void 0;
const umi_1 = require("@metaplex-foundation/umi");
const serializers_1 = require("@metaplex-foundation/umi/serializers");
const _1 = require(".");
function getDelegateArgsSerializer() {
    return (0, serializers_1.dataEnum)([
        [
            'CollectionV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'SaleV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['amount', (0, serializers_1.u64)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                amount: value.amount ?? 1,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'TransferV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['amount', (0, serializers_1.u64)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                amount: value.amount ?? 1,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'DataV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'UtilityV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['amount', (0, serializers_1.u64)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                amount: value.amount ?? 1,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'StakingV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['amount', (0, serializers_1.u64)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                amount: value.amount ?? 1,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'StandardV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['amount', (0, serializers_1.u64)()],
            ]), (value) => ({ ...value, amount: value.amount ?? 1 })),
        ],
        [
            'LockedTransferV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['amount', (0, serializers_1.u64)()],
                ['lockedAddress', (0, serializers_1.publicKey)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                amount: value.amount ?? 1,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'ProgrammableConfigV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AuthorityItemV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'DataItemV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'CollectionItemV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'ProgrammableConfigItemV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())]]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'PrintDelegateV1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
    ], { description: 'DelegateArgs' });
}
exports.getDelegateArgsSerializer = getDelegateArgsSerializer;
function delegateArgs(kind, data) {
    return Array.isArray(data)
        ? { __kind: kind, fields: data }
        : { __kind: kind, ...(data ?? {}) };
}
exports.delegateArgs = delegateArgs;
function isDelegateArgs(kind, value) {
    return value.__kind === kind;
}
exports.isDelegateArgs = isDelegateArgs;
//# sourceMappingURL=delegateArgs.js.map