"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.isUpdateArgs = exports.updateArgs = exports.getUpdateArgsSerializer = void 0;
const umi_1 = require("@metaplex-foundation/umi");
const serializers_1 = require("@metaplex-foundation/umi/serializers");
const _1 = require(".");
function getUpdateArgsSerializer() {
    return (0, serializers_1.dataEnum)([
        [
            'V1',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['newUpdateAuthority', (0, serializers_1.option)((0, serializers_1.publicKey)())],
                ['data', (0, serializers_1.option)((0, _1.getDataSerializer)())],
                ['primarySaleHappened', (0, serializers_1.option)((0, serializers_1.bool)())],
                ['isMutable', (0, serializers_1.option)((0, serializers_1.bool)())],
                ['collection', (0, _1.getCollectionToggleSerializer)()],
                ['collectionDetails', (0, _1.getCollectionDetailsToggleSerializer)()],
                ['uses', (0, _1.getUsesToggleSerializer)()],
                ['ruleSet', (0, _1.getRuleSetToggleSerializer)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                newUpdateAuthority: value.newUpdateAuthority ?? (0, umi_1.none)(),
                data: value.data ?? (0, umi_1.none)(),
                primarySaleHappened: value.primarySaleHappened ?? (0, umi_1.none)(),
                isMutable: value.isMutable ?? (0, umi_1.none)(),
                collection: value.collection ?? (0, _1.collectionToggle)('None'),
                collectionDetails: value.collectionDetails ?? (0, _1.collectionDetailsToggle)('None'),
                uses: value.uses ?? (0, _1.usesToggle)('None'),
                ruleSet: value.ruleSet ?? (0, _1.ruleSetToggle)('None'),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsUpdateAuthorityV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['newUpdateAuthority', (0, serializers_1.option)((0, serializers_1.publicKey)())],
                ['data', (0, serializers_1.option)((0, _1.getDataSerializer)())],
                ['primarySaleHappened', (0, serializers_1.option)((0, serializers_1.bool)())],
                ['isMutable', (0, serializers_1.option)((0, serializers_1.bool)())],
                ['collection', (0, _1.getCollectionToggleSerializer)()],
                ['collectionDetails', (0, _1.getCollectionDetailsToggleSerializer)()],
                ['uses', (0, _1.getUsesToggleSerializer)()],
                ['ruleSet', (0, _1.getRuleSetToggleSerializer)()],
                ['tokenStandard', (0, serializers_1.option)((0, _1.getTokenStandardSerializer)())],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                newUpdateAuthority: value.newUpdateAuthority ?? (0, umi_1.none)(),
                data: value.data ?? (0, umi_1.none)(),
                primarySaleHappened: value.primarySaleHappened ?? (0, umi_1.none)(),
                isMutable: value.isMutable ?? (0, umi_1.none)(),
                collection: value.collection ?? (0, _1.collectionToggle)('None'),
                collectionDetails: value.collectionDetails ?? (0, _1.collectionDetailsToggle)('None'),
                uses: value.uses ?? (0, _1.usesToggle)('None'),
                ruleSet: value.ruleSet ?? (0, _1.ruleSetToggle)('None'),
                tokenStandard: value.tokenStandard ?? (0, umi_1.none)(),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsAuthorityItemDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['newUpdateAuthority', (0, serializers_1.option)((0, serializers_1.publicKey)())],
                ['primarySaleHappened', (0, serializers_1.option)((0, serializers_1.bool)())],
                ['isMutable', (0, serializers_1.option)((0, serializers_1.bool)())],
                ['tokenStandard', (0, serializers_1.option)((0, _1.getTokenStandardSerializer)())],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                newUpdateAuthority: value.newUpdateAuthority ?? (0, umi_1.none)(),
                primarySaleHappened: value.primarySaleHappened ?? (0, umi_1.none)(),
                isMutable: value.isMutable ?? (0, umi_1.none)(),
                tokenStandard: value.tokenStandard ?? (0, umi_1.none)(),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsCollectionDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['collection', (0, _1.getCollectionToggleSerializer)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                collection: value.collection ?? (0, _1.collectionToggle)('None'),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsDataDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['data', (0, serializers_1.option)((0, _1.getDataSerializer)())],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                data: value.data ?? (0, umi_1.none)(),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsProgrammableConfigDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['ruleSet', (0, _1.getRuleSetToggleSerializer)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                ruleSet: value.ruleSet ?? (0, _1.ruleSetToggle)('None'),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsDataItemDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['data', (0, serializers_1.option)((0, _1.getDataSerializer)())],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                data: value.data ?? (0, umi_1.none)(),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsCollectionItemDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['collection', (0, _1.getCollectionToggleSerializer)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                collection: value.collection ?? (0, _1.collectionToggle)('None'),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
        [
            'AsProgrammableConfigItemDelegateV2',
            (0, serializers_1.mapSerializer)((0, serializers_1.struct)([
                ['ruleSet', (0, _1.getRuleSetToggleSerializer)()],
                ['authorizationData', (0, serializers_1.option)((0, _1.getAuthorizationDataSerializer)())],
            ]), (value) => ({
                ...value,
                ruleSet: value.ruleSet ?? (0, _1.ruleSetToggle)('None'),
                authorizationData: value.authorizationData ?? (0, umi_1.none)(),
            })),
        ],
    ], { description: 'UpdateArgs' });
}
exports.getUpdateArgsSerializer = getUpdateArgsSerializer;
function updateArgs(kind, data) {
    return Array.isArray(data)
        ? { __kind: kind, fields: data }
        : { __kind: kind, ...(data ?? {}) };
}
exports.updateArgs = updateArgs;
function isUpdateArgs(kind, value) {
    return value.__kind === kind;
}
exports.isUpdateArgs = isUpdateArgs;
//# sourceMappingURL=updateArgs.js.map