"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.isUseArgs = exports.useArgs = exports.getUseArgsSerializer = void 0;
const umi_1 = require("@metaplex-foundation/umi");
const serializers_1 = require("@metaplex-foundation/umi/serializers");
const _1 = require(".");
function getUseArgsSerializer() {
    return (0, serializers_1.dataEnum)([
        [
            'V1',
            (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: 'UseArgs' });
}
exports.getUseArgsSerializer = getUseArgsSerializer;
function useArgs(kind, data) {
    return Array.isArray(data)
        ? { __kind: kind, fields: data }
        : { __kind: kind, ...(data ?? {}) };
}
exports.useArgs = useArgs;
function isUseArgs(kind, value) {
    return value.__kind === kind;
}
exports.isUseArgs = isUseArgs;
//# sourceMappingURL=useArgs.js.map