# DefinedFunction

> Type reference for DefinedFunction in the Rippling SDK, including its public shape and related types.

## Type definition

```
export declare class DefinedFunction<TInput = unknown, TOutput = unknown> {
    getApiName(): string;
    setCode(code: string): this;
    toDict(): Config;
    readonly input: ValueParser<TInput> | undefined;
    readonly output: ValueParser<TOutput> | undefined;
    readonly executions: FunctionExecutions;
    get source(): URL | undefined;
    handler(handler: (input: TInput, context: FunctionContext) => TOutput | Promise<TOutput>): (event: TInput, context: FunctionContext) => Promise<import("@rippling/rippling-sdk").FunctionResponse<TOutput>>;
    execute(ctx: FunctionOperationsContext, input: TInput, options?: RequestOptions): Promise<FunctionExecutionResult<TInput, TOutput>>;
    constructor(props: DefinedFunctionProps<TInput, TOutput>);
}
```

## Related types

-   [ValueParser](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/ValueParser-ce5d7cd9)
-   [FunctionExecutions](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FunctionExecutions-b77154a4)
-   [FunctionOperationsContext](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FunctionOperationsContext-1a57fff4)
-   [FunctionExecutionResult](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/FunctionExecutionResult-457802a1)
-   [DefinedFunctionProps](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefinedFunctionProps-5114fb35)

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefinedFunction-a7c0455d

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
