diff --git a/packages/mcp-server/src/local-docs-search.ts b/packages/mcp-server/src/local-docs-search.ts index dbd50cdb..48939c3a 100644 --- a/packages/mcp-server/src/local-docs-search.ts +++ b/packages/mcp-server/src/local-docs-search.ts @@ -64,16 +64,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.accessTokens.create(code: string, client_id?: string, client_secret?: string, redirect_uri?: string): { access_token: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_type: 'finch' | 'provider'; entity_ids: string[]; products: string[]; provider_id: string; token_type: string; account_id?: string; company_id?: string; customer_id?: string; customer_name?: string; }`\n\n**post** `/auth/token`\n\nExchange the authorization code for an access token\n\n### Parameters\n\n- `code: string`\n The authorization code received from the authorization server\n\n- `client_id?: string`\n The client ID for your application\n\n- `client_secret?: string`\n The client secret for your application\n\n- `redirect_uri?: string`\n The redirect URI used in the authorization request (optional)\n\n### Returns\n\n- `{ access_token: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_type: 'finch' | 'provider'; entity_ids: string[]; products: string[]; provider_id: string; token_type: string; account_id?: string; company_id?: string; customer_id?: string; customer_name?: string; }`\n\n - `access_token: string`\n - `client_type: 'development' | 'production' | 'sandbox'`\n - `connection_id: string`\n - `connection_type: 'finch' | 'provider'`\n - `entity_ids: string[]`\n - `products: string[]`\n - `provider_id: string`\n - `token_type: string`\n - `account_id?: string`\n - `company_id?: string`\n - `customer_id?: string`\n - `customer_name?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst createAccessTokenResponse = await client.accessTokens.create({ code: 'code' });\n\nconsole.log(createAccessTokenResponse);\n```", perLanguage: { - go: { - method: 'client.AccessTokens.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tcreateAccessTokenResponse, err := client.AccessTokens.New(context.TODO(), finchgo.AccessTokenNewParams{\n\t\tCode: finchgo.F("code"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", createAccessTokenResponse.ConnectionID)\n}\n', - }, java: { method: 'accessTokens().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccessTokenCreateParams;\nimport com.tryfinch.api.models.CreateAccessTokenResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n AccessTokenCreateParams params = AccessTokenCreateParams.builder()\n .code("code")\n .build();\n CreateAccessTokenResponse createAccessTokenResponse = client.accessTokens().create(params);\n }\n}', }, + go: { + method: 'client.AccessTokens.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tcreateAccessTokenResponse, err := client.AccessTokens.New(context.TODO(), finchgo.AccessTokenNewParams{\n\t\tCode: finchgo.F("code"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", createAccessTokenResponse.ConnectionID)\n}\n', + }, kotlin: { method: 'accessTokens().create', example: @@ -114,16 +114,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve\n\n`client.hris.company.retrieve(entity_ids?: string[]): { id: string; accounts: object[]; departments: object[]; ein: string; entity: object; legal_name: string; locations: location[]; primary_email: string; primary_phone_number: string; }`\n\n**get** `/employer/company`\n\nRead basic company data\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ id: string; accounts: { account_name: string; account_number: string; account_type: 'checking' | 'savings'; institution_name: string; routing_number: string; }[]; departments: { name: string; parent: { name: string; }; }[]; ein: string; entity: { subtype: 's_corporation' | 'c_corporation' | 'b_corporation'; type: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }; legal_name: string; locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]; primary_email: string; primary_phone_number: string; }`\n\n - `id: string`\n - `accounts: { account_name: string; account_number: string; account_type: 'checking' | 'savings'; institution_name: string; routing_number: string; }[]`\n - `departments: { name: string; parent: { name: string; }; }[]`\n - `ein: string`\n - `entity: { subtype: 's_corporation' | 'c_corporation' | 'b_corporation'; type: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }`\n - `legal_name: string`\n - `locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]`\n - `primary_email: string`\n - `primary_phone_number: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst company = await client.hris.company.retrieve();\n\nconsole.log(company);\n```", perLanguage: { - go: { - method: 'client.HRIS.Company.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompany, err := client.HRIS.Company.Get(context.TODO(), finchgo.HRISCompanyGetParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", company.ID)\n}\n', - }, java: { method: 'hris().company().retrieve', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.Company;\nimport com.tryfinch.api.models.HrisCompanyRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n Company company = client.hris().company().retrieve();\n }\n}', }, + go: { + method: 'client.HRIS.Company.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompany, err := client.HRIS.Company.Get(context.TODO(), finchgo.HRISCompanyGetParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", company.ID)\n}\n', + }, kotlin: { method: 'hris().company().retrieve', example: @@ -172,16 +172,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.hris.payStatementItem.list(categories?: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'[], end_date?: string, entity_ids?: string[], name?: string, start_date?: string, type?: string): { attributes: object; category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'; name: string; }`\n\n**get** `/employer/pay-statement-item`\n\nRetrieve a list of detailed pay statement items for the access token's connection account.\n\n\n### Parameters\n\n- `categories?: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'[]`\n Comma-delimited list of pay statement item categories to filter on. If empty, defaults to all categories.\n\n- `end_date?: string`\n The end date to retrieve pay statement items by via their last seen pay date in `YYYY-MM-DD` format.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `name?: string`\n Case-insensitive partial match search by pay statement item name.\n\n- `start_date?: string`\n The start date to retrieve pay statement items by via their last seen pay date (inclusive) in `YYYY-MM-DD` format.\n\n- `type?: string`\n String search by pay statement item type.\n\n### Returns\n\n- `{ attributes: { metadata: object; employer?: boolean; pre_tax?: boolean; type?: string; }; category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'; name: string; }`\n\n - `attributes: { metadata: object; employer?: boolean; pre_tax?: boolean; type?: string; }`\n - `category: 'earnings' | 'taxes' | 'employee_deductions' | 'employer_contributions'`\n - `name: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payStatementItemListResponse of client.hris.payStatementItem.list()) {\n console.log(payStatementItemListResponse);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.PayStatementItem.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatementItem.List(context.TODO(), finchgo.HRISPayStatementItemListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().payStatementItem().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementItemListPage;\nimport com.tryfinch.api.models.HrisPayStatementItemListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisPayStatementItemListPage page = client.hris().payStatementItem().list();\n }\n}', }, + go: { + method: 'client.HRIS.PayStatementItem.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatementItem.List(context.TODO(), finchgo.HRISPayStatementItemListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().payStatementItem().list', example: @@ -230,16 +230,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.hris.payStatementItem.rules.create(entity_ids?: string[], attributes?: { metadata?: object; }, conditions?: { field?: string; operator?: 'equals'; value?: string; }[], effective_end_date?: string, effective_start_date?: string, entity_type?: 'pay_statement_item'): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**post** `/employer/pay-statement-item/rule`\n\nCustom rules can be created to associate specific attributes to pay statement items depending on the use case. For example, pay statement items that meet certain conditions can be labeled as a pre-tax 401k. This metadata can be retrieved where pay statement item information is available.\n\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to create the rule for. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `attributes?: { metadata?: object; }`\n Specifies the fields to be applied when the condition is met.\n - `metadata?: object`\n The metadata to be attached in the entity. It is a key-value pairs where the values can be of any type (string, number, boolean, object, array, etc.).\n\n- `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n\n- `effective_end_date?: string`\n Specifies when the rules should stop applying rules based on the date.\n\n- `effective_start_date?: string`\n Specifies when the rule should begin applying based on the date.\n\n- `entity_type?: 'pay_statement_item'`\n The entity type to which the rule is applied.\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst rule = await client.hris.payStatementItem.rules.create();\n\nconsole.log(rule);\n```", perLanguage: { - go: { - method: 'client.HRIS.PayStatementItem.Rules.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.PayStatementItem.Rules.New(context.TODO(), finchgo.HRISPayStatementItemRuleNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n', - }, java: { method: 'hris().payStatementItem().rules().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementItemRuleCreateParams;\nimport com.tryfinch.api.models.RuleCreateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RuleCreateResponse rule = client.hris().payStatementItem().rules().create();\n }\n}', }, + go: { + method: 'client.HRIS.PayStatementItem.Rules.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.PayStatementItem.Rules.New(context.TODO(), finchgo.HRISPayStatementItemRuleNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n', + }, kotlin: { method: 'hris().payStatementItem().rules().create', example: @@ -280,16 +280,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.hris.payStatementItem.rules.list(entity_ids?: string[]): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**get** `/employer/pay-statement-item/rule`\n\nList all rules of a connection account.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to retrieve rules for. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const ruleListResponse of client.hris.payStatementItem.rules.list()) {\n console.log(ruleListResponse);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.PayStatementItem.Rules.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatementItem.Rules.List(context.TODO(), finchgo.HRISPayStatementItemRuleListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().payStatementItem().rules().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementItemRuleListPage;\nimport com.tryfinch.api.models.HrisPayStatementItemRuleListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisPayStatementItemRuleListPage page = client.hris().payStatementItem().rules().list();\n }\n}', }, + go: { + method: 'client.HRIS.PayStatementItem.Rules.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatementItem.Rules.List(context.TODO(), finchgo.HRISPayStatementItemRuleListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().payStatementItem().rules().list', example: @@ -330,16 +330,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.hris.payStatementItem.rules.update(rule_id: string, entity_ids?: string[], optionalProperty?: object): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**put** `/employer/pay-statement-item/rule/{rule_id}`\n\nUpdate a rule for a pay statement item.\n\n### Parameters\n\n- `rule_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to update the rule for. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `optionalProperty?: object`\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst rule = await client.hris.payStatementItem.rules.update('rule_id');\n\nconsole.log(rule);\n```", perLanguage: { - go: { - method: 'client.HRIS.PayStatementItem.Rules.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.PayStatementItem.Rules.Update(\n\t\tcontext.TODO(),\n\t\t"rule_id",\n\t\tfinchgo.HRISPayStatementItemRuleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n', - }, java: { method: 'hris().payStatementItem().rules().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementItemRuleUpdateParams;\nimport com.tryfinch.api.models.RuleUpdateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RuleUpdateResponse rule = client.hris().payStatementItem().rules().update("rule_id");\n }\n}', }, + go: { + method: 'client.HRIS.PayStatementItem.Rules.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.PayStatementItem.Rules.Update(\n\t\tcontext.TODO(),\n\t\t"rule_id",\n\t\tfinchgo.HRISPayStatementItemRuleUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n', + }, kotlin: { method: 'hris().payStatementItem().rules().update', example: @@ -380,16 +380,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## delete\n\n`client.hris.payStatementItem.rules.delete(rule_id: string, entity_ids?: string[]): { id?: string; attributes?: object; conditions?: object[]; created_at?: string; deleted_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n**delete** `/employer/pay-statement-item/rule/{rule_id}`\n\nDelete a rule for a pay statement item.\n\n### Parameters\n\n- `rule_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to delete the rule for. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ id?: string; attributes?: { metadata?: object; }; conditions?: { field?: string; operator?: 'equals'; value?: string; }[]; created_at?: string; deleted_at?: string; effective_end_date?: string; effective_start_date?: string; entity_type?: 'pay_statement_item'; priority?: number; updated_at?: string; }`\n\n - `id?: string`\n - `attributes?: { metadata?: object; }`\n - `conditions?: { field?: string; operator?: 'equals'; value?: string; }[]`\n - `created_at?: string`\n - `deleted_at?: string`\n - `effective_end_date?: string`\n - `effective_start_date?: string`\n - `entity_type?: 'pay_statement_item'`\n - `priority?: number`\n - `updated_at?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst rule = await client.hris.payStatementItem.rules.delete('rule_id');\n\nconsole.log(rule);\n```", perLanguage: { - go: { - method: 'client.HRIS.PayStatementItem.Rules.Delete', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.PayStatementItem.Rules.Delete(\n\t\tcontext.TODO(),\n\t\t"rule_id",\n\t\tfinchgo.HRISPayStatementItemRuleDeleteParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n', - }, java: { method: 'hris().payStatementItem().rules().delete', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementItemRuleDeleteParams;\nimport com.tryfinch.api.models.RuleDeleteResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RuleDeleteResponse rule = client.hris().payStatementItem().rules().delete("rule_id");\n }\n}', }, + go: { + method: 'client.HRIS.PayStatementItem.Rules.Delete', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\trule, err := client.HRIS.PayStatementItem.Rules.Delete(\n\t\tcontext.TODO(),\n\t\t"rule_id",\n\t\tfinchgo.HRISPayStatementItemRuleDeleteParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", rule.ID)\n}\n', + }, kotlin: { method: 'hris().payStatementItem().rules().delete', example: @@ -430,16 +430,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.hris.directory.list(entity_ids?: string[], limit?: number, offset?: number): { id: string; department: object; first_name: string; is_active: boolean; last_name: string; manager: object; middle_name: string; }`\n\n**get** `/employer/directory`\n\nRead company directory and organization structure\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `limit?: number`\n Number of employees to return (defaults to 100, maximum 10000)\n\n- `offset?: number`\n Index to start from (defaults to 0)\n\n### Returns\n\n- `{ id: string; department: { name?: string; }; first_name: string; is_active: boolean; last_name: string; manager: { id: string; }; middle_name: string; }`\n\n - `id: string`\n - `department: { name?: string; }`\n - `first_name: string`\n - `is_active: boolean`\n - `last_name: string`\n - `manager: { id: string; }`\n - `middle_name: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const individualInDirectory of client.hris.directory.list()) {\n console.log(individualInDirectory);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Directory.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().directory().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisDirectoryListPage page = client.hris().directory().list();\n }\n}', }, + go: { + method: 'client.HRIS.Directory.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().directory().list', example: @@ -475,16 +475,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ stainlessPath: '(resource) hris.directory > (method) list_individuals', qualified: 'client.hris.directory.listIndividuals', perLanguage: { - go: { - method: 'client.HRIS.Directory.ListIndividuals', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.ListIndividuals(context.TODO(), finchgo.HRISDirectoryListIndividualsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().directory().listIndividuals', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListIndividualsPage;\nimport com.tryfinch.api.models.HrisDirectoryListIndividualsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisDirectoryListIndividualsPage page = client.hris().directory().listIndividuals();\n }\n}', }, + go: { + method: 'client.HRIS.Directory.ListIndividuals', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.ListIndividuals(context.TODO(), finchgo.HRISDirectoryListIndividualsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().directory().listIndividuals', example: @@ -525,16 +525,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve_many\n\n`client.hris.individuals.retrieveMany(requests: { individual_id: string; }[], entity_ids?: string[], options?: { include?: string[]; }): { body: individual; code: number; individual_id: string; }`\n\n**post** `/employer/individual`\n\nRead individual data, excluding income and employment data\n\n### Parameters\n\n- `requests: { individual_id: string; }[]`\n The array of batch requests. Maximum 10000 items per request.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `options?: { include?: string[]; }`\n - `include?: string[]`\n\n### Returns\n\n- `{ body: { id: string; dob: string; ethnicity: string; first_name: string; gender: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name: string; marital_status: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'; middle_name: string; phone_numbers: object[]; preferred_name: string; residence: location; emails?: object[]; encrypted_ssn?: string; ssn?: string; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }`\n\n - `body: { id: string; dob: string; ethnicity: string; first_name: string; gender: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name: string; marital_status: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'; middle_name: string; phone_numbers: { data: string; type: 'work' | 'personal'; }[]; preferred_name: string; residence: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; emails?: { data: string; type: 'work' | 'personal'; }[]; encrypted_ssn?: string; ssn?: string; } | { code: number; message: string; name: string; finch_code?: string; }`\n - `code: number`\n - `individual_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const individualResponse of client.hris.individuals.retrieveMany({ requests: [{ individual_id: 'individual_id' }] })) {\n console.log(individualResponse);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Individuals.GetMany', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Individuals.GetMany(context.TODO(), finchgo.HRISIndividualGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISIndividualGetManyParamsRequest{{\n\t\t\tIndividualID: finchgo.F("individual_id"),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().individuals().retrieveMany', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisIndividualRetrieveManyPage;\nimport com.tryfinch.api.models.HrisIndividualRetrieveManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisIndividualRetrieveManyParams params = HrisIndividualRetrieveManyParams.builder()\n .addRequest(HrisIndividualRetrieveManyParams.Request.builder()\n .individualId("individual_id")\n .build())\n .build();\n HrisIndividualRetrieveManyPage page = client.hris().individuals().retrieveMany(params);\n }\n}', }, + go: { + method: 'client.HRIS.Individuals.GetMany', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Individuals.GetMany(context.TODO(), finchgo.HRISIndividualGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISIndividualGetManyParamsRequest{{\n\t\t\tIndividualID: finchgo.F("individual_id"),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().individuals().retrieveMany', example: @@ -575,16 +575,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve_many\n\n`client.hris.employments.retrieveMany(requests: { individual_id: string; }[], entity_ids?: string[]): { body: employment_data; code: number; individual_id: string; }`\n\n**post** `/employer/employment`\n\nRead individual employment and income data\n\n### Parameters\n\n- `requests: { individual_id: string; }[]`\n The array of batch requests. Maximum 10000 items per request.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ body: { id: string; class_code: string; department: object; employment: object; employment_status: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date: string; first_name: string; flsa_status: 'exempt' | 'non_exempt' | 'unknown'; highly_compensated_employee: boolean; is_active: boolean; key_employee: boolean; last_name: string; latest_rehire_date: string; location: location; manager: object; middle_name: string; start_date: string; title: string; union_code: string; union_local: string; custom_fields?: object[]; income?: income; income_history?: income[]; source_id?: string; work_id?: string; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }`\n\n - `body: { id: string; class_code: string; department: { name: string; }; employment: { subtype: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type: 'employee' | 'contractor'; }; employment_status: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date: string; first_name: string; flsa_status: 'exempt' | 'non_exempt' | 'unknown'; highly_compensated_employee: boolean; is_active: boolean; key_employee: boolean; last_name: string; latest_rehire_date: string; location: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; manager: { id: string; }; middle_name: string; start_date: string; title: string; union_code: string; union_local: string; custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]; income?: { amount: number; currency: string; effective_date: string; unit: string; }; income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[]; source_id?: string; work_id?: string; } | { code: number; message: string; name: string; finch_code?: string; }`\n - `code: number`\n - `individual_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const employmentDataResponse of client.hris.employments.retrieveMany({ requests: [{ individual_id: 'individual_id' }] })) {\n console.log(employmentDataResponse);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Employments.GetMany', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Employments.GetMany(context.TODO(), finchgo.HRISEmploymentGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISEmploymentGetManyParamsRequest{{\n\t\t\tIndividualID: finchgo.F("individual_id"),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().employments().retrieveMany', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisEmploymentRetrieveManyPage;\nimport com.tryfinch.api.models.HrisEmploymentRetrieveManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisEmploymentRetrieveManyParams params = HrisEmploymentRetrieveManyParams.builder()\n .addRequest(HrisEmploymentRetrieveManyParams.Request.builder()\n .individualId("individual_id")\n .build())\n .build();\n HrisEmploymentRetrieveManyPage page = client.hris().employments().retrieveMany(params);\n }\n}', }, + go: { + method: 'client.HRIS.Employments.GetMany', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Employments.GetMany(context.TODO(), finchgo.HRISEmploymentGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISEmploymentGetManyParamsRequest{{\n\t\t\tIndividualID: finchgo.F("individual_id"),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().employments().retrieveMany', example: @@ -625,16 +625,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.hris.payments.list(end_date: string, start_date: string, entity_ids?: string[]): { id: string; company_debit: money; debit_date: string; employee_taxes: money; employer_taxes: money; gross_pay: money; individual_ids: string[]; net_pay: money; pay_date: string; pay_frequencies: string[]; pay_group_ids: string[]; pay_period: object; }`\n\n**get** `/employer/payment`\n\nRead payroll and contractor related payments by the company.\n\n### Parameters\n\n- `end_date: string`\n The end date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. Filters payments by their **pay_date** field.\n\n- `start_date: string`\n The start date to retrieve payments by a company (inclusive) in `YYYY-MM-DD` format. Filters payments by their **pay_date** field.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ id: string; company_debit: { amount: number; currency: string; }; debit_date: string; employee_taxes: { amount: number; currency: string; }; employer_taxes: { amount: number; currency: string; }; gross_pay: { amount: number; currency: string; }; individual_ids: string[]; net_pay: { amount: number; currency: string; }; pay_date: string; pay_frequencies: string[]; pay_group_ids: string[]; pay_period: { end_date: string; start_date: string; }; }`\n\n - `id: string`\n - `company_debit: { amount: number; currency: string; }`\n - `debit_date: string`\n - `employee_taxes: { amount: number; currency: string; }`\n - `employer_taxes: { amount: number; currency: string; }`\n - `gross_pay: { amount: number; currency: string; }`\n - `individual_ids: string[]`\n - `net_pay: { amount: number; currency: string; }`\n - `pay_date: string`\n - `pay_frequencies: string[]`\n - `pay_group_ids: string[]`\n - `pay_period: { end_date: string; start_date: string; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payment of client.hris.payments.list({ end_date: '2021-01-01', start_date: '2021-01-01' })) {\n console.log(payment);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Payments.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Payments.List(context.TODO(), finchgo.HRISPaymentListParams{\n\t\tEndDate: finchgo.F(time.Now()),\n\t\tStartDate: finchgo.F(time.Now()),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().payments().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPaymentListPage;\nimport com.tryfinch.api.models.HrisPaymentListParams;\nimport java.time.LocalDate;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisPaymentListParams params = HrisPaymentListParams.builder()\n .endDate(LocalDate.parse("2021-01-01"))\n .startDate(LocalDate.parse("2021-01-01"))\n .build();\n HrisPaymentListPage page = client.hris().payments().list(params);\n }\n}', }, + go: { + method: 'client.HRIS.Payments.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\t"time"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Payments.List(context.TODO(), finchgo.HRISPaymentListParams{\n\t\tEndDate: finchgo.F(time.Now()),\n\t\tStartDate: finchgo.F(time.Now()),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().payments().list', example: @@ -679,16 +679,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve_many\n\n`client.hris.payStatements.retrieveMany(requests: { payment_id: string; limit?: number; offset?: number; }[], entity_ids?: string[]): { body: pay_statement_data | object | pay_statement_data_sync_in_progress; code: number; payment_id: string; }`\n\n**post** `/employer/pay-statement`\n\nRead detailed pay statements for each individual.\n\nDeduction and contribution types are supported by the payroll systems that supports Benefits.\n\n### Parameters\n\n- `requests: { payment_id: string; limit?: number; offset?: number; }[]`\n The array of batch requests. Maximum 10 payment_ids per request.\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ body: { paging: object; pay_statements: pay_statement[]; } | { code: number; message: string; name: string; finch_code?: string; } | { code: 202; finch_code: 'data_sync_in_progress'; message: 'The pay statements for this payment are being fetched. Please check back later.'; name: 'accepted'; }; code: number; payment_id: string; }`\n\n - `body: { paging: { offset: number; count?: number; }; pay_statements: { earnings: object[]; employee_deductions: object[]; employer_contributions: object[]; gross_pay: money; individual_id: string; net_pay: money; payment_method: 'check' | 'direct_deposit' | 'other'; taxes: object[]; total_hours: number; type: 'off_cycle_payroll' | 'one_time_payment' | 'regular_payroll'; }[]; } | { code: number; message: string; name: string; finch_code?: string; } | { code: 202; finch_code: 'data_sync_in_progress'; message: 'The pay statements for this payment are being fetched. Please check back later.'; name: 'accepted'; }`\n - `code: number`\n - `payment_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payStatementResponse of client.hris.payStatements.retrieveMany({ requests: [{ payment_id: 'fc8b024e-d373-4c9c-80fc-f1625383d142' }] })) {\n console.log(payStatementResponse);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.PayStatements.GetMany', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatements.GetMany(context.TODO(), finchgo.HRISPayStatementGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISPayStatementGetManyParamsRequest{{\n\t\t\tPaymentID: finchgo.F("fc8b024e-d373-4c9c-80fc-f1625383d142"),\n\t\t\tLimit: finchgo.F(int64(100)),\n\t\t\tOffset: finchgo.F(int64(0)),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().payStatements().retrieveMany', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisPayStatementRetrieveManyPage;\nimport com.tryfinch.api.models.HrisPayStatementRetrieveManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisPayStatementRetrieveManyParams params = HrisPayStatementRetrieveManyParams.builder()\n .addRequest(HrisPayStatementRetrieveManyParams.Request.builder()\n .paymentId("fc8b024e-d373-4c9c-80fc-f1625383d142")\n .build())\n .build();\n HrisPayStatementRetrieveManyPage page = client.hris().payStatements().retrieveMany(params);\n }\n}', }, + go: { + method: 'client.HRIS.PayStatements.GetMany', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.PayStatements.GetMany(context.TODO(), finchgo.HRISPayStatementGetManyParams{\n\t\tRequests: finchgo.F([]finchgo.HRISPayStatementGetManyParamsRequest{{\n\t\t\tPaymentID: finchgo.F("fc8b024e-d373-4c9c-80fc-f1625383d142"),\n\t\t\tLimit: finchgo.F(int64(100)),\n\t\t\tOffset: finchgo.F(int64(0)),\n\t\t}}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().payStatements().retrieveMany', example: @@ -736,16 +736,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.hris.documents.list(entity_ids?: string[], individual_ids?: string[], limit?: number, offset?: number, types?: 'w4_2020' | 'w4_2005'[]): { documents: document_response[]; paging: paging; }`\n\n**get** `/employer/documents`\n\n**Beta:** This endpoint is in beta and may change.\nRetrieve a list of company-wide documents.\n\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `individual_ids?: string[]`\n Comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all individuals\n\n- `limit?: number`\n Number of documents to return (defaults to all)\n\n- `offset?: number`\n Index to start from (defaults to 0)\n\n- `types?: 'w4_2020' | 'w4_2005'[]`\n Comma-delimited list of document types to filter on. If empty, defaults to all types\n\n### Returns\n\n- `{ documents: { id: string; individual_id: string; type: 'w4_2020' | 'w4_2005'; url: string; year: number; }[]; paging: { offset: number; count?: number; }; }`\n\n - `documents: { id: string; individual_id: string; type: 'w4_2020' | 'w4_2005'; url: string; year: number; }[]`\n - `paging: { offset: number; count?: number; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst documents = await client.hris.documents.list();\n\nconsole.log(documents);\n```", perLanguage: { - go: { - method: 'client.HRIS.Documents.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdocuments, err := client.HRIS.Documents.List(context.TODO(), finchgo.HRISDocumentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", documents.Documents)\n}\n', - }, java: { method: 'hris().documents().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.DocumentListResponse;\nimport com.tryfinch.api.models.HrisDocumentListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n DocumentListResponse documents = client.hris().documents().list();\n }\n}', }, + go: { + method: 'client.HRIS.Documents.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdocuments, err := client.HRIS.Documents.List(context.TODO(), finchgo.HRISDocumentListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", documents.Documents)\n}\n', + }, kotlin: { method: 'hris().documents().list', example: @@ -787,16 +787,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retreive\n\n`client.hris.documents.retreive(document_id: string, entity_ids?: string[]): object | object`\n\n**get** `/employer/documents/{document_id}`\n\n**Beta:** This endpoint is in beta and may change.\nRetrieve details of a specific document by its ID.\n\n\n### Parameters\n\n- `document_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ data: { amount_for_other_dependents: number; amount_for_qualifying_children_under_17: number; deductions: number; extra_withholding: number; filing_status: string; individual_id: string; other_income: number; total_claim_dependent_and_other_credits: number; }; type: 'w4_2020'; year: number; } | { data: { additional_withholding: number; exemption: 'exempt' | 'non_exempt'; filing_status: 'married' | 'married_but_withhold_at_higher_single_rate' | 'single'; individual_id: string; total_number_of_allowances: number; }; type: 'w4_2005'; year: number; }`\n A 2020 version of the W-4 tax form containing information on an individual's filing status, dependents, and withholding details.\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst response = await client.hris.documents.retreive('document_id');\n\nconsole.log(response);\n```", perLanguage: { - go: { - method: 'client.HRIS.Documents.Retreive', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.HRIS.Documents.Retreive(\n\t\tcontext.TODO(),\n\t\t"document_id",\n\t\tfinchgo.HRISDocumentRetreiveParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', - }, java: { method: 'hris().documents().retreive', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.DocumentRetreiveResponse;\nimport com.tryfinch.api.models.HrisDocumentRetreiveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n DocumentRetreiveResponse response = client.hris().documents().retreive("document_id");\n }\n}', }, + go: { + method: 'client.HRIS.Documents.Retreive', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.HRIS.Documents.Retreive(\n\t\tcontext.TODO(),\n\t\t"document_id",\n\t\tfinchgo.HRISDocumentRetreiveParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response)\n}\n', + }, kotlin: { method: 'hris().documents().retreive', example: @@ -837,16 +837,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.hris.benefits.list(entity_ids?: string[]): { benefit_id: string; description: string; frequency: benefit_frequency; type: benefit_type; company_contribution?: object; }`\n\n**get** `/employer/benefits`\n\nList all company-wide deductions and contributions.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ benefit_id: string; description: string; frequency: 'every_paycheck' | 'monthly' | 'one_time'; type: string; company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }; }`\n\n - `benefit_id: string`\n - `description: string`\n - `frequency: 'every_paycheck' | 'monthly' | 'one_time'`\n - `type: string`\n - `company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const companyBenefit of client.hris.benefits.list()) {\n console.log(companyBenefit);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.List(context.TODO(), finchgo.HRISBenefitListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().benefits().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitListPage;\nimport com.tryfinch.api.models.HrisBenefitListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisBenefitListPage page = client.hris().benefits().list();\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.List(context.TODO(), finchgo.HRISBenefitListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().benefits().list', example: @@ -893,16 +893,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.hris.benefits.create(entity_ids?: string[], company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }, description?: string, frequency?: 'every_paycheck' | 'monthly' | 'one_time', type?: string): { benefit_id: string; job_id: string; }`\n\n**post** `/employer/benefits`\n\nCreates a new company-wide deduction or contribution. Please use the `/providers` endpoint to view available types for each provider.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }`\n The company match for this benefit.\n - `tiers: { match: number; threshold: number; }[]`\n - `type: 'match'`\n\n- `description?: string`\n Name of the benefit as it appears in the provider and pay statements. Recommend limiting this to <30 characters due to limitations in specific providers (e.g. Justworks).\n\n- `frequency?: 'every_paycheck' | 'monthly' | 'one_time'`\n The frequency of the benefit deduction/contribution.\n\n- `type?: string`\n Type of benefit.\n\n### Returns\n\n- `{ benefit_id: string; job_id: string; }`\n\n - `benefit_id: string`\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst createCompanyBenefitsResponse = await client.hris.benefits.create();\n\nconsole.log(createCompanyBenefitsResponse);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcreateCompanyBenefitsResponse, err := client.HRIS.Benefits.New(context.TODO(), finchgo.HRISBenefitNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", createCompanyBenefitsResponse.BenefitID)\n}\n', - }, java: { method: 'hris().benefits().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.CreateCompanyBenefitsResponse;\nimport com.tryfinch.api.models.HrisBenefitCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n CreateCompanyBenefitsResponse createCompanyBenefitsResponse = client.hris().benefits().create();\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcreateCompanyBenefitsResponse, err := client.HRIS.Benefits.New(context.TODO(), finchgo.HRISBenefitNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", createCompanyBenefitsResponse.BenefitID)\n}\n', + }, kotlin: { method: 'hris().benefits().create', example: @@ -943,16 +943,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve\n\n`client.hris.benefits.retrieve(benefit_id: string, entity_ids?: string[]): { benefit_id: string; description: string; frequency: benefit_frequency; type: benefit_type; company_contribution?: object; }`\n\n**get** `/employer/benefits/{benefit_id}`\n\nLists deductions and contributions information for a given item\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ benefit_id: string; description: string; frequency: 'every_paycheck' | 'monthly' | 'one_time'; type: string; company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }; }`\n\n - `benefit_id: string`\n - `description: string`\n - `frequency: 'every_paycheck' | 'monthly' | 'one_time'`\n - `type: string`\n - `company_contribution?: { tiers: { match: number; threshold: number; }[]; type: 'match'; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst companyBenefit = await client.hris.benefits.retrieve('benefit_id');\n\nconsole.log(companyBenefit);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompanyBenefit, err := client.HRIS.Benefits.Get(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", companyBenefit.BenefitID)\n}\n', - }, java: { method: 'hris().benefits().retrieve', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.CompanyBenefit;\nimport com.tryfinch.api.models.HrisBenefitRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n CompanyBenefit companyBenefit = client.hris().benefits().retrieve("benefit_id");\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompanyBenefit, err := client.HRIS.Benefits.Get(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", companyBenefit.BenefitID)\n}\n', + }, kotlin: { method: 'hris().benefits().retrieve', example: @@ -992,16 +992,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.hris.benefits.update(benefit_id: string, entity_ids?: string[], description?: string): { benefit_id: string; job_id: string; }`\n\n**post** `/employer/benefits/{benefit_id}`\n\nUpdates an existing company-wide deduction or contribution\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `description?: string`\n Updated name or description.\n\n### Returns\n\n- `{ benefit_id: string; job_id: string; }`\n\n - `benefit_id: string`\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst updateCompanyBenefitResponse = await client.hris.benefits.update('benefit_id');\n\nconsole.log(updateCompanyBenefitResponse);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tupdateCompanyBenefitResponse, err := client.HRIS.Benefits.Update(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", updateCompanyBenefitResponse.BenefitID)\n}\n', - }, java: { method: 'hris().benefits().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitUpdateParams;\nimport com.tryfinch.api.models.UpdateCompanyBenefitResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n UpdateCompanyBenefitResponse updateCompanyBenefitResponse = client.hris().benefits().update("benefit_id");\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tupdateCompanyBenefitResponse, err := client.HRIS.Benefits.Update(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", updateCompanyBenefitResponse.BenefitID)\n}\n', + }, kotlin: { method: 'hris().benefits().update', example: @@ -1042,16 +1042,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list_supported_benefits\n\n`client.hris.benefits.listSupportedBenefits(entity_ids?: string[]): { annual_maximum: boolean; company_contribution: 'fixed' | 'percent' | 'tiered'[]; description: string; employee_deduction: 'fixed' | 'percent'[]; frequencies: benefit_frequency[]; catch_up?: boolean; hsa_contribution_limit?: 'family' | 'individual'[]; }`\n\n**get** `/employer/benefits/meta`\n\nGet deductions metadata\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ annual_maximum: boolean; company_contribution: 'fixed' | 'percent' | 'tiered'[]; description: string; employee_deduction: 'fixed' | 'percent'[]; frequencies: 'every_paycheck' | 'monthly' | 'one_time'[]; catch_up?: boolean; hsa_contribution_limit?: 'family' | 'individual'[]; }`\n\n - `annual_maximum: boolean`\n - `company_contribution: 'fixed' | 'percent' | 'tiered'[]`\n - `description: string`\n - `employee_deduction: 'fixed' | 'percent'[]`\n - `frequencies: 'every_paycheck' | 'monthly' | 'one_time'[]`\n - `catch_up?: boolean`\n - `hsa_contribution_limit?: 'family' | 'individual'[]`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const supportedBenefit of client.hris.benefits.listSupportedBenefits()) {\n console.log(supportedBenefit);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.ListSupportedBenefits', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.ListSupportedBenefits(context.TODO(), finchgo.HRISBenefitListSupportedBenefitsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().benefits().listSupportedBenefits', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitListSupportedBenefitsPage;\nimport com.tryfinch.api.models.HrisBenefitListSupportedBenefitsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisBenefitListSupportedBenefitsPage page = client.hris().benefits().listSupportedBenefits();\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.ListSupportedBenefits', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.ListSupportedBenefits(context.TODO(), finchgo.HRISBenefitListSupportedBenefitsParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().benefits().listSupportedBenefits', example: @@ -1097,16 +1097,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## register\n\n`client.hris.benefits.register(entity_ids?: string[], description?: string, frequency?: 'every_paycheck' | 'monthly' | 'one_time', type?: string): { benefit_id: string; job_id: string; }`\n\n**post** `/employer/benefits/register`\n\nRegister existing benefits from the customer on the provider, on Finch's end. Please use the `/provider` endpoint to view available types for each provider.\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `description?: string`\n\n- `frequency?: 'every_paycheck' | 'monthly' | 'one_time'`\n The frequency of the benefit deduction/contribution.\n\n- `type?: string`\n Type of benefit.\n\n### Returns\n\n- `{ benefit_id: string; job_id: string; }`\n\n - `benefit_id: string`\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst registerCompanyBenefitResponse = await client.hris.benefits.register();\n\nconsole.log(registerCompanyBenefitResponse);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Register', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tregisterCompanyBenefitResponse, err := client.HRIS.Benefits.Register(context.TODO(), finchgo.HRISBenefitRegisterParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", registerCompanyBenefitResponse.BenefitID)\n}\n', - }, java: { method: 'hris().benefits().register', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitRegisterParams;\nimport com.tryfinch.api.models.RegisterCompanyBenefitResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RegisterCompanyBenefitResponse registerCompanyBenefitResponse = client.hris().benefits().register();\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Register', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tregisterCompanyBenefitResponse, err := client.HRIS.Benefits.Register(context.TODO(), finchgo.HRISBenefitRegisterParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", registerCompanyBenefitResponse.BenefitID)\n}\n', + }, kotlin: { method: 'hris().benefits().register', example: @@ -1146,16 +1146,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## enrolled_ids\n\n`client.hris.benefits.individuals.enrolledIDs(benefit_id: string, entity_ids?: string[]): { benefit_id: string; individual_ids: string[]; }`\n\n**get** `/employer/benefits/{benefit_id}/enrolled`\n\nLists individuals currently enrolled in a given deduction.\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ benefit_id: string; individual_ids: string[]; }`\n\n - `benefit_id: string`\n - `individual_ids: string[]`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst response = await client.hris.benefits.individuals.enrolledIDs('benefit_id');\n\nconsole.log(response);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Individuals.EnrolledIDs', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.HRIS.Benefits.Individuals.EnrolledIDs(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualEnrolledIDsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.BenefitID)\n}\n', - }, java: { method: 'hris().benefits().individuals().enrolledIds', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitIndividualEnrolledIdsParams;\nimport com.tryfinch.api.models.IndividualEnrolledIdsResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n IndividualEnrolledIdsResponse response = client.hris().benefits().individuals().enrolledIds("benefit_id");\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Individuals.EnrolledIDs', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.HRIS.Benefits.Individuals.EnrolledIDs(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualEnrolledIDsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.BenefitID)\n}\n', + }, kotlin: { method: 'hris().benefits().individuals().enrolledIds', example: @@ -1196,16 +1196,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve_many_benefits\n\n`client.hris.benefits.individuals.retrieveManyBenefits(benefit_id: string, entity_ids?: string[], individual_ids?: string): { body: object | object; code: number; individual_id: string; }`\n\n**get** `/employer/benefits/{benefit_id}/individuals`\n\nGet enrollment information for the given individuals.\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `individual_ids?: string`\n comma-delimited list of stable Finch uuids for each individual. If empty, defaults to all individuals\n\n### Returns\n\n- `{ body: { annual_maximum: number; catch_up: boolean; company_contribution: { amount: number; type: 'fixed'; } | { amount: number; type: 'percent'; } | { tiers: object[]; type: 'tiered'; }; employee_deduction: { amount: number; type: 'fixed'; } | { amount: number; type: 'percent'; }; hsa_contribution_limit?: 'individual' | 'family'; } | { code: number; message: string; name: string; finch_code?: string; }; code: number; individual_id: string; }`\n\n - `body: { annual_maximum: number; catch_up: boolean; company_contribution: { amount: number; type: 'fixed'; } | { amount: number; type: 'percent'; } | { tiers: { match: number; threshold: number; }[]; type: 'tiered'; }; employee_deduction: { amount: number; type: 'fixed'; } | { amount: number; type: 'percent'; }; hsa_contribution_limit?: 'individual' | 'family'; } | { code: number; message: string; name: string; finch_code?: string; }`\n - `code: number`\n - `individual_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const individualBenefit of client.hris.benefits.individuals.retrieveManyBenefits('benefit_id')) {\n console.log(individualBenefit);\n}\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Individuals.GetManyBenefits', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.Individuals.GetManyBenefits(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualGetManyBenefitsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'hris().benefits().individuals().retrieveManyBenefits', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitIndividualRetrieveManyBenefitsPage;\nimport com.tryfinch.api.models.HrisBenefitIndividualRetrieveManyBenefitsParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n HrisBenefitIndividualRetrieveManyBenefitsPage page = client.hris().benefits().individuals().retrieveManyBenefits("benefit_id");\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Individuals.GetManyBenefits', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Benefits.Individuals.GetManyBenefits(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualGetManyBenefitsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'hris().benefits().individuals().retrieveManyBenefits', example: @@ -1250,16 +1250,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## enroll_many\n\n`client.hris.benefits.individuals.enrollMany(benefit_id: string, entity_ids?: string[], individuals?: { configuration?: { annual_contribution_limit?: 'individual' | 'family'; annual_maximum?: number; catch_up?: boolean; company_contribution?: object; effective_date?: string; employee_deduction?: object; }; individual_id?: string; }[]): { job_id: string; }`\n\n**post** `/employer/benefits/{benefit_id}/individuals`\n\nEnroll an individual into a deduction or contribution. This is an overwrite operation. If the employee is already enrolled, the enrollment amounts will be adjusted. Making the same request multiple times will not create new enrollments, but will continue to set the state of the existing enrollment.\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `individuals?: { configuration?: { annual_contribution_limit?: 'individual' | 'family'; annual_maximum?: number; catch_up?: boolean; company_contribution?: { amount?: number; tiers?: { match: number; threshold: number; }[]; type?: 'fixed' | 'percent' | 'tiered'; }; effective_date?: string; employee_deduction?: { amount?: number; type?: 'fixed' | 'percent'; }; }; individual_id?: string; }[]`\n Array of the individual_id to enroll and a configuration object.\n\n### Returns\n\n- `{ job_id: string; }`\n\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst enrolledIndividualBenefitResponse = await client.hris.benefits.individuals.enrollMany('benefit_id');\n\nconsole.log(enrolledIndividualBenefitResponse);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Individuals.EnrollMany', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tenrolledIndividualBenefitResponse, err := client.HRIS.Benefits.Individuals.EnrollMany(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualEnrollManyParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", enrolledIndividualBenefitResponse.JobID)\n}\n', - }, java: { method: 'hris().benefits().individuals().enrollMany', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.EnrolledIndividualBenefitResponse;\nimport com.tryfinch.api.models.HrisBenefitIndividualEnrollManyParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n EnrolledIndividualBenefitResponse enrolledIndividualBenefitResponse = client.hris().benefits().individuals().enrollMany("benefit_id");\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Individuals.EnrollMany', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tenrolledIndividualBenefitResponse, err := client.HRIS.Benefits.Individuals.EnrollMany(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualEnrollManyParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", enrolledIndividualBenefitResponse.JobID)\n}\n', + }, kotlin: { method: 'hris().benefits().individuals().enrollMany', example: @@ -1299,16 +1299,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## unenroll_many\n\n`client.hris.benefits.individuals.unenrollMany(benefit_id: string, entity_ids?: string[], individual_ids?: string[]): { job_id: string; }`\n\n**delete** `/employer/benefits/{benefit_id}/individuals`\n\nUnenroll individuals from a deduction or contribution\n\n### Parameters\n\n- `benefit_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `individual_ids?: string[]`\n Array of individual_ids to unenroll.\n\n### Returns\n\n- `{ job_id: string; }`\n\n - `job_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst unenrolledIndividualBenefitResponse = await client.hris.benefits.individuals.unenrollMany('benefit_id');\n\nconsole.log(unenrolledIndividualBenefitResponse);\n```", perLanguage: { - go: { - method: 'client.HRIS.Benefits.Individuals.UnenrollMany', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tunenrolledIndividualBenefitResponse, err := client.HRIS.Benefits.Individuals.UnenrollMany(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualUnenrollManyParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", unenrolledIndividualBenefitResponse.JobID)\n}\n', - }, java: { method: 'hris().benefits().individuals().unenrollMany', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisBenefitIndividualUnenrollManyParams;\nimport com.tryfinch.api.models.UnenrolledIndividualBenefitResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n UnenrolledIndividualBenefitResponse unenrolledIndividualBenefitResponse = client.hris().benefits().individuals().unenrollMany("benefit_id");\n }\n}', }, + go: { + method: 'client.HRIS.Benefits.Individuals.UnenrollMany', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tunenrolledIndividualBenefitResponse, err := client.HRIS.Benefits.Individuals.UnenrollMany(\n\t\tcontext.TODO(),\n\t\t"benefit_id",\n\t\tfinchgo.HRISBenefitIndividualUnenrollManyParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", unenrolledIndividualBenefitResponse.JobID)\n}\n', + }, kotlin: { method: 'hris().benefits().individuals().unenrollMany', example: @@ -1348,16 +1348,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.providers.list(): { id: string; display_name: string; products: string[]; authentication_methods?: object[]; beta?: boolean; icon?: string; logo?: string; manual?: boolean; mfa_required?: boolean; primary_color?: string; }`\n\n**get** `/providers`\n\nReturn details on all available payroll and HR systems.\n\n### Returns\n\n- `{ id: string; display_name: string; products: string[]; authentication_methods?: { type: 'assisted' | 'credential' | 'api_token' | 'api_credential' | 'oauth' | 'api'; benefits_support?: object; supported_fields?: object; }[]; beta?: boolean; icon?: string; logo?: string; manual?: boolean; mfa_required?: boolean; primary_color?: string; }`\n\n - `id: string`\n - `display_name: string`\n - `products: string[]`\n - `authentication_methods?: { type: 'assisted' | 'credential' | 'api_token' | 'api_credential' | 'oauth' | 'api'; benefits_support?: object; supported_fields?: object; }[]`\n - `beta?: boolean`\n - `icon?: string`\n - `logo?: string`\n - `manual?: boolean`\n - `mfa_required?: boolean`\n - `primary_color?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const providerListResponse of client.providers.list()) {\n console.log(providerListResponse);\n}\n```", perLanguage: { - go: { - method: 'client.Providers.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient()\n\tpage, err := client.Providers.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'providers().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.ProviderListPage;\nimport com.tryfinch.api.models.ProviderListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.fromEnv();\n\n ProviderListPage page = client.providers().list();\n }\n}', }, + go: { + method: 'client.Providers.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient()\n\tpage, err := client.Providers.List(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'providers().list', example: @@ -1396,16 +1396,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## introspect\n\n`client.account.introspect(): { id: string; client_id: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_status: object; connection_type: 'finch' | 'provider'; products: string[]; provider_id: string; account_id?: string; authentication_methods?: object[]; company_id?: string; customer_email?: string; customer_id?: string; customer_name?: string; entities?: object[]; manual?: boolean; payroll_provider_id?: string; username?: string; }`\n\n**get** `/introspect`\n\nRead account information associated with an `access_token`\n\n### Returns\n\n- `{ id: string; client_id: string; client_type: 'development' | 'production' | 'sandbox'; connection_id: string; connection_status: { status: 'pending' | 'processing' | 'connected' | 'error_no_account_setup' | 'error_permissions' | 'reauth'; last_successful_sync?: string | string; message?: string; }; connection_type: 'finch' | 'provider'; products: string[]; provider_id: string; account_id?: string; authentication_methods?: { type: 'assisted' | 'credential' | 'api_token' | 'api_credential' | 'oauth'; connection_status?: { status: connection_status_type; last_successful_sync?: string | string; message?: string; }; products?: string[]; }[]; company_id?: string; customer_email?: string; customer_id?: string; customer_name?: string; entities?: { id: string; name: string; source_id: string; status: string; }[]; manual?: boolean; payroll_provider_id?: string; username?: string; }`\n\n - `id: string`\n - `client_id: string`\n - `client_type: 'development' | 'production' | 'sandbox'`\n - `connection_id: string`\n - `connection_status: { status: 'pending' | 'processing' | 'connected' | 'error_no_account_setup' | 'error_permissions' | 'reauth'; last_successful_sync?: string | string; message?: string; }`\n - `connection_type: 'finch' | 'provider'`\n - `products: string[]`\n - `provider_id: string`\n - `account_id?: string`\n - `authentication_methods?: { type: 'assisted' | 'credential' | 'api_token' | 'api_credential' | 'oauth'; connection_status?: { status: 'pending' | 'processing' | 'connected' | 'error_no_account_setup' | 'error_permissions' | 'reauth'; last_successful_sync?: string | string; message?: string; }; products?: string[]; }[]`\n - `company_id?: string`\n - `customer_email?: string`\n - `customer_id?: string`\n - `customer_name?: string`\n - `entities?: { id: string; name: string; source_id: string; status: string; }[]`\n - `manual?: boolean`\n - `payroll_provider_id?: string`\n - `username?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst introspection = await client.account.introspect();\n\nconsole.log(introspection);\n```", perLanguage: { - go: { - method: 'client.Account.Introspect', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tintrospection, err := client.Account.Introspect(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", introspection.ID)\n}\n', - }, java: { method: 'account().introspect', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccountIntrospectParams;\nimport com.tryfinch.api.models.Introspection;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n Introspection introspection = client.account().introspect();\n }\n}', }, + go: { + method: 'client.Account.Introspect', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tintrospection, err := client.Account.Introspect(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", introspection.ID)\n}\n', + }, kotlin: { method: 'account().introspect', example: @@ -1444,16 +1444,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## disconnect\n\n`client.account.disconnect(): { status: string; }`\n\n**post** `/disconnect`\n\nDisconnect one or more `access_token`s from your application.\n\n### Returns\n\n- `{ status: string; }`\n\n - `status: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst disconnectResponse = await client.account.disconnect();\n\nconsole.log(disconnectResponse);\n```", perLanguage: { - go: { - method: 'client.Account.Disconnect', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdisconnectResponse, err := client.Account.Disconnect(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disconnectResponse.Status)\n}\n', - }, java: { method: 'account().disconnect', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccountDisconnectParams;\nimport com.tryfinch.api.models.DisconnectResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n DisconnectResponse disconnectResponse = client.account().disconnect();\n }\n}', }, + go: { + method: 'client.Account.Disconnect', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdisconnectResponse, err := client.Account.Disconnect(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disconnectResponse.Status)\n}\n', + }, kotlin: { method: 'account().disconnect', example: @@ -1494,16 +1494,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## disconnect_entity\n\n`client.account.disconnectEntity(entity_ids: string[]): { status: string; }`\n\n**post** `/disconnect-entity`\n\nDisconnect entity(s) from a connection without affecting other entities associated with the same connection.\n\n### Parameters\n\n- `entity_ids: string[]`\n Array of entity UUIDs to disconnect. At least one entity ID must be provided.\n\n### Returns\n\n- `{ status: string; }`\n\n - `status: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst disconnectEntityResponse = await client.account.disconnectEntity({ entity_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a', '5e6f7a8b-9c10-4d11-a12b-c13d14e15f16'] });\n\nconsole.log(disconnectEntityResponse);\n```", perLanguage: { - go: { - method: 'client.Account.DisconnectEntity', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdisconnectEntityResponse, err := client.Account.DisconnectEntity(context.TODO(), finchgo.AccountDisconnectEntityParams{\n\t\tEntityIDs: finchgo.F([]string{"3c90c3cc-0d44-4b50-8888-8dd25736052a", "5e6f7a8b-9c10-4d11-a12b-c13d14e15f16"}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disconnectEntityResponse.Status)\n}\n', - }, java: { method: 'account().disconnectEntity', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccountDisconnectEntityParams;\nimport com.tryfinch.api.models.DisconnectEntityResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n AccountDisconnectEntityParams params = AccountDisconnectEntityParams.builder()\n .addEntityId("3c90c3cc-0d44-4b50-8888-8dd25736052a")\n .addEntityId("5e6f7a8b-9c10-4d11-a12b-c13d14e15f16")\n .build();\n DisconnectEntityResponse disconnectEntityResponse = client.account().disconnectEntity(params);\n }\n}', }, + go: { + method: 'client.Account.DisconnectEntity', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdisconnectEntityResponse, err := client.Account.DisconnectEntity(context.TODO(), finchgo.AccountDisconnectEntityParams{\n\t\tEntityIDs: finchgo.F([]string{"3c90c3cc-0d44-4b50-8888-8dd25736052a", "5e6f7a8b-9c10-4d11-a12b-c13d14e15f16"}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", disconnectEntityResponse.Status)\n}\n', + }, kotlin: { method: 'account().disconnectEntity', example: @@ -1551,16 +1551,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## forward\n\n`client.requestForwarding.forward(method: string, route: string, data?: string, params?: object, request_headers?: object): { request: object; statusCode: number; data?: string; headers?: object; }`\n\n**post** `/forward`\n\nThe Forward API allows you to make direct requests to an employment system. If Finch's unified API\ndoesn't have a data model that cleanly fits your needs, then Forward allows you to push or pull\ndata models directly against an integration's API.\n\n### Parameters\n\n- `method: string`\n The HTTP method for the forwarded request. Valid values include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`.\n\n- `route: string`\n The URL route path for the forwarded request. This value must begin with a forward-slash ( / ) and may only contain alphanumeric characters, hyphens, and underscores.\n\n- `data?: string`\n The body for the forwarded request. This value must be specified as either a string or a valid JSON object.\n\n- `params?: object`\n The query parameters for the forwarded request. This value must be specified as a valid JSON object rather than a query string.\n\n- `request_headers?: object`\n The HTTP headers to include on the forwarded request. This value must be specified as an object of key-value pairs. Example: `{\"Content-Type\": \"application/xml\", \"X-API-Version\": \"v1\" }`\n\n### Returns\n\n- `{ request: { method: string; route: string; data?: string | object; headers?: object; params?: object; }; statusCode: number; data?: string; headers?: object; }`\n\n - `request: { method: string; route: string; data?: string | object; headers?: object; params?: object; }`\n - `statusCode: number`\n - `data?: string`\n - `headers?: object`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst response = await client.requestForwarding.forward({ method: 'method', route: 'route' });\n\nconsole.log(response);\n```", perLanguage: { - go: { - method: 'client.RequestForwarding.Forward', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.RequestForwarding.Forward(context.TODO(), finchgo.RequestForwardingForwardParams{\n\t\tMethod: finchgo.F("method"),\n\t\tRoute: finchgo.F("route"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Request)\n}\n', - }, java: { method: 'requestForwarding().forward', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.RequestForwardingForwardParams;\nimport com.tryfinch.api.models.RequestForwardingForwardResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n RequestForwardingForwardParams params = RequestForwardingForwardParams.builder()\n .method("method")\n .route("route")\n .build();\n RequestForwardingForwardResponse response = client.requestForwarding().forward(params);\n }\n}', }, + go: { + method: 'client.RequestForwarding.Forward', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tresponse, err := client.RequestForwarding.Forward(context.TODO(), finchgo.RequestForwardingForwardParams{\n\t\tMethod: finchgo.F("method"),\n\t\tRoute: finchgo.F("route"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.Request)\n}\n', + }, kotlin: { method: 'requestForwarding().forward', example: @@ -1602,16 +1602,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.jobs.automated.list(limit?: number, offset?: number): { data: automated_async_job[]; meta: object; }`\n\n**get** `/jobs/automated`\n\nGet all automated jobs. Automated jobs are completed by a machine. By default, jobs are sorted in descending order by submission time. For scheduled jobs such as data syncs, only the next scheduled job is shown.\n\n### Parameters\n\n- `limit?: number`\n Number of items to return\n\n- `offset?: number`\n Index to start from (defaults to 0)\n\n### Returns\n\n- `{ data: { completed_at: string; created_at: string; job_id: string; job_url: string; params: object; scheduled_at: string; started_at: string; status: 'pending' | 'in_progress' | 'complete' | 'error' | 'reauth_error' | 'permissions_error'; type: 'data_sync_all' | 'w4_form_employee_sync'; }[]; meta: { quotas?: { data_sync_all?: object; }; }; }`\n\n - `data: { completed_at: string; created_at: string; job_id: string; job_url: string; params: { individual_id?: string; }; scheduled_at: string; started_at: string; status: 'pending' | 'in_progress' | 'complete' | 'error' | 'reauth_error' | 'permissions_error'; type: 'data_sync_all' | 'w4_form_employee_sync'; }[]`\n - `meta: { quotas?: { data_sync_all?: { allowed_refreshes?: number; remaining_refreshes?: number; }; }; }`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst automateds = await client.jobs.automated.list();\n\nconsole.log(automateds);\n```", perLanguage: { - go: { - method: 'client.Jobs.Automated.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tautomateds, err := client.Jobs.Automated.List(context.TODO(), finchgo.JobAutomatedListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", automateds.Data)\n}\n', - }, java: { method: 'jobs().automated().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AutomatedListResponse;\nimport com.tryfinch.api.models.JobAutomatedListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n AutomatedListResponse automateds = client.jobs().automated().list();\n }\n}', }, + go: { + method: 'client.Jobs.Automated.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tautomateds, err := client.Jobs.Automated.List(context.TODO(), finchgo.JobAutomatedListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", automateds.Data)\n}\n', + }, kotlin: { method: 'jobs().automated().list', example: @@ -1653,16 +1653,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ response: '{ allowed_refreshes: number; remaining_refreshes: number; job_id?: string; job_url?: string; retry_at?: string; }', perLanguage: { - go: { - method: 'client.Jobs.Automated.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tautomated, err := client.Jobs.Automated.New(context.TODO(), finchgo.JobAutomatedNewParamsDataSyncAll{\n\t\tType: finchgo.F(finchgo.JobAutomatedNewParamsDataSyncAllTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", automated.JobID)\n}\n', - }, java: { method: 'jobs().automated().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AutomatedCreateResponse;\nimport com.tryfinch.api.models.JobAutomatedCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n JobAutomatedCreateParams.Body params = JobAutomatedCreateParams.Body.ofDataSyncAll();\n AutomatedCreateResponse automated = client.jobs().automated().create(params);\n }\n}', }, + go: { + method: 'client.Jobs.Automated.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tautomated, err := client.Jobs.Automated.New(context.TODO(), finchgo.JobAutomatedNewParamsDataSyncAll{\n\t\tType: finchgo.F(finchgo.JobAutomatedNewParamsDataSyncAllTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", automated.JobID)\n}\n', + }, kotlin: { method: 'jobs().automated().create', example: @@ -1703,16 +1703,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve\n\n`client.jobs.automated.retrieve(job_id: string): { completed_at: string; created_at: string; job_id: string; job_url: string; params: object; scheduled_at: string; started_at: string; status: 'pending' | 'in_progress' | 'complete' | 'error' | 'reauth_error' | 'permissions_error'; type: 'data_sync_all' | 'w4_form_employee_sync'; }`\n\n**get** `/jobs/automated/{job_id}`\n\nGet an automated job by `job_id`.\n\n### Parameters\n\n- `job_id: string`\n\n### Returns\n\n- `{ completed_at: string; created_at: string; job_id: string; job_url: string; params: { individual_id?: string; }; scheduled_at: string; started_at: string; status: 'pending' | 'in_progress' | 'complete' | 'error' | 'reauth_error' | 'permissions_error'; type: 'data_sync_all' | 'w4_form_employee_sync'; }`\n\n - `completed_at: string`\n - `created_at: string`\n - `job_id: string`\n - `job_url: string`\n - `params: { individual_id?: string; }`\n - `scheduled_at: string`\n - `started_at: string`\n - `status: 'pending' | 'in_progress' | 'complete' | 'error' | 'reauth_error' | 'permissions_error'`\n - `type: 'data_sync_all' | 'w4_form_employee_sync'`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst automatedAsyncJob = await client.jobs.automated.retrieve('job_id');\n\nconsole.log(automatedAsyncJob);\n```", perLanguage: { - go: { - method: 'client.Jobs.Automated.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tautomatedAsyncJob, err := client.Jobs.Automated.Get(context.TODO(), "job_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", automatedAsyncJob.JobID)\n}\n', - }, java: { method: 'jobs().automated().retrieve', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AutomatedAsyncJob;\nimport com.tryfinch.api.models.JobAutomatedRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n AutomatedAsyncJob automatedAsyncJob = client.jobs().automated().retrieve("job_id");\n }\n}', }, + go: { + method: 'client.Jobs.Automated.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tautomatedAsyncJob, err := client.Jobs.Automated.Get(context.TODO(), "job_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", automatedAsyncJob.JobID)\n}\n', + }, kotlin: { method: 'jobs().automated().retrieve', example: @@ -1753,16 +1753,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve\n\n`client.jobs.manual.retrieve(job_id: string): { body: object[]; job_id: string; status: 'pending' | 'in_progress' | 'error' | 'complete'; }`\n\n**get** `/jobs/manual/{job_id}`\n\nCheck the status and outcome of a job by `job_id`. This includes all deductions jobs including those for both automated and assisted integrations.\n\n### Parameters\n\n- `job_id: string`\n\n### Returns\n\n- `{ body: object[]; job_id: string; status: 'pending' | 'in_progress' | 'error' | 'complete'; }`\n\n - `body: object[]`\n - `job_id: string`\n - `status: 'pending' | 'in_progress' | 'error' | 'complete'`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst manualAsyncJob = await client.jobs.manual.retrieve('job_id');\n\nconsole.log(manualAsyncJob);\n```", perLanguage: { - go: { - method: 'client.Jobs.Manual.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tmanualAsyncJob, err := client.Jobs.Manual.Get(context.TODO(), "job_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", manualAsyncJob.JobID)\n}\n', - }, java: { method: 'jobs().manual().retrieve', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.JobManualRetrieveParams;\nimport com.tryfinch.api.models.ManualAsyncJob;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n ManualAsyncJob manualAsyncJob = client.jobs().manual().retrieve("job_id");\n }\n}', }, + go: { + method: 'client.Jobs.Manual.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tmanualAsyncJob, err := client.Jobs.Manual.Get(context.TODO(), "job_id")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", manualAsyncJob.JobID)\n}\n', + }, kotlin: { method: 'jobs().manual().retrieve', example: @@ -1808,16 +1808,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.sandbox.connections.create(provider_id: string, authentication_type?: 'api_token' | 'assisted' | 'credential' | 'oauth', employee_size?: number, products?: string[]): { access_token: string; account_id: string; authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'; connection_id: string; entity_id: string; products: string[]; provider_id: string; token_type: string; company_id?: string; }`\n\n**post** `/sandbox/connections`\n\nCreate a new connection (new company/provider pair) with a new account\n\n### Parameters\n\n- `provider_id: string`\n The provider associated with the connection\n\n- `authentication_type?: 'api_token' | 'assisted' | 'credential' | 'oauth'`\n\n- `employee_size?: number`\n Optional: the size of the employer to be created with this connection. Defaults to 20. Note that if this is higher than 100, historical payroll data will not be generated, and instead only one pay period will be created.\n\n- `products?: string[]`\n\n### Returns\n\n- `{ access_token: string; account_id: string; authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'; connection_id: string; entity_id: string; products: string[]; provider_id: string; token_type: string; company_id?: string; }`\n\n - `access_token: string`\n - `account_id: string`\n - `authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'`\n - `connection_id: string`\n - `entity_id: string`\n - `products: string[]`\n - `provider_id: string`\n - `token_type: string`\n - `company_id?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst connection = await client.sandbox.connections.create({ provider_id: 'provider_id' });\n\nconsole.log(connection);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Connections.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tconnection, err := client.Sandbox.Connections.New(context.TODO(), finchgo.SandboxConnectionNewParams{\n\t\tProviderID: finchgo.F("provider_id"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", connection.AccountID)\n}\n', - }, java: { method: 'sandbox().connections().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.ConnectionCreateResponse;\nimport com.tryfinch.api.models.SandboxConnectionCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.fromEnv();\n\n SandboxConnectionCreateParams params = SandboxConnectionCreateParams.builder()\n .providerId("provider_id")\n .build();\n ConnectionCreateResponse connection = client.sandbox().connections().create(params);\n }\n}', }, + go: { + method: 'client.Sandbox.Connections.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tconnection, err := client.Sandbox.Connections.New(context.TODO(), finchgo.SandboxConnectionNewParams{\n\t\tProviderID: finchgo.F("provider_id"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", connection.AccountID)\n}\n', + }, kotlin: { method: 'sandbox().connections().create', example: @@ -1863,16 +1863,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.sandbox.connections.accounts.create(company_id: string, provider_id: string, authentication_type?: 'api_token' | 'assisted' | 'credential' | 'oauth', products?: string[]): { access_token: string; account_id: string; authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'; company_id: string; connection_id: string; entity_id: string; products: string[]; provider_id: string; }`\n\n**post** `/sandbox/connections/accounts`\n\nCreate a new account for an existing connection (company/provider pair)\n\n### Parameters\n\n- `company_id: string`\n\n- `provider_id: string`\n The provider associated with the `access_token`\n\n- `authentication_type?: 'api_token' | 'assisted' | 'credential' | 'oauth'`\n\n- `products?: string[]`\n Optional, defaults to Organization products (`company`, `directory`, `employment`, `individual`)\n\n### Returns\n\n- `{ access_token: string; account_id: string; authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'; company_id: string; connection_id: string; entity_id: string; products: string[]; provider_id: string; }`\n\n - `access_token: string`\n - `account_id: string`\n - `authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'`\n - `company_id: string`\n - `connection_id: string`\n - `entity_id: string`\n - `products: string[]`\n - `provider_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst account = await client.sandbox.connections.accounts.create({ company_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', provider_id: 'provider_id' });\n\nconsole.log(account);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Connections.Accounts.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\taccount, err := client.Sandbox.Connections.Accounts.New(context.TODO(), finchgo.SandboxConnectionAccountNewParams{\n\t\tCompanyID: finchgo.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tProviderID: finchgo.F("provider_id"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", account.AccountID)\n}\n', - }, java: { method: 'sandbox().connections().accounts().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccountCreateResponse;\nimport com.tryfinch.api.models.SandboxConnectionAccountCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.fromEnv();\n\n SandboxConnectionAccountCreateParams params = SandboxConnectionAccountCreateParams.builder()\n .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")\n .providerId("provider_id")\n .build();\n AccountCreateResponse account = client.sandbox().connections().accounts().create(params);\n }\n}', }, + go: { + method: 'client.Sandbox.Connections.Accounts.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\taccount, err := client.Sandbox.Connections.Accounts.New(context.TODO(), finchgo.SandboxConnectionAccountNewParams{\n\t\tCompanyID: finchgo.F("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"),\n\t\tProviderID: finchgo.F("provider_id"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", account.AccountID)\n}\n', + }, kotlin: { method: 'sandbox().connections().accounts().create', example: @@ -1916,16 +1916,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.sandbox.connections.accounts.update(connection_status?: 'pending' | 'processing' | 'connected' | 'error_no_account_setup' | 'error_permissions' | 'reauth'): { account_id: string; authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'; company_id: string; connection_id: string; entity_id: string; products: string[]; provider_id: string; }`\n\n**put** `/sandbox/connections/accounts`\n\nUpdate an existing sandbox account. Change the connection status to understand how the Finch API responds.\n\n### Parameters\n\n- `connection_status?: 'pending' | 'processing' | 'connected' | 'error_no_account_setup' | 'error_permissions' | 'reauth'`\n\n### Returns\n\n- `{ account_id: string; authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'; company_id: string; connection_id: string; entity_id: string; products: string[]; provider_id: string; }`\n\n - `account_id: string`\n - `authentication_type: 'api_token' | 'assisted' | 'credential' | 'oauth'`\n - `company_id: string`\n - `connection_id: string`\n - `entity_id: string`\n - `products: string[]`\n - `provider_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst account = await client.sandbox.connections.accounts.update();\n\nconsole.log(account);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Connections.Accounts.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n\t"github.com/Finch-API/finch-api-go/v2/shared"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\taccount, err := client.Sandbox.Connections.Accounts.Update(context.TODO(), finchgo.SandboxConnectionAccountUpdateParams{\n\t\tConnectionStatus: finchgo.F(shared.ConnectionStatusTypeReauth),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", account.AccountID)\n}\n', - }, java: { method: 'sandbox().connections().accounts().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.AccountUpdateResponse;\nimport com.tryfinch.api.models.SandboxConnectionAccountUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n AccountUpdateResponse account = client.sandbox().connections().accounts().update();\n }\n}', }, + go: { + method: 'client.Sandbox.Connections.Accounts.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n\t"github.com/Finch-API/finch-api-go/v2/shared"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\taccount, err := client.Sandbox.Connections.Accounts.Update(context.TODO(), finchgo.SandboxConnectionAccountUpdateParams{\n\t\tConnectionStatus: finchgo.F(shared.ConnectionStatusTypeReauth),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", account.AccountID)\n}\n', + }, kotlin: { method: 'sandbox().connections().accounts().update', example: @@ -1975,16 +1975,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.sandbox.company.update(accounts: { account_name?: string; account_number?: string; account_type?: 'checking' | 'savings'; institution_name?: string; routing_number?: string; }[], departments: { name?: string; parent?: { name?: string; }; }[], ein: string, entity: { subtype?: 's_corporation' | 'c_corporation' | 'b_corporation'; type?: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }, legal_name: string, locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[], primary_email: string, primary_phone_number: string): { accounts: object[]; departments: object[]; ein: string; entity: object; legal_name: string; locations: location[]; primary_email: string; primary_phone_number: string; }`\n\n**put** `/sandbox/company`\n\nUpdate a sandbox company's data\n\n### Parameters\n\n- `accounts: { account_name?: string; account_number?: string; account_type?: 'checking' | 'savings'; institution_name?: string; routing_number?: string; }[]`\n An array of bank account objects associated with the payroll/HRIS system.\n\n- `departments: { name?: string; parent?: { name?: string; }; }[]`\n The array of company departments.\n\n- `ein: string`\n The employer identification number.\n\n- `entity: { subtype?: 's_corporation' | 'c_corporation' | 'b_corporation'; type?: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }`\n The entity type object.\n - `subtype?: 's_corporation' | 'c_corporation' | 'b_corporation'`\n The tax payer subtype of the company.\n - `type?: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'`\n The tax payer type of the company.\n\n- `legal_name: string`\n The legal name of the company.\n\n- `locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]`\n\n- `primary_email: string`\n The email of the main administrator on the account.\n\n- `primary_phone_number: string`\n The phone number of the main administrator on the account. Format: E.164, with extension where applicable, e.g. `+NNNNNNNNNNN xExtension`\n\n### Returns\n\n- `{ accounts: { account_name?: string; account_number?: string; account_type?: 'checking' | 'savings'; institution_name?: string; routing_number?: string; }[]; departments: { name?: string; parent?: { name?: string; }; }[]; ein: string; entity: { subtype?: 's_corporation' | 'c_corporation' | 'b_corporation'; type?: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }; legal_name: string; locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]; primary_email: string; primary_phone_number: string; }`\n\n - `accounts: { account_name?: string; account_number?: string; account_type?: 'checking' | 'savings'; institution_name?: string; routing_number?: string; }[]`\n - `departments: { name?: string; parent?: { name?: string; }; }[]`\n - `ein: string`\n - `entity: { subtype?: 's_corporation' | 'c_corporation' | 'b_corporation'; type?: 'llc' | 'lp' | 'corporation' | 'sole_proprietor' | 'non_profit' | 'partnership' | 'cooperative'; }`\n - `legal_name: string`\n - `locations: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }[]`\n - `primary_email: string`\n - `primary_phone_number: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst company = await client.sandbox.company.update({\n accounts: [{}],\n departments: [{}],\n ein: 'ein',\n entity: {},\n legal_name: 'legal_name',\n locations: [{\n city: 'city',\n country: 'country',\n line1: 'line1',\n line2: 'line2',\n postal_code: 'postal_code',\n state: 'state',\n}],\n primary_email: 'dev@stainless.com',\n primary_phone_number: 'primary_phone_number',\n});\n\nconsole.log(company);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Company.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompany, err := client.Sandbox.Company.Update(context.TODO(), finchgo.SandboxCompanyUpdateParams{\n\t\tAccounts: finchgo.F([]finchgo.SandboxCompanyUpdateParamsAccount{{}}),\n\t\tDepartments: finchgo.F([]finchgo.SandboxCompanyUpdateParamsDepartment{{}}),\n\t\tEin: finchgo.F("ein"),\n\t\tEntity: finchgo.F(finchgo.SandboxCompanyUpdateParamsEntity{}),\n\t\tLegalName: finchgo.F("legal_name"),\n\t\tLocations: finchgo.F([]finchgo.LocationParam{{\n\t\t\tCity: finchgo.F("city"),\n\t\t\tCountry: finchgo.F("country"),\n\t\t\tLine1: finchgo.F("line1"),\n\t\t\tLine2: finchgo.F("line2"),\n\t\t\tPostalCode: finchgo.F("postal_code"),\n\t\t\tState: finchgo.F("state"),\n\t\t}}),\n\t\tPrimaryEmail: finchgo.F("dev@stainless.com"),\n\t\tPrimaryPhoneNumber: finchgo.F("primary_phone_number"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", company.Accounts)\n}\n', - }, java: { method: 'sandbox().company().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.CompanyUpdateResponse;\nimport com.tryfinch.api.models.Location;\nimport com.tryfinch.api.models.SandboxCompanyUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n SandboxCompanyUpdateParams params = SandboxCompanyUpdateParams.builder()\n .addAccount(SandboxCompanyUpdateParams.Account.builder().build())\n .addDepartment(SandboxCompanyUpdateParams.Department.builder().build())\n .ein("ein")\n .entity(SandboxCompanyUpdateParams.Entity.builder().build())\n .legalName("legal_name")\n .addLocation(Location.builder()\n .city("city")\n .country("country")\n .line1("line1")\n .line2("line2")\n .postalCode("postal_code")\n .state("state")\n .build())\n .primaryEmail("dev@stainless.com")\n .primaryPhoneNumber("primary_phone_number")\n .build();\n CompanyUpdateResponse company = client.sandbox().company().update(params);\n }\n}', }, + go: { + method: 'client.Sandbox.Company.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tcompany, err := client.Sandbox.Company.Update(context.TODO(), finchgo.SandboxCompanyUpdateParams{\n\t\tAccounts: finchgo.F([]finchgo.SandboxCompanyUpdateParamsAccount{{}}),\n\t\tDepartments: finchgo.F([]finchgo.SandboxCompanyUpdateParamsDepartment{{}}),\n\t\tEin: finchgo.F("ein"),\n\t\tEntity: finchgo.F(finchgo.SandboxCompanyUpdateParamsEntity{}),\n\t\tLegalName: finchgo.F("legal_name"),\n\t\tLocations: finchgo.F([]finchgo.LocationParam{{\n\t\t\tCity: finchgo.F("city"),\n\t\t\tCountry: finchgo.F("country"),\n\t\t\tLine1: finchgo.F("line1"),\n\t\t\tLine2: finchgo.F("line2"),\n\t\t\tPostalCode: finchgo.F("postal_code"),\n\t\t\tState: finchgo.F("state"),\n\t\t}}),\n\t\tPrimaryEmail: finchgo.F("dev@stainless.com"),\n\t\tPrimaryPhoneNumber: finchgo.F("primary_phone_number"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", company.Accounts)\n}\n', + }, kotlin: { method: 'sandbox().company().update', example: @@ -2026,16 +2026,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.sandbox.directory.create(body?: { class_code?: string; custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]; department?: { name?: string; }; dob?: string; emails?: { data?: string; type?: 'work' | 'personal'; }[]; employment?: { subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type?: 'employee' | 'contractor'; }; employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; encrypted_ssn?: string; end_date?: string; ethnicity?: string; first_name?: string; flsa_status?: 'exempt' | 'non_exempt' | 'unknown'; gender?: 'female' | 'male' | 'other' | 'decline_to_specify'; highly_compensated_employee?: boolean; income?: object; income_history?: object[]; is_active?: boolean; key_employee?: boolean; last_name?: string; latest_rehire_date?: string; location?: object; manager?: { id?: string; }; marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'; middle_name?: string; phone_numbers?: { data?: string; type?: 'work' | 'personal'; }[]; preferred_name?: string; residence?: object; source_id?: string; ssn?: string; start_date?: string; title?: string; union_code?: string; union_local?: string; }[]): object[]`\n\n**post** `/sandbox/directory`\n\nAdd new individuals to a sandbox company\n\n### Parameters\n\n- `body?: { class_code?: string; custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]; department?: { name?: string; }; dob?: string; emails?: { data?: string; type?: 'work' | 'personal'; }[]; employment?: { subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type?: 'employee' | 'contractor'; }; employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; encrypted_ssn?: string; end_date?: string; ethnicity?: string; first_name?: string; flsa_status?: 'exempt' | 'non_exempt' | 'unknown'; gender?: 'female' | 'male' | 'other' | 'decline_to_specify'; highly_compensated_employee?: boolean; income?: { amount: number; currency: string; effective_date: string; unit: string; }; income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[]; is_active?: boolean; key_employee?: boolean; last_name?: string; latest_rehire_date?: string; location?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; manager?: { id?: string; }; marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'; middle_name?: string; phone_numbers?: { data?: string; type?: 'work' | 'personal'; }[]; preferred_name?: string; residence?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; source_id?: string; ssn?: string; start_date?: string; title?: string; union_code?: string; union_local?: string; }[]`\n Array of individuals to create. Takes all combined fields from `/individual` and `/employment` endpoints. All fields are optional.\n\n### Returns\n\n- `object[]`\n The individuals which were created\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst directories = await client.sandbox.directory.create();\n\nconsole.log(directories);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Directory.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdirectories, err := client.Sandbox.Directory.New(context.TODO(), finchgo.SandboxDirectoryNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", directories)\n}\n', - }, java: { method: 'sandbox().directory().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.DirectoryCreateResponse;\nimport com.tryfinch.api.models.SandboxDirectoryCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n List directories = client.sandbox().directory().create();\n }\n}', }, + go: { + method: 'client.Sandbox.Directory.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tdirectories, err := client.Sandbox.Directory.New(context.TODO(), finchgo.SandboxDirectoryNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", directories)\n}\n', + }, kotlin: { method: 'sandbox().directory().create', example: @@ -2091,16 +2091,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.sandbox.individual.update(individual_id: string, dob?: string, emails?: { data?: string; type?: 'work' | 'personal'; }[], encrypted_ssn?: string, ethnicity?: string, first_name?: string, gender?: 'female' | 'male' | 'other' | 'decline_to_specify', last_name?: string, marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown', middle_name?: string, phone_numbers?: { data?: string; type?: 'work' | 'personal'; }[], preferred_name?: string, residence?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }, ssn?: string): { id?: string; dob?: string; emails?: object[]; encrypted_ssn?: string; ethnicity?: string; first_name?: string; gender?: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name?: string; marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'; middle_name?: string; phone_numbers?: object[]; preferred_name?: string; residence?: location; ssn?: string; }`\n\n**put** `/sandbox/individual/{individual_id}`\n\nUpdate sandbox individual\n\n### Parameters\n\n- `individual_id: string`\n\n- `dob?: string`\n\n- `emails?: { data?: string; type?: 'work' | 'personal'; }[]`\n\n- `encrypted_ssn?: string`\n Social Security Number of the individual in **encrypted** format. This field is only available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the body.\n\n- `ethnicity?: string`\n The EEOC-defined ethnicity of the individual.\n\n- `first_name?: string`\n The legal first name of the individual.\n\n- `gender?: 'female' | 'male' | 'other' | 'decline_to_specify'`\n The gender of the individual.\n\n- `last_name?: string`\n The legal last name of the individual.\n\n- `marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'`\n The employee's marital status, used for beneficiary designation and spousal consent workflows.\n\n- `middle_name?: string`\n The legal middle name of the individual.\n\n- `phone_numbers?: { data?: string; type?: 'work' | 'personal'; }[]`\n\n- `preferred_name?: string`\n The preferred name of the individual.\n\n- `residence?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }`\n - `city: string`\n City, district, suburb, town, or village.\n - `country: string`\n The 2-letter ISO 3166 country code.\n - `line1: string`\n Street address or PO box.\n - `line2: string`\n Apartment, suite, unit, or building.\n - `postal_code: string`\n The postal code or zip code.\n - `state: string`\n The state code.\n - `name?: string`\n - `source_id?: string`\n\n- `ssn?: string`\n Social Security Number of the individual. This field is only available with the `ssn` scope enabled and the `options: { include: ['ssn'] }` param set in the body. [Click here to learn more about enabling the SSN field](/developer-resources/Enable-SSN-Field).\n\n### Returns\n\n- `{ id?: string; dob?: string; emails?: { data?: string; type?: 'work' | 'personal'; }[]; encrypted_ssn?: string; ethnicity?: string; first_name?: string; gender?: 'female' | 'male' | 'other' | 'decline_to_specify'; last_name?: string; marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'; middle_name?: string; phone_numbers?: { data?: string; type?: 'work' | 'personal'; }[]; preferred_name?: string; residence?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; ssn?: string; }`\n\n - `id?: string`\n - `dob?: string`\n - `emails?: { data?: string; type?: 'work' | 'personal'; }[]`\n - `encrypted_ssn?: string`\n - `ethnicity?: string`\n - `first_name?: string`\n - `gender?: 'female' | 'male' | 'other' | 'decline_to_specify'`\n - `last_name?: string`\n - `marital_status?: 'single' | 'married' | 'divorced' | 'widowed' | 'domestic_partner' | 'unknown'`\n - `middle_name?: string`\n - `phone_numbers?: { data?: string; type?: 'work' | 'personal'; }[]`\n - `preferred_name?: string`\n - `residence?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }`\n - `ssn?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst individual = await client.sandbox.individual.update('individual_id');\n\nconsole.log(individual);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Individual.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tindividual, err := client.Sandbox.Individual.Update(\n\t\tcontext.TODO(),\n\t\t"individual_id",\n\t\tfinchgo.SandboxIndividualUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", individual.ID)\n}\n', - }, java: { method: 'sandbox().individual().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.IndividualUpdateResponse;\nimport com.tryfinch.api.models.SandboxIndividualUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n IndividualUpdateResponse individual = client.sandbox().individual().update("individual_id");\n }\n}', }, + go: { + method: 'client.Sandbox.Individual.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tindividual, err := client.Sandbox.Individual.Update(\n\t\tcontext.TODO(),\n\t\t"individual_id",\n\t\tfinchgo.SandboxIndividualUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", individual.ID)\n}\n', + }, kotlin: { method: 'sandbox().individual().update', example: @@ -2166,16 +2166,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.sandbox.employment.update(individual_id: string, class_code?: string, custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[], department?: { name?: string; }, employment?: { subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type?: 'employee' | 'contractor'; }, employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated', end_date?: string, first_name?: string, flsa_status?: 'exempt' | 'non_exempt' | 'unknown', highly_compensated_employee?: boolean, income?: { amount: number; currency: string; effective_date: string; unit: string; }, income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[], is_active?: boolean, key_employee?: boolean, last_name?: string, latest_rehire_date?: string, location?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }, manager?: { id?: string; }, middle_name?: string, source_id?: string, start_date?: string, title?: string, union_code?: string, union_local?: string): { id?: string; class_code?: string; custom_fields?: object[]; department?: object; employment?: object; employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date?: string; first_name?: string; flsa_status?: 'exempt' | 'non_exempt' | 'unknown'; highly_compensated_employee?: boolean; income?: income; income_history?: income[]; is_active?: boolean; key_employee?: boolean; last_name?: string; latest_rehire_date?: string; location?: location; manager?: object; middle_name?: string; source_id?: string; start_date?: string; title?: string; union_code?: string; union_local?: string; }`\n\n**put** `/sandbox/employment/{individual_id}`\n\nUpdate sandbox employment\n\n### Parameters\n\n- `individual_id: string`\n\n- `class_code?: string`\n Worker's compensation classification code for this employee\n\n- `custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]`\n Custom fields for the individual. These are fields which are defined by the employer in the system. Custom fields are not currently supported for assisted connections.\n\n- `department?: { name?: string; }`\n The department object.\n - `name?: string`\n The name of the department associated with the individual.\n\n- `employment?: { subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type?: 'employee' | 'contractor'; }`\n The employment object.\n - `subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'`\n The secondary employment type of the individual. Options: `full_time`, `part_time`, `intern`, `temp`, `seasonal` and `individual_contractor`.\n - `type?: 'employee' | 'contractor'`\n The main employment type of the individual.\n\n- `employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'`\n The detailed employment status of the individual.\n\n- `end_date?: string`\n\n- `first_name?: string`\n The legal first name of the individual.\n\n- `flsa_status?: 'exempt' | 'non_exempt' | 'unknown'`\n The FLSA status of the individual. Available options: `exempt`, `non_exempt`, `unknown`.\n\n- `highly_compensated_employee?: boolean`\n IRS flag indicating whether the employee is classified as a Highly Compensated Employee for nondiscrimination testing purposes (ADP/ACP tests). US-only.\n\n- `income?: { amount: number; currency: string; effective_date: string; unit: string; }`\n The employee's income as reported by the provider. This may not always be annualized income, but may be in units of bi-weekly, semi-monthly, daily, etc, depending on what information the provider returns.\n - `amount: number`\n The income amount in cents.\n - `currency: string`\n The currency code.\n - `effective_date: string`\n The date the income amount went into effect.\n - `unit: string`\n The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`.\n\n- `income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[]`\n The array of income history.\n\n- `is_active?: boolean`\n `true` if the individual an an active employee or contractor at the company.\n\n- `key_employee?: boolean`\n IRS flag indicating whether the employee is classified as a Key Employee for top-heavy testing purposes. US-only.\n\n- `last_name?: string`\n The legal last name of the individual.\n\n- `latest_rehire_date?: string`\n\n- `location?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }`\n - `city: string`\n City, district, suburb, town, or village.\n - `country: string`\n The 2-letter ISO 3166 country code.\n - `line1: string`\n Street address or PO box.\n - `line2: string`\n Apartment, suite, unit, or building.\n - `postal_code: string`\n The postal code or zip code.\n - `state: string`\n The state code.\n - `name?: string`\n - `source_id?: string`\n\n- `manager?: { id?: string; }`\n The manager object representing the manager of the individual within the org.\n - `id?: string`\n A stable Finch `id` (UUID v4) for an individual in the company.\n\n- `middle_name?: string`\n The legal middle name of the individual.\n\n- `source_id?: string`\n The source system's unique employment identifier for this individual\n\n- `start_date?: string`\n\n- `title?: string`\n The current title of the individual.\n\n- `union_code?: string`\n The code identifying the union the employee is a member of, as configured in the payroll system.\n\n- `union_local?: string`\n The local chapter or local number within the employee's union.\n\n### Returns\n\n- `{ id?: string; class_code?: string; custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]; department?: { name?: string; }; employment?: { subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type?: 'employee' | 'contractor'; }; employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'; end_date?: string; first_name?: string; flsa_status?: 'exempt' | 'non_exempt' | 'unknown'; highly_compensated_employee?: boolean; income?: { amount: number; currency: string; effective_date: string; unit: string; }; income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[]; is_active?: boolean; key_employee?: boolean; last_name?: string; latest_rehire_date?: string; location?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }; manager?: { id?: string; }; middle_name?: string; source_id?: string; start_date?: string; title?: string; union_code?: string; union_local?: string; }`\n\n - `id?: string`\n - `class_code?: string`\n - `custom_fields?: { name?: string; value?: string | object[] | object | number | boolean; }[]`\n - `department?: { name?: string; }`\n - `employment?: { subtype?: 'full_time' | 'intern' | 'part_time' | 'temp' | 'seasonal' | 'individual_contractor'; type?: 'employee' | 'contractor'; }`\n - `employment_status?: 'active' | 'deceased' | 'leave' | 'onboarding' | 'prehire' | 'retired' | 'terminated'`\n - `end_date?: string`\n - `first_name?: string`\n - `flsa_status?: 'exempt' | 'non_exempt' | 'unknown'`\n - `highly_compensated_employee?: boolean`\n - `income?: { amount: number; currency: string; effective_date: string; unit: string; }`\n - `income_history?: { amount: number; currency: string; effective_date: string; unit: string; }[]`\n - `is_active?: boolean`\n - `key_employee?: boolean`\n - `last_name?: string`\n - `latest_rehire_date?: string`\n - `location?: { city: string; country: string; line1: string; line2: string; postal_code: string; state: string; name?: string; source_id?: string; }`\n - `manager?: { id?: string; }`\n - `middle_name?: string`\n - `source_id?: string`\n - `start_date?: string`\n - `title?: string`\n - `union_code?: string`\n - `union_local?: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst employment = await client.sandbox.employment.update('individual_id');\n\nconsole.log(employment);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Employment.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\temployment, err := client.Sandbox.Employment.Update(\n\t\tcontext.TODO(),\n\t\t"individual_id",\n\t\tfinchgo.SandboxEmploymentUpdateParams{\n\t\t\tStartDate: finchgo.F("3/4/2020"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", employment.ID)\n}\n', - }, java: { method: 'sandbox().employment().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.EmploymentUpdateResponse;\nimport com.tryfinch.api.models.SandboxEmploymentUpdateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n EmploymentUpdateResponse employment = client.sandbox().employment().update("individual_id");\n }\n}', }, + go: { + method: 'client.Sandbox.Employment.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\temployment, err := client.Sandbox.Employment.Update(\n\t\tcontext.TODO(),\n\t\t"individual_id",\n\t\tfinchgo.SandboxEmploymentUpdateParams{\n\t\t\tStartDate: finchgo.F("3/4/2020"),\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", employment.ID)\n}\n', + }, kotlin: { method: 'sandbox().employment().update', example: @@ -2219,16 +2219,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.sandbox.payment.create(end_date?: string, pay_statements?: { individual_id: string; earnings?: { amount?: number; hours?: number; name?: string; type?: string; }[]; employee_deductions?: { amount?: number; name?: string; pre_tax?: boolean; type?: string; }[]; employer_contributions?: { amount?: number; name?: string; type?: string; }[]; gross_pay?: number; net_pay?: number; payment_method?: 'check' | 'direct_deposit' | 'other'; taxes?: { amount?: number; employer?: boolean; name?: string; type?: 'federal' | 'fica' | 'local' | 'state'; }[]; total_hours?: number; type?: 'off_cycle_payroll' | 'one_time_payment' | 'regular_payroll'; }[], start_date?: string): { pay_date: string; payment_id: string; }`\n\n**post** `/sandbox/payment`\n\nAdd a new sandbox payment\n\n### Parameters\n\n- `end_date?: string`\n\n- `pay_statements?: { individual_id: string; earnings?: { amount?: number; hours?: number; name?: string; type?: string; }[]; employee_deductions?: { amount?: number; name?: string; pre_tax?: boolean; type?: string; }[]; employer_contributions?: { amount?: number; name?: string; type?: string; }[]; gross_pay?: number; net_pay?: number; payment_method?: 'check' | 'direct_deposit' | 'other'; taxes?: { amount?: number; employer?: boolean; name?: string; type?: 'federal' | 'fica' | 'local' | 'state'; }[]; total_hours?: number; type?: 'off_cycle_payroll' | 'one_time_payment' | 'regular_payroll'; }[]`\n Array of pay statements to include in the payment.\n\n- `start_date?: string`\n\n### Returns\n\n- `{ pay_date: string; payment_id: string; }`\n\n - `pay_date: string`\n - `payment_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst payment = await client.sandbox.payment.create();\n\nconsole.log(payment);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Payment.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpayment, err := client.Sandbox.Payment.New(context.TODO(), finchgo.SandboxPaymentNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.PaymentID)\n}\n', - }, java: { method: 'sandbox().payment().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.PaymentCreateResponse;\nimport com.tryfinch.api.models.SandboxPaymentCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n PaymentCreateResponse payment = client.sandbox().payment().create();\n }\n}', }, + go: { + method: 'client.Sandbox.Payment.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpayment, err := client.Sandbox.Payment.New(context.TODO(), finchgo.SandboxPaymentNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payment.PaymentID)\n}\n', + }, kotlin: { method: 'sandbox().payment().create', example: @@ -2268,16 +2268,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## create\n\n`client.sandbox.jobs.create(type: 'data_sync_all'): { allowed_refreshes: number; job_id: string; job_url: string; remaining_refreshes: number; }`\n\n**post** `/sandbox/jobs`\n\nEnqueue a new sandbox job\n\n### Parameters\n\n- `type: 'data_sync_all'`\n The type of job to start. Currently the only supported type is `data_sync_all`\n\n### Returns\n\n- `{ allowed_refreshes: number; job_id: string; job_url: string; remaining_refreshes: number; }`\n\n - `allowed_refreshes: number`\n - `job_id: string`\n - `job_url: string`\n - `remaining_refreshes: number`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst job = await client.sandbox.jobs.create({ type: 'data_sync_all' });\n\nconsole.log(job);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Jobs.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tjob, err := client.Sandbox.Jobs.New(context.TODO(), finchgo.SandboxJobNewParams{\n\t\tType: finchgo.F(finchgo.SandboxJobNewParamsTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", job.JobID)\n}\n', - }, java: { method: 'sandbox().jobs().create', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.JobCreateResponse;\nimport com.tryfinch.api.models.SandboxJobCreateParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n SandboxJobCreateParams params = SandboxJobCreateParams.builder()\n .type(SandboxJobCreateParams.Type.DATA_SYNC_ALL)\n .build();\n JobCreateResponse job = client.sandbox().jobs().create(params);\n }\n}', }, + go: { + method: 'client.Sandbox.Jobs.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tjob, err := client.Sandbox.Jobs.New(context.TODO(), finchgo.SandboxJobNewParams{\n\t\tType: finchgo.F(finchgo.SandboxJobNewParamsTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", job.JobID)\n}\n', + }, kotlin: { method: 'sandbox().jobs().create', example: @@ -2317,16 +2317,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve\n\n`client.sandbox.jobs.configuration.retrieve(): object[]`\n\n**get** `/sandbox/jobs/configuration`\n\nGet configurations for sandbox jobs\n\n### Returns\n\n- `{ completion_status: 'complete' | 'reauth_error' | 'permissions_error' | 'error'; type: 'data_sync_all'; }[]`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst sandboxJobConfigurations = await client.sandbox.jobs.configuration.retrieve();\n\nconsole.log(sandboxJobConfigurations);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Jobs.Configuration.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tsandboxJobConfigurations, err := client.Sandbox.Jobs.Configuration.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", sandboxJobConfigurations)\n}\n', - }, java: { method: 'sandbox().jobs().configuration().retrieve', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.SandboxJobConfiguration;\nimport com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n List sandboxJobConfigurations = client.sandbox().jobs().configuration().retrieve();\n }\n}', }, + go: { + method: 'client.Sandbox.Jobs.Configuration.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tsandboxJobConfigurations, err := client.Sandbox.Jobs.Configuration.Get(context.TODO())\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", sandboxJobConfigurations)\n}\n', + }, kotlin: { method: 'sandbox().jobs().configuration().retrieve', example: @@ -2370,16 +2370,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## update\n\n`client.sandbox.jobs.configuration.update(completion_status: 'complete' | 'reauth_error' | 'permissions_error' | 'error', type: 'data_sync_all'): { completion_status: 'complete' | 'reauth_error' | 'permissions_error' | 'error'; type: 'data_sync_all'; }`\n\n**put** `/sandbox/jobs/configuration`\n\nUpdate configurations for sandbox jobs\n\n### Parameters\n\n- `completion_status: 'complete' | 'reauth_error' | 'permissions_error' | 'error'`\n\n- `type: 'data_sync_all'`\n\n### Returns\n\n- `{ completion_status: 'complete' | 'reauth_error' | 'permissions_error' | 'error'; type: 'data_sync_all'; }`\n\n - `completion_status: 'complete' | 'reauth_error' | 'permissions_error' | 'error'`\n - `type: 'data_sync_all'`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst sandboxJobConfiguration = await client.sandbox.jobs.configuration.update({ completion_status: 'complete', type: 'data_sync_all' });\n\nconsole.log(sandboxJobConfiguration);\n```", perLanguage: { - go: { - method: 'client.Sandbox.Jobs.Configuration.Update', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tsandboxJobConfiguration, err := client.Sandbox.Jobs.Configuration.Update(context.TODO(), finchgo.SandboxJobConfigurationUpdateParams{\n\t\tCompletionStatus: finchgo.F(finchgo.SandboxJobConfigurationUpdateParamsCompletionStatusComplete),\n\t\tType: finchgo.F(finchgo.SandboxJobConfigurationUpdateParamsTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", sandboxJobConfiguration.CompletionStatus)\n}\n', - }, java: { method: 'sandbox().jobs().configuration().update', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.SandboxJobConfiguration;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n SandboxJobConfiguration params = SandboxJobConfiguration.builder()\n .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE)\n .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL)\n .build();\n SandboxJobConfiguration sandboxJobConfiguration = client.sandbox().jobs().configuration().update(params);\n }\n}', }, + go: { + method: 'client.Sandbox.Jobs.Configuration.Update', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tsandboxJobConfiguration, err := client.Sandbox.Jobs.Configuration.Update(context.TODO(), finchgo.SandboxJobConfigurationUpdateParams{\n\t\tCompletionStatus: finchgo.F(finchgo.SandboxJobConfigurationUpdateParamsCompletionStatusComplete),\n\t\tType: finchgo.F(finchgo.SandboxJobConfigurationUpdateParamsTypeDataSyncAll),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", sandboxJobConfiguration.CompletionStatus)\n}\n', + }, kotlin: { method: 'sandbox().jobs().configuration().update', example: @@ -2419,16 +2419,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## list\n\n`client.payroll.payGroups.list(entity_ids?: string[], individual_id?: string, pay_frequencies?: string[]): { id: string; name: string; pay_frequencies: string[]; }`\n\n**get** `/employer/pay-groups`\n\nRead company pay groups and frequencies\n\n### Parameters\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n- `individual_id?: string`\n\n- `pay_frequencies?: string[]`\n\n### Returns\n\n- `{ id: string; name: string; pay_frequencies: string[]; }`\n\n - `id: string`\n - `name: string`\n - `pay_frequencies: string[]`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\n// Automatically fetches more pages as needed.\nfor await (const payGroupListResponse of client.payroll.payGroups.list()) {\n console.log(payGroupListResponse);\n}\n```", perLanguage: { - go: { - method: 'client.Payroll.PayGroups.List', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Payroll.PayGroups.List(context.TODO(), finchgo.PayrollPayGroupListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', - }, java: { method: 'payroll().payGroups().list', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.PayrollPayGroupListPage;\nimport com.tryfinch.api.models.PayrollPayGroupListParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n PayrollPayGroupListPage page = client.payroll().payGroups().list();\n }\n}', }, + go: { + method: 'client.Payroll.PayGroups.List', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.Payroll.PayGroups.List(context.TODO(), finchgo.PayrollPayGroupListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n', + }, kotlin: { method: 'payroll().payGroups().list', example: @@ -2468,16 +2468,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## retrieve\n\n`client.payroll.payGroups.retrieve(pay_group_id: string, entity_ids?: string[]): { id: string; individual_ids: string[]; name: string; pay_frequencies: string[]; }`\n\n**get** `/employer/pay-groups/{pay_group_id}`\n\nRead information from a single pay group\n\n### Parameters\n\n- `pay_group_id: string`\n\n- `entity_ids?: string[]`\n The entity IDs to specify which entities' data to access. Provide exactly one entity ID per request; a maximum of one is accepted.\n\n### Returns\n\n- `{ id: string; individual_ids: string[]; name: string; pay_frequencies: string[]; }`\n\n - `id: string`\n - `individual_ids: string[]`\n - `name: string`\n - `pay_frequencies: string[]`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst payGroup = await client.payroll.payGroups.retrieve('pay_group_id');\n\nconsole.log(payGroup);\n```", perLanguage: { - go: { - method: 'client.Payroll.PayGroups.Get', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpayGroup, err := client.Payroll.PayGroups.Get(\n\t\tcontext.TODO(),\n\t\t"pay_group_id",\n\t\tfinchgo.PayrollPayGroupGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payGroup.ID)\n}\n', - }, java: { method: 'payroll().payGroups().retrieve', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.PayGroupRetrieveResponse;\nimport com.tryfinch.api.models.PayrollPayGroupRetrieveParams;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\n PayGroupRetrieveResponse payGroup = client.payroll().payGroups().retrieve("pay_group_id");\n }\n}', }, + go: { + method: 'client.Payroll.PayGroups.Get', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpayGroup, err := client.Payroll.PayGroups.Get(\n\t\tcontext.TODO(),\n\t\t"pay_group_id",\n\t\tfinchgo.PayrollPayGroupGetParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", payGroup.ID)\n}\n', + }, kotlin: { method: 'payroll().payGroups().retrieve', example: @@ -2528,16 +2528,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## new\n\n`client.connect.sessions.new(customer_id: string, customer_name: string, products: string[], customer_email?: string, integration?: { provider: string; auth_method?: 'assisted' | 'credential' | 'oauth' | 'api_token'; }, manual?: boolean, minutes_to_expire?: number, recordkeeping?: { recordkeeper: 'voya' | 'empower' | 'fidelity' | 'transamerica'; plan_id?: string; }, redirect_uri?: string, sandbox?: 'finch' | 'provider'): { connect_url: string; session_id: string; }`\n\n**post** `/connect/sessions`\n\nCreate a new connect session for an employer\n\n### Parameters\n\n- `customer_id: string`\n Unique identifier for the customer\n\n- `customer_name: string`\n Name of the customer\n\n- `products: string[]`\n The Finch products to request access to. Use `benefits` to access deductions endpoints — `deduction` is a deprecated alias that is still accepted but should not be combined with `benefits`.\n\n- `customer_email?: string`\n Email address of the customer\n\n- `integration?: { provider: string; auth_method?: 'assisted' | 'credential' | 'oauth' | 'api_token'; }`\n Integration configuration for the connect session\n - `provider: string`\n The provider to integrate with\n - `auth_method?: 'assisted' | 'credential' | 'oauth' | 'api_token'`\n The authentication method to use\n\n- `manual?: boolean`\n Enable manual authentication mode\n\n- `minutes_to_expire?: number`\n The number of minutes until the session expires (defaults to 129,600, which is 90 days)\n\n- `recordkeeping?: { recordkeeper: 'voya' | 'empower' | 'fidelity' | 'transamerica'; plan_id?: string; }`\n Optional recordkeeping configuration. Can only be provided when the `recordkeeping` product is requested. Currently supports `recordkeeper` set to `voya`, `empower`, `fidelity`, or `transamerica`.\n - `recordkeeper: 'voya' | 'empower' | 'fidelity' | 'transamerica'`\n The recordkeeper to configure for this connection\n - `plan_id?: string`\n The plan identifier used by the recordkeeper\n\n- `redirect_uri?: string`\n The URI to redirect to after the Connect flow is completed\n\n- `sandbox?: 'finch' | 'provider'`\n Sandbox mode for testing\n\n### Returns\n\n- `{ connect_url: string; session_id: string; }`\n\n - `connect_url: string`\n - `session_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst response = await client.connect.sessions.new({\n customer_id: 'x',\n customer_name: 'x',\n products: ['benefits'],\n});\n\nconsole.log(response);\n```", perLanguage: { - go: { - method: 'client.Connect.Sessions.New', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tresponse, err := client.Connect.Sessions.New(context.TODO(), finchgo.ConnectSessionNewParams{\n\t\tCustomerID: finchgo.F("x"),\n\t\tCustomerName: finchgo.F("x"),\n\t\tProducts: finchgo.F([]finchgo.ConnectSessionNewParamsProduct{finchgo.ConnectSessionNewParamsProductBenefits}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.SessionID)\n}\n', - }, java: { method: 'connect().sessions().new_', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.ConnectSessionNewParams;\nimport com.tryfinch.api.models.SessionNewResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.fromEnv();\n\n ConnectSessionNewParams params = ConnectSessionNewParams.builder()\n .customerId("x")\n .customerName("x")\n .addProduct(ConnectSessionNewParams.ConnectProducts.BENEFITS)\n .build();\n SessionNewResponse response = client.connect().sessions().new_(params);\n }\n}', }, + go: { + method: 'client.Connect.Sessions.New', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tresponse, err := client.Connect.Sessions.New(context.TODO(), finchgo.ConnectSessionNewParams{\n\t\tCustomerID: finchgo.F("x"),\n\t\tCustomerName: finchgo.F("x"),\n\t\tProducts: finchgo.F([]finchgo.ConnectSessionNewParamsProduct{finchgo.ConnectSessionNewParamsProductBenefits}),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.SessionID)\n}\n', + }, kotlin: { method: 'connect().sessions().new', example: @@ -2582,16 +2582,16 @@ const EMBEDDED_METHODS: MethodEntry[] = [ markdown: "## reauthenticate\n\n`client.connect.sessions.reauthenticate(connection_id: string, minutes_to_expire?: number, products?: string[], redirect_uri?: string): { connect_url: string; session_id: string; }`\n\n**post** `/connect/sessions/reauthenticate`\n\nCreate a new Connect session for reauthenticating an existing connection\n\n### Parameters\n\n- `connection_id: string`\n The ID of the existing connection to reauthenticate\n\n- `minutes_to_expire?: number`\n The number of minutes until the session expires (defaults to 43,200, which is 30 days)\n\n- `products?: string[]`\n The products to request access to (optional for reauthentication). Use `benefits` to access deductions endpoints — `deduction` is a deprecated alias that is still accepted but should not be combined with `benefits`.\n\n- `redirect_uri?: string`\n The URI to redirect to after the Connect flow is completed\n\n### Returns\n\n- `{ connect_url: string; session_id: string; }`\n\n - `connect_url: string`\n - `session_id: string`\n\n### Example\n\n```typescript\nimport Finch from '@tryfinch/finch-api';\n\nconst client = new Finch();\n\nconst response = await client.connect.sessions.reauthenticate({ connection_id: 'connection_id' });\n\nconsole.log(response);\n```", perLanguage: { - go: { - method: 'client.Connect.Sessions.Reauthenticate', - example: - 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tresponse, err := client.Connect.Sessions.Reauthenticate(context.TODO(), finchgo.ConnectSessionReauthenticateParams{\n\t\tConnectionID: finchgo.F("connection_id"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.SessionID)\n}\n', - }, java: { method: 'connect().sessions().reauthenticate', example: 'package com.tryfinch.api.example;\n\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.ConnectSessionReauthenticateParams;\nimport com.tryfinch.api.models.SessionReauthenticateResponse;\n\npublic final class Main {\n private Main() {}\n\n public static void main(String[] args) {\n FinchClient client = FinchOkHttpClient.fromEnv();\n\n ConnectSessionReauthenticateParams params = ConnectSessionReauthenticateParams.builder()\n .connectionId("connection_id")\n .build();\n SessionReauthenticateResponse response = client.connect().sessions().reauthenticate(params);\n }\n}', }, + go: { + method: 'client.Connect.Sessions.Reauthenticate', + example: + 'package main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithClientID("4ab15e51-11ad-49f4-acae-f343b7794375"),\n\t\toption.WithClientSecret("My Client Secret"),\n\t)\n\tresponse, err := client.Connect.Sessions.Reauthenticate(context.TODO(), finchgo.ConnectSessionReauthenticateParams{\n\t\tConnectionID: finchgo.F("connection_id"),\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", response.SessionID)\n}\n', + }, kotlin: { method: 'connect().sessions().reauthenticate', example: @@ -2622,14 +2622,14 @@ const EMBEDDED_METHODS: MethodEntry[] = [ const EMBEDDED_READMES: { language: string; content: string }[] = [ { - language: 'go', + language: 'java', content: - '# Finch Go API Library\n\nGo Reference\n\nThe Finch Go library provides convenient access to the [Finch REST API](https://developer.tryfinch.com/)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/Finch-API/finch-api-go/v2" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/Finch-API/finch-api-go/v2@v2.8.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.HRIS.Directory.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/Finch-API/finch-api-go/v2/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.HRIS.Directory.ListAutoPaging(context.TODO(), finchgo.HRISDirectoryListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tindividualInDirectory := iter.Current()\n\tfmt.Printf("%+v\\n", individualInDirectory)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\nfor page != nil {\n\tfor _, directory := range page.Individuals {\n\t\tfmt.Printf("%+v\\n", directory)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.HRIS.Company.Get(context.TODO(), finchgo.HRISCompanyGetParams{})\nif err != nil {\n\tvar apierr *finchgo.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/employer/company": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.HRIS.Directory.List(\n\tctx,\n\tfinchgo.HRISDirectoryListParams{},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := finchgo.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.HRIS.Directory.List(\n\tcontext.TODO(),\n\tfinchgo.HRISDirectoryListParams{},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\npage, err := client.HRIS.Directory.List(\n\tcontext.TODO(),\n\tfinchgo.HRISDirectoryListParams{},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", page)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/Finch-API/finch-api-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', + '# Finch Java API Library\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/8.8.1)\n[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.8.1)\n\n\nThe Finch Java SDK provides convenient access to the [Finch REST API](https://developer.tryfinch.com/) from applications written in Java.\n\nThe Finch Java SDK is similar to the Finch Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nThe REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.8.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("com.tryfinch.api:finch-java:8.8.1")\n~~~\n\n### Maven\n\n~~~xml\n\n com.tryfinch.api\n finch-java\n 8.8.1\n\n~~~\n\n\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\nHrisDirectoryListPage page = client.hris().directory().list();\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n```\n\nOr manually:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .accessToken("My Access Token")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------------- | --------------------- | ---------------------- | -------- | ---------------------------- |\n| `clientId` | `finch.clientId` | `FINCH_CLIENT_ID` | false | - |\n| `clientSecret` | `finch.clientSecret` | `FINCH_CLIENT_SECRET` | false | - |\n| `webhookSecret` | `finch.webhookSecret` | `FINCH_WEBHOOK_SECRET` | false | - |\n| `baseUrl` | `finch.baseUrl` | `FINCH_BASE_URL` | true | `"https://api.tryfinch.com"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\n\nFinchClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Finch API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.hris().directory().list(...)` should be called with an instance of `HrisDirectoryListParams`, and it will return an instance of `HrisDirectoryListPage`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListPageAsync;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\nimport java.util.concurrent.CompletableFuture;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\nCompletableFuture page = client.async().hris().directory().list();\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.tryfinch.api.client.FinchClientAsync;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClientAsync;\nimport com.tryfinch.api.models.HrisDirectoryListPageAsync;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\nimport java.util.concurrent.CompletableFuture;\n\nFinchClientAsync client = FinchOkHttpClientAsync.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\nCompletableFuture page = client.hris().directory().list();\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.tryfinch.api.core.http.Headers;\nimport com.tryfinch.api.core.http.HttpResponseFor;\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHttpResponseFor page = client.hris().directory().withRawResponse().list();\n\nint statusCode = page.statusCode();\nHeaders headers = page.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\n\nHrisDirectoryListPage parsedPage = page.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`FinchServiceException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`FinchIoException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchIoException.kt): I/O networking errors.\n\n- [`FinchRetryableException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`FinchException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.IndividualInDirectory;\n\nHrisDirectoryListPage page = client.hris().directory().list();\n\n// Process as an Iterable\nfor (IndividualInDirectory directory : page.autoPager()) {\n System.out.println(directory);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(directory -> System.out.println(directory));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/AsyncStreamResponse.kt):\n\n```java\nimport com.tryfinch.api.core.http.AsyncStreamResponse;\nimport com.tryfinch.api.models.HrisDirectoryListPageAsync;\nimport com.tryfinch.api.models.IndividualInDirectory;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture pageFuture = client.async().hris().directory().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(directory -> {\n System.out.println(directory);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(IndividualInDirectory directory) {\n System.out.println(directory);\n }\n\n @Override\n public void onComplete(Optional error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(directory -> {\n System.out.println(directory);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.IndividualInDirectory;\n\nHrisDirectoryListPage page = client.hris().directory().list();\nwhile (true) {\n for (IndividualInDirectory directory : page.items()) {\n System.out.println(directory);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nEnable logging by setting the `FINCH_LOG` environment variable to `info`:\n\n```sh\nexport FINCH_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport FINCH_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.core.LogLevel;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .accessToken("My Access Token")\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `finch-java-core` is published with a [configuration file](finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) or [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .accessToken("My Access Token")\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\n\nHrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport java.time.Duration;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .accessToken("My Access Token")\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .accessToken("My Access Token")\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.core.http.ProxyAuthenticator;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .accessToken("My Access Token")\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport java.time.Duration;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .accessToken("My Access Token")\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .accessToken("My Access Token")\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `finch-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`FinchClient`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt), [`FinchClientAsync`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt), [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt), and [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), all of which can work with any HTTP client\n- `finch-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) and [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt), which provide a way to construct [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt) and [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), respectively, using OkHttp\n- `finch-java`\n - Depends on and exposes the APIs of both `finch-java-core` and `finch-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`finch-java` dependency](#installation) with `finch-java-core`\n2. Copy `finch-java-client-okhttp`\'s [`OkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt) or [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), similarly to [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) or [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`finch-java` dependency](#installation) with `finch-java-core`\n2. Write a class that implements the [`HttpClient`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt) interface\n3. Construct [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt) or [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), similarly to [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) or [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.tryfinch.api.core.JsonValue;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHrisDirectoryListParams params = HrisDirectoryListParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt) object to its setter:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHrisDirectoryListParams params = HrisDirectoryListParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.tryfinch.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt):\n\n```java\nimport com.tryfinch.api.core.JsonMissing;\nimport com.tryfinch.api.models.AccessTokenCreateParams;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHrisDirectoryListParams params = AccessTokenCreateParams.builder()\n .code(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.tryfinch.api.core.JsonValue;\nimport java.util.Map;\n\nMap additionalProperties = client.accessTokens().create(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.tryfinch.api.core.JsonField;\nimport java.util.Optional;\n\nJsonField code = client.accessTokens().create(params)._code();\n\nif (code.isMissing()) {\n // The property is absent from the JSON response\n} else if (code.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional jsonString = code.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = code.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.tryfinch.api.models.CreateAccessTokenResponse;\n\nCreateAccessTokenResponse createAccessTokenResponse = client.accessTokens().create(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\n\nHrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .accessToken("My Access Token")\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField` instead of just plain `T`?\n\nUsing `JsonField` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/Finch-API/finch-api-java/issues) with questions, bugs, or suggestions.\n', }, { - language: 'java', + language: 'go', content: - '# Finch Java API Library\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/8.8.1)\n[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.8.1)\n\n\nThe Finch Java SDK provides convenient access to the [Finch REST API](https://developer.tryfinch.com/) from applications written in Java.\n\nThe Finch Java SDK is similar to the Finch Kotlin SDK but with minor differences that make it more ergonomic for use in Java, such as `Optional` instead of nullable values, `Stream` instead of `Sequence`, and `CompletableFuture` instead of suspend functions.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n\n\nThe REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.8.1).\n\n\n\n## Installation\n\n\n\n### Gradle\n\n~~~kotlin\nimplementation("com.tryfinch.api:finch-java:8.8.1")\n~~~\n\n### Maven\n\n~~~xml\n\n com.tryfinch.api\n finch-java\n 8.8.1\n\n~~~\n\n\n\n## Requirements\n\nThis library requires Java 8 or later.\n\n## Usage\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\nHrisDirectoryListPage page = client.hris().directory().list();\n```\n\n## Client configuration\n\nConfigure the client using system properties or environment variables:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n```\n\nOr manually:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .accessToken("My Access Token")\n .build();\n```\n\nOr using a combination of the two approaches:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n```\n\nSee this table for the available options:\n\n| Setter | System property | Environment variable | Required | Default value |\n| --------------- | --------------------- | ---------------------- | -------- | ---------------------------- |\n| `clientId` | `finch.clientId` | `FINCH_CLIENT_ID` | false | - |\n| `clientSecret` | `finch.clientSecret` | `FINCH_CLIENT_SECRET` | false | - |\n| `webhookSecret` | `finch.webhookSecret` | `FINCH_WEBHOOK_SECRET` | false | - |\n| `baseUrl` | `finch.baseUrl` | `FINCH_BASE_URL` | true | `"https://api.tryfinch.com"` |\n\nSystem properties take precedence over environment variables.\n\n> [!TIP]\n> Don\'t create more than one client in the same application. Each client has a connection pool and\n> thread pools, which are more efficient to share between requests.\n\n### Modifying configuration\n\nTo temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\n\nFinchClient clientWithOptions = client.withOptions(optionsBuilder -> {\n optionsBuilder.baseUrl("https://example.com");\n optionsBuilder.maxRetries(42);\n});\n```\n\nThe `withOptions()` method does not affect the original client or service.\n\n## Requests and responses\n\nTo send a request to the Finch API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.\n\nFor example, `client.hris().directory().list(...)` should be called with an instance of `HrisDirectoryListParams`, and it will return an instance of `HrisDirectoryListPage`.\n\n## Immutability\n\nEach class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it.\n\nEach class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy.\n\nBecause each class is immutable, builder modification will _never_ affect already built class instances.\n\n## Asynchronous execution\n\nThe default client is synchronous. To switch to asynchronous execution, call the `async()` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.models.HrisDirectoryListPageAsync;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\nimport java.util.concurrent.CompletableFuture;\n\nFinchClient client = FinchOkHttpClient.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\nCompletableFuture page = client.async().hris().directory().list();\n```\n\nOr create an asynchronous client from the beginning:\n\n```java\nimport com.tryfinch.api.client.FinchClientAsync;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClientAsync;\nimport com.tryfinch.api.models.HrisDirectoryListPageAsync;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\nimport java.util.concurrent.CompletableFuture;\n\nFinchClientAsync client = FinchOkHttpClientAsync.builder()\n // Configures using the `finch.clientId`, `finch.clientSecret`, `finch.webhookSecret` and `finch.baseUrl` system properties\n // Or configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET`, `FINCH_WEBHOOK_SECRET` and `FINCH_BASE_URL` environment variables\n .fromEnv()\n .accessToken("My Access Token")\n .build();\n\nCompletableFuture page = client.hris().directory().list();\n```\n\nThe asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s.\n\n\n\n\n\n\n\n## Raw responses\n\nThe SDK defines methods that deserialize responses into instances of Java classes. However, these methods don\'t provide access to the response headers, status code, or the raw response body.\n\nTo access this data, prefix any HTTP method call on a client or service with `withRawResponse()`:\n\n```java\nimport com.tryfinch.api.core.http.Headers;\nimport com.tryfinch.api.core.http.HttpResponseFor;\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHttpResponseFor page = client.hris().directory().withRawResponse().list();\n\nint statusCode = page.statusCode();\nHeaders headers = page.headers();\n```\n\nYou can still deserialize the response into an instance of a Java class if needed:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\n\nHrisDirectoryListPage parsedPage = page.parse();\n```\n\n## Error handling\n\nThe SDK throws custom unchecked exception types:\n\n- [`FinchServiceException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code:\n\n | Status | Exception |\n | ------ | -------------------------------------------------- |\n | 400 | [`BadRequestException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/BadRequestException.kt) |\n | 401 | [`UnauthorizedException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnauthorizedException.kt) |\n | 403 | [`PermissionDeniedException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/PermissionDeniedException.kt) |\n | 404 | [`NotFoundException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/NotFoundException.kt) |\n | 422 | [`UnprocessableEntityException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnprocessableEntityException.kt) |\n | 429 | [`RateLimitException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/RateLimitException.kt) |\n | 5xx | [`InternalServerException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/InternalServerException.kt) |\n | others | [`UnexpectedStatusCodeException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnexpectedStatusCodeException.kt) |\n\n- [`FinchIoException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchIoException.kt): I/O networking errors.\n\n- [`FinchRetryableException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt): Generic error indicating a failure that could be retried by the client.\n\n- [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that\'s supposed to be required, but the API unexpectedly omitted it from the response.\n\n- [`FinchException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.\n\n## Pagination\n\nThe SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.\n\n### Auto-pagination\n\nTo iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.\n\nWhen using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.IndividualInDirectory;\n\nHrisDirectoryListPage page = client.hris().directory().list();\n\n// Process as an Iterable\nfor (IndividualInDirectory directory : page.autoPager()) {\n System.out.println(directory);\n}\n\n// Process as a Stream\npage.autoPager()\n .stream()\n .limit(50)\n .forEach(directory -> System.out.println(directory));\n```\n\nWhen using the asynchronous client, the method returns an [`AsyncStreamResponse`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/AsyncStreamResponse.kt):\n\n```java\nimport com.tryfinch.api.core.http.AsyncStreamResponse;\nimport com.tryfinch.api.models.HrisDirectoryListPageAsync;\nimport com.tryfinch.api.models.IndividualInDirectory;\nimport java.util.Optional;\nimport java.util.concurrent.CompletableFuture;\n\nCompletableFuture pageFuture = client.async().hris().directory().list();\n\npageFuture.thenRun(page -> page.autoPager().subscribe(directory -> {\n System.out.println(directory);\n}));\n\n// If you need to handle errors or completion of the stream\npageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {\n @Override\n public void onNext(IndividualInDirectory directory) {\n System.out.println(directory);\n }\n\n @Override\n public void onComplete(Optional error) {\n if (error.isPresent()) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error.get());\n } else {\n System.out.println("No more!");\n }\n }\n}));\n\n// Or use futures\npageFuture.thenRun(page -> page.autoPager()\n .subscribe(directory -> {\n System.out.println(directory);\n })\n .onCompleteFuture()\n .whenComplete((unused, error) -> {\n if (error != null) {\n System.out.println("Something went wrong!");\n throw new RuntimeException(error);\n } else {\n System.out.println("No more!");\n }\n }));\n```\n\n### Manual pagination\n\nTo access individual page items and manually request the next page, use the `items()`,\n`hasNextPage()`, and `nextPage()` methods:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\nimport com.tryfinch.api.models.IndividualInDirectory;\n\nHrisDirectoryListPage page = client.hris().directory().list();\nwhile (true) {\n for (IndividualInDirectory directory : page.items()) {\n System.out.println(directory);\n }\n\n if (!page.hasNextPage()) {\n break;\n }\n\n page = page.nextPage();\n}\n```\n\n## Logging\n\nEnable logging by setting the `FINCH_LOG` environment variable to `info`:\n\n```sh\nexport FINCH_LOG=info\n```\n\nOr to `debug` for more verbose logging:\n\n```sh\nexport FINCH_LOG=debug\n```\n\nOr configure the client manually using the `logLevel` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.core.LogLevel;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .logLevel(LogLevel.INFO)\n .accessToken("My Access Token")\n .build();\n```\n\n## ProGuard and R8\n\nAlthough the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `finch-java-core` is published with a [configuration file](finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).\n\nProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.\n\n\n\n\n\n## Jackson\n\nThe SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.\n\nThe SDK throws an exception if it detects an incompatible Jackson version at runtime (e.g. if the default version was overridden in your Maven or Gradle config).\n\nIf the SDK threw an exception, but you\'re _certain_ the version is compatible, then disable the version check using the `checkJacksonVersionCompatibility` on [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) or [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt).\n\n> [!CAUTION]\n> We make no guarantee that the SDK works correctly when the Jackson version check is disabled.\n\nAlso note that there are bugs in older Jackson versions that can affect the SDK. We don\'t work around all Jackson bugs ([example](https://github.com/FasterXML/jackson-databind/issues/3240)) and expect users to upgrade Jackson for those instead.\n\n## Network options\n\n### Retries\n\nThe SDK automatically retries 2 times by default, with a short exponential backoff between requests.\n\nOnly the following error types are retried:\n- Connection errors (for example, due to a network connectivity problem)\n- 408 Request Timeout\n- 409 Conflict\n- 429 Rate Limit\n- 5xx Internal\n\nThe API may also explicitly instruct the SDK to retry or not retry a request.\n\nTo set a custom number of retries, configure the client using the `maxRetries` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .maxRetries(4)\n .accessToken("My Access Token")\n .build();\n```\n\n### Timeouts\n\nRequests time out after 1 minute by default.\n\nTo set a custom timeout, configure the method call using the `timeout` method:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\n\nHrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().timeout(Duration.ofSeconds(30)).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport java.time.Duration;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .timeout(Duration.ofSeconds(30))\n .accessToken("My Access Token")\n .build();\n```\n\n### Proxies\n\nTo route requests through a proxy, configure the client using the `proxy` method:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport java.net.InetSocketAddress;\nimport java.net.Proxy;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .proxy(new Proxy(\n Proxy.Type.HTTP, new InetSocketAddress(\n "https://example.com", 8080\n )\n ))\n .accessToken("My Access Token")\n .build();\n```\n\nIf the proxy responds with `407 Proxy Authentication Required`, supply credentials by also configuring `proxyAuthenticator`:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport com.tryfinch.api.core.http.ProxyAuthenticator;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .proxy(...)\n // Or a custom implementation of `ProxyAuthenticator`.\n .proxyAuthenticator(ProxyAuthenticator.basic("username", "password"))\n .accessToken("My Access Token")\n .build();\n```\n\n### Connection pooling\n\nTo customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\nimport java.time.Duration;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n // If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.\n .maxIdleConnections(10)\n .keepAliveDuration(Duration.ofMinutes(2))\n .accessToken("My Access Token")\n .build();\n```\n\nIf both options are unset, OkHttp\'s default connection pool settings are used.\n\n### HTTPS\n\n> [!NOTE]\n> Most applications should not call these methods, and instead use the system defaults. The defaults include\n> special optimizations that can be lost if the implementations are modified.\n\nTo configure how HTTPS connections are secured, configure the client using the `sslSocketFactory`, `trustManager`, and `hostnameVerifier` methods:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n // If `sslSocketFactory` is set, then `trustManager` must be set, and vice versa.\n .sslSocketFactory(yourSSLSocketFactory)\n .trustManager(yourTrustManager)\n .hostnameVerifier(yourHostnameVerifier)\n .accessToken("My Access Token")\n .build();\n```\n\n\n\n### Custom HTTP client\n\nThe SDK consists of three artifacts:\n- `finch-java-core`\n - Contains core SDK logic\n - Does not depend on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`FinchClient`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt), [`FinchClientAsync`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt), [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt), and [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), all of which can work with any HTTP client\n- `finch-java-client-okhttp`\n - Depends on [OkHttp](https://square.github.io/okhttp)\n - Exposes [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) and [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt), which provide a way to construct [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt) and [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), respectively, using OkHttp\n- `finch-java`\n - Depends on and exposes the APIs of both `finch-java-core` and `finch-java-client-okhttp`\n - Does not have its own logic\n\nThis structure allows replacing the SDK\'s default HTTP client without pulling in unnecessary dependencies.\n\n#### Customized [`OkHttpClient`](https://square.github.io/okhttp/3.x/okhttp/okhttp3/OkHttpClient.html)\n\n> [!TIP]\n> Try the available [network options](#network-options) before replacing the default client.\n\nTo use a customized `OkHttpClient`:\n\n1. Replace your [`finch-java` dependency](#installation) with `finch-java-core`\n2. Copy `finch-java-client-okhttp`\'s [`OkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt) class into your code and customize it\n3. Construct [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt) or [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), similarly to [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) or [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt), using your customized client\n\n### Completely custom HTTP client\n\nTo use a completely custom HTTP client:\n\n1. Replace your [`finch-java` dependency](#installation) with `finch-java-core`\n2. Write a class that implements the [`HttpClient`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt) interface\n3. Construct [`FinchClientImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt) or [`FinchClientAsyncImpl`](finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt), similarly to [`FinchOkHttpClient`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt) or [`FinchOkHttpClientAsync`](finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt), using your new client class\n\n## Undocumented API functionality\n\nThe SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API.\n\n### Parameters\n\nTo set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class:\n\n```java\nimport com.tryfinch.api.core.JsonValue;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHrisDirectoryListParams params = HrisDirectoryListParams.builder()\n .putAdditionalHeader("Secret-Header", "42")\n .putAdditionalQueryParam("secret_query_param", "42")\n .putAdditionalBodyProperty("secretProperty", JsonValue.from("42"))\n .build();\n```\n\nThese can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods.\n\nTo set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt) object to its setter:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHrisDirectoryListParams params = HrisDirectoryListParams.builder().build();\n```\n\nThe most straightforward way to create a [`JsonValue`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt) is using its `from(...)` method:\n\n```java\nimport com.tryfinch.api.core.JsonValue;\nimport java.util.List;\nimport java.util.Map;\n\n// Create primitive JSON values\nJsonValue nullValue = JsonValue.from(null);\nJsonValue booleanValue = JsonValue.from(true);\nJsonValue numberValue = JsonValue.from(42);\nJsonValue stringValue = JsonValue.from("Hello World!");\n\n// Create a JSON array value equivalent to `["Hello", "World"]`\nJsonValue arrayValue = JsonValue.from(List.of(\n "Hello", "World"\n));\n\n// Create a JSON object value equivalent to `{ "a": 1, "b": 2 }`\nJsonValue objectValue = JsonValue.from(Map.of(\n "a", 1,\n "b", 2\n));\n\n// Create an arbitrarily nested JSON equivalent to:\n// {\n// "a": [1, 2],\n// "b": [3, 4]\n// }\nJsonValue complexValue = JsonValue.from(Map.of(\n "a", List.of(\n 1, 2\n ),\n "b", List.of(\n 3, 4\n )\n));\n```\n\nNormally a `Builder` class\'s `build` method will throw [`IllegalStateException`](https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html) if any required parameter or property is unset.\n\nTo forcibly omit a required parameter or property, pass [`JsonMissing`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/Values.kt):\n\n```java\nimport com.tryfinch.api.core.JsonMissing;\nimport com.tryfinch.api.models.AccessTokenCreateParams;\nimport com.tryfinch.api.models.HrisDirectoryListParams;\n\nHrisDirectoryListParams params = AccessTokenCreateParams.builder()\n .code(JsonMissing.of())\n .build();\n```\n\n### Response properties\n\nTo access undocumented response properties, call the `_additionalProperties()` method:\n\n```java\nimport com.tryfinch.api.core.JsonValue;\nimport java.util.Map;\n\nMap additionalProperties = client.accessTokens().create(params)._additionalProperties();\nJsonValue secretPropertyValue = additionalProperties.get("secretProperty");\n\nString result = secretPropertyValue.accept(new JsonValue.Visitor<>() {\n @Override\n public String visitNull() {\n return "It\'s null!";\n }\n\n @Override\n public String visitBoolean(boolean value) {\n return "It\'s a boolean!";\n }\n\n @Override\n public String visitNumber(Number value) {\n return "It\'s a number!";\n }\n\n // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject`\n // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden\n});\n```\n\nTo access a property\'s raw JSON value, which may be undocumented, call its `_` prefixed method:\n\n```java\nimport com.tryfinch.api.core.JsonField;\nimport java.util.Optional;\n\nJsonField code = client.accessTokens().create(params)._code();\n\nif (code.isMissing()) {\n // The property is absent from the JSON response\n} else if (code.isNull()) {\n // The property was set to literal null\n} else {\n // Check if value was provided as a string\n // Other methods include `asNumber()`, `asBoolean()`, etc.\n Optional jsonString = code.asString();\n\n // Try to deserialize into a custom type\n MyClass myObject = code.asUnknown().orElseThrow().convert(MyClass.class);\n}\n```\n\n### Response validation\n\nIn rare cases, the API may return a response that doesn\'t match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else.\n\nBy default, the SDK will not throw an exception in this case. It will throw [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt) only if you directly access the property.\n\nValidating the response is _not_ forwards compatible with new types from the API for existing fields.\n\nIf you would still prefer to check that the response is completely well-typed upfront, then either call `validate()`:\n\n```java\nimport com.tryfinch.api.models.CreateAccessTokenResponse;\n\nCreateAccessTokenResponse createAccessTokenResponse = client.accessTokens().create(params).validate();\n```\n\nOr configure the method call to validate the response using the `responseValidation` method:\n\n```java\nimport com.tryfinch.api.models.HrisDirectoryListPage;\n\nHrisDirectoryListPage page = client.hris().directory().list(RequestOptions.builder().responseValidation(true).build());\n```\n\nOr configure the default for all method calls at the client level:\n\n```java\nimport com.tryfinch.api.client.FinchClient;\nimport com.tryfinch.api.client.okhttp.FinchOkHttpClient;\n\nFinchClient client = FinchOkHttpClient.builder()\n .fromEnv()\n .responseValidation(true)\n .accessToken("My Access Token")\n .build();\n```\n\n## FAQ\n\n### Why don\'t you use plain `enum` classes?\n\nJava `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value.\n\n### Why do you represent fields using `JsonField` instead of just plain `T`?\n\nUsing `JsonField` enables a few features:\n\n- Allowing usage of [undocumented API functionality](#undocumented-api-functionality)\n- Lazily [validating the API response against the expected shape](#response-validation)\n- Representing absent vs explicitly null values\n\n### Why don\'t you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)?\n\nIt is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don\'t want to introduce a breaking change every time we add a field to a class.\n\n### Why don\'t you use checked exceptions?\n\nChecked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason.\n\nChecked exceptions:\n\n- Are verbose to handle\n- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error\n- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function)\n- Don\'t play well with lambdas (also due to the function coloring problem)\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/Finch-API/finch-api-java/issues) with questions, bugs, or suggestions.\n', + '# Finch Go API Library\n\nGo Reference\n\nThe Finch Go library provides convenient access to the [Finch REST API](https://developer.tryfinch.com/)\nfrom applications written in Go.\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Installation\n\n\n\n```go\nimport (\n\t"github.com/Finch-API/finch-api-go/v2" // imported as SDK_PackageName\n)\n```\n\n\n\nOr to pin the version:\n\n\n\n```sh\ngo get -u \'github.com/Finch-API/finch-api-go/v2@v2.8.1\'\n```\n\n\n\n## Requirements\n\nThis library requires Go 1.22+.\n\n## Usage\n\nThe full API of this library can be found in [api.md](api.md).\n\n```go\npackage main\n\nimport (\n\t"context"\n\t"fmt"\n\n\t"github.com/Finch-API/finch-api-go/v2"\n\t"github.com/Finch-API/finch-api-go/v2/option"\n)\n\nfunc main() {\n\tclient := finchgo.NewClient(\n\t\toption.WithAccessToken("My Access Token"),\n\t)\n\tpage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf("%+v\\n", page)\n}\n\n```\n\n### Request fields\n\nAll request parameters are wrapped in a generic `Field` type,\nwhich we use to distinguish zero values from null or omitted fields.\n\nThis prevents accidentally sending a zero value if you forget a required parameter,\nand enables explicitly sending `null`, `false`, `\'\'`, or `0` on optional parameters.\nAny field not specified is not sent.\n\nTo construct fields with values, use the helpers `String()`, `Int()`, `Float()`, or most commonly, the generic `F[T]()`.\nTo send a null, use `Null[T]()`, and to send a nonconforming value, use `Raw[T](any)`. For example:\n\n```go\nparams := FooParams{\n\tName: SDK_PackageName.F("hello"),\n\n\t// Explicitly send `"description": null`\n\tDescription: SDK_PackageName.Null[string](),\n\n\tPoint: SDK_PackageName.F(SDK_PackageName.Point{\n\t\tX: SDK_PackageName.Int(0),\n\t\tY: SDK_PackageName.Int(1),\n\n\t\t// In cases where the API specifies a given type,\n\t\t// but you want to send something else, use `Raw`:\n\t\tZ: SDK_PackageName.Raw[int64](0.01), // sends a float\n\t}),\n}\n```\n\n### Response objects\n\nAll fields in response structs are value types (not pointers or wrappers).\n\nIf a given field is `null`, not present, or invalid, the corresponding field\nwill simply be its zero value.\n\nAll response structs also include a special `JSON` field, containing more detailed\ninformation about each property, which you can use like so:\n\n```go\nif res.Name == "" {\n\t// true if `"name"` is either not present or explicitly null\n\tres.JSON.Name.IsNull()\n\n\t// true if the `"name"` key was not present in the response JSON at all\n\tres.JSON.Name.IsMissing()\n\n\t// When the API returns data that cannot be coerced to the expected type:\n\tif res.JSON.Name.IsInvalid() {\n\t\traw := res.JSON.Name.Raw()\n\n\t\tlegacyName := struct{\n\t\t\tFirst string `json:"first"`\n\t\t\tLast string `json:"last"`\n\t\t}{}\n\t\tjson.Unmarshal([]byte(raw), &legacyName)\n\t\tname = legacyName.First + " " + legacyName.Last\n\t}\n}\n```\n\nThese `.JSON` structs also include an `Extras` map containing\nany properties in the json response that were not specified\nin the struct. This can be useful for API features not yet\npresent in the SDK.\n\n```go\nbody := res.JSON.ExtraFields["my_unexpected_field"].Raw()\n```\n\n### RequestOptions\n\nThis library uses the functional options pattern. Functions defined in the\n`SDK_PackageOptionName` package return a `RequestOption`, which is a closure that mutates a\n`RequestConfig`. These options can be supplied to the client or at individual\nrequests. For example:\n\n```go\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\t// Adds a header to every request made by the client\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "custom_header_info"),\n)\n\nclient.HRIS.Directory.List(context.TODO(), ...,\n\t// Override the header\n\tSDK_PackageOptionName.WithHeader("X-Some-Header", "some_other_custom_header_info"),\n\t// Add an undocumented field to the request body, using sjson syntax\n\tSDK_PackageOptionName.WithJSONSet("some.json.path", map[string]string{"my": "object"}),\n)\n```\n\nSee the [full list of request options](https://pkg.go.dev/github.com/Finch-API/finch-api-go/v2/SDK_PackageOptionName).\n\n### Pagination\n\nThis library provides some conveniences for working with paginated list endpoints.\n\nYou can use `.ListAutoPaging()` methods to iterate through items across all pages:\n\n```go\niter := client.HRIS.Directory.ListAutoPaging(context.TODO(), finchgo.HRISDirectoryListParams{})\n// Automatically fetches more pages as needed.\nfor iter.Next() {\n\tindividualInDirectory := iter.Current()\n\tfmt.Printf("%+v\\n", individualInDirectory)\n}\nif err := iter.Err(); err != nil {\n\tpanic(err.Error())\n}\n```\n\nOr you can use simple `.List()` methods to fetch a single page and receive a standard response object\nwith additional helper methods like `.GetNextPage()`, e.g.:\n\n```go\npage, err := client.HRIS.Directory.List(context.TODO(), finchgo.HRISDirectoryListParams{})\nfor page != nil {\n\tfor _, directory := range page.Individuals {\n\t\tfmt.Printf("%+v\\n", directory)\n\t}\n\tpage, err = page.GetNextPage()\n}\nif err != nil {\n\tpanic(err.Error())\n}\n```\n\n### Errors\n\nWhen the API returns a non-success status code, we return an error with type\n`*SDK_PackageName.Error`. This contains the `StatusCode`, `*http.Request`, and\n`*http.Response` values of the request, as well as the JSON of the error body\n(much like other response objects in the SDK).\n\nTo handle errors, we recommend that you use the `errors.As` pattern:\n\n```go\n_, err := client.HRIS.Company.Get(context.TODO(), finchgo.HRISCompanyGetParams{})\nif err != nil {\n\tvar apierr *finchgo.Error\n\tif errors.As(err, &apierr) {\n\t\tprintln(string(apierr.DumpRequest(true))) // Prints the serialized HTTP request\n\t\tprintln(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response\n\t}\n\tpanic(err.Error()) // GET "/employer/company": 400 Bad Request { ... }\n}\n```\n\nWhen other errors occur, they are returned unwrapped; for example,\nif HTTP transport fails, you might receive `*url.Error` wrapping `*net.OpError`.\n\n### Timeouts\n\nRequests do not time out by default; use context to configure a timeout for a request lifecycle.\n\nNote that if a request is [retried](#retries), the context timeout does not start over.\nTo set a per-retry timeout, use `SDK_PackageOptionName.WithRequestTimeout()`.\n\n```go\n// This sets the timeout for the request, including all the retries.\nctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)\ndefer cancel()\nclient.HRIS.Directory.List(\n\tctx,\n\tfinchgo.HRISDirectoryListParams{},\n\t// This sets the per-retry timeout\n\toption.WithRequestTimeout(20*time.Second),\n)\n```\n\n### File uploads\n\nRequest parameters that correspond to file uploads in multipart requests are typed as\n`param.Field[io.Reader]`. The contents of the `io.Reader` will by default be sent as a multipart form\npart with the file name of "anonymous_file" and content-type of "application/octet-stream".\n\nThe file name and content-type can be customized by implementing `Name() string` or `ContentType()\nstring` on the run-time type of `io.Reader`. Note that `os.File` implements `Name() string`, so a\nfile returned by `os.Open` will be sent with the file name on disk.\n\nWe also provide a helper `SDK_PackageName.FileParam(reader io.Reader, filename string, contentType string)`\nwhich can be used to wrap any `io.Reader` with the appropriate file name and content type.\n\n\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\nWe retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit,\nand >=500 Internal errors.\n\nYou can use the `WithMaxRetries` option to configure or disable this:\n\n```go\n// Configure the default for all requests:\nclient := finchgo.NewClient(\n\toption.WithMaxRetries(0), // default is 2\n)\n\n// Override per-request:\nclient.HRIS.Directory.List(\n\tcontext.TODO(),\n\tfinchgo.HRISDirectoryListParams{},\n\toption.WithMaxRetries(5),\n)\n```\n\n\n### Accessing raw response data (e.g. response headers)\n\nYou can access the raw HTTP response data by using the `option.WithResponseInto()` request option. This is useful when\nyou need to examine response headers, status codes, or other details.\n\n```go\n// Create a variable to store the HTTP response\nvar response *http.Response\npage, err := client.HRIS.Directory.List(\n\tcontext.TODO(),\n\tfinchgo.HRISDirectoryListParams{},\n\toption.WithResponseInto(&response),\n)\nif err != nil {\n\t// handle error\n}\nfmt.Printf("%+v\\n", page)\n\nfmt.Printf("Status Code: %d\\n", response.StatusCode)\nfmt.Printf("Headers: %+#v\\n", response.Header)\n```\n\n### Making custom/undocumented requests\n\nThis library is typed for convenient access to the documented API. If you need to access undocumented\nendpoints, params, or response properties, the library can still be used.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints, you can use `client.Get`, `client.Post`, and other HTTP verbs.\n`RequestOptions` on the client, such as retries, will be respected when making these requests.\n\n```go\nvar (\n // params can be an io.Reader, a []byte, an encoding/json serializable object,\n // or a "…Params" struct defined in this library.\n params map[string]interface{}\n\n // result can be an []byte, *http.Response, a encoding/json deserializable object,\n // or a model defined in this library.\n result *http.Response\n)\nerr := client.Post(context.Background(), "/unspecified", params, &result)\nif err != nil {\n …\n}\n```\n\n#### Undocumented request params\n\nTo make requests using undocumented parameters, you may use either the `SDK_PackageOptionName.WithQuerySet()`\nor the `SDK_PackageOptionName.WithJSONSet()` methods.\n\n```go\nparams := FooNewParams{\n ID: SDK_PackageName.F("id_xxxx"),\n Data: SDK_PackageName.F(FooNewParamsData{\n FirstName: SDK_PackageName.F("John"),\n }),\n}\nclient.Foo.New(context.Background(), params, SDK_PackageOptionName.WithJSONSet("data.last_name", "Doe"))\n```\n\n#### Undocumented response properties\n\nTo access undocumented response properties, you may either access the raw JSON of the response as a string\nwith `result.JSON.RawJSON()`, or get the raw JSON of a particular field on the result with\n`result.JSON.Foo.Raw()`.\n\nAny fields that are not present on the response struct will be saved and can be accessed by `result.JSON.ExtraFields()` which returns the extra fields as a `map[string]Field`.\n\n### Middleware\n\nWe provide `SDK_PackageOptionName.WithMiddleware` which applies the given\nmiddleware to requests.\n\n```go\nfunc Logger(req *http.Request, next SDK_PackageOptionName.MiddlewareNext) (res *http.Response, err error) {\n\t// Before the request\n\tstart := time.Now()\n\tLogReq(req)\n\n\t// Forward the request to the next handler\n\tres, err = next(req)\n\n\t// Handle stuff after the request\n\tend := time.Now()\n\tLogRes(res, err, start - end)\n\n return res, err\n}\n\nclient := SDK_PackageName.SDK_ClientInitializerName(\n\tSDK_PackageOptionName.WithMiddleware(Logger),\n)\n```\n\nWhen multiple middlewares are provided as variadic arguments, the middlewares\nare applied left to right. If `SDK_PackageOptionName.WithMiddleware` is given\nmultiple times, for example first in the client then the method, the\nmiddleware in the client will run first and the middleware given in the method\nwill run next.\n\nYou may also replace the default `http.Client` with\n`SDK_PackageOptionName.WithHTTPClient(client)`. Only one http client is\naccepted (this overwrites any previous client) and receives requests after any\nmiddleware has been applied.\n\n## Semantic versioning\n\nThis package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:\n\n1. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_\n2. Changes that we do not expect to impact the vast majority of users in practice.\n\nWe take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.\n\nWe are keen for your feedback; please open an [issue](https://www.github.com/Finch-API/finch-api-go/issues) with questions, bugs, or suggestions.\n\n## Contributing\n\nSee [the contributing documentation](./CONTRIBUTING.md).\n', }, { language: 'kotlin', @@ -2639,7 +2639,7 @@ const EMBEDDED_READMES: { language: string; content: string }[] = [ { language: 'ruby', content: - '# Finch Ruby API library\n\nThe Finch Ruby library provides convenient access to the Finch REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/Finch-API/finch-api-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/finch-api).\n\nThe REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/).\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n\n\n```ruby\ngem "finch-api", "~> 0.1.0.pre.alpha.56"\n```\n\n\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.directory.list\n\nputs(page.id)\n```\n\n\n\n### Pagination\n\nList methods in the Finch API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```ruby\npage = finch.hris.directory.list\n\n# Fetch single item from page.\ndirectory = page.individuals[0]\nputs(directory.id)\n\n# Automatically fetches more pages as needed.\npage.auto_paging_each do |directory|\n puts(directory.id)\nend\n```\n\nAlternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.\n\n```ruby\nif page.next_page?\n new_page = page.next_page\n puts(new_page.individuals[0].id)\nend\n```\n\n\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `FinchAPI::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n company = finch.hris.company.retrieve\nrescue FinchAPI::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue FinchAPI::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue FinchAPI::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nfinch = FinchAPI::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nfinch.hris.directory.list(request_options: {max_retries: 5})\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nfinch = FinchAPI::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nfinch.hris.directory.list(request_options: {timeout: 5})\n```\n\nOn timeout, `FinchAPI::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `FinchAPI::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\npage =\n finch.hris.directory.list(\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(page[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `FinchAPI::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `FinchAPI::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nfinch.hris.directory.list \n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nfinch.hris.directory.list\n\n# You can also splat a full Params class:\nparams = FinchAPI::HRIS::DirectoryListParams.new\nfinch.hris.directory.list(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :every_paycheck\nputs(FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK)\n\n# Revealed type: `T.all(FinchAPI::HRIS::BenefitFrequency, Symbol)`\nT.reveal_type(FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nfinch.hris.benefits.create(\n frequency: FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK,\n # …\n)\n\n# Literal values are also permissible:\nfinch.hris.benefits.create(\n frequency: :every_paycheck,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/Finch-API/finch-api-ruby/tree/main/CONTRIBUTING.md).\n', + '# Finch Ruby API library\n\nThe Finch Ruby library provides convenient access to the Finch REST API from any Ruby 3.2.0+ application. It ships with comprehensive types & docstrings in Yard, RBS, and RBI – [see below](https://github.com/Finch-API/finch-api-ruby#Sorbet) for usage with Sorbet. The standard library\'s `net/http` is used as the HTTP transport, with connection pooling via the `connection_pool` gem.\n\n\n\nIt is generated with [Stainless](https://www.stainless.com/).\n\n## MCP Server\n\nUse the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.\n\n[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)\n[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)\n\n> Note: You may need to set environment variables in your MCP client.\n\n## Documentation\n\nDocumentation for releases of this gem can be found [on RubyDoc](https://gemdocs.org/gems/finch-api).\n\nThe REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/).\n\n## Installation\n\nTo use this gem, install via Bundler by adding the following to your application\'s `Gemfile`:\n\n\n\n```ruby\ngem "finch-api", "~> 0.1.0.pre.alpha.57"\n```\n\n\n\n## Usage\n\n```ruby\nrequire "bundler/setup"\nrequire "finch_api"\n\nfinch = FinchAPI::Client.new(access_token: "My Access Token")\n\npage = finch.hris.directory.list\n\nputs(page.id)\n```\n\n\n\n### Pagination\n\nList methods in the Finch API are paginated.\n\nThis library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:\n\n```ruby\npage = finch.hris.directory.list\n\n# Fetch single item from page.\ndirectory = page.individuals[0]\nputs(directory.id)\n\n# Automatically fetches more pages as needed.\npage.auto_paging_each do |directory|\n puts(directory.id)\nend\n```\n\nAlternatively, you can use the `#next_page?` and `#next_page` methods for more granular control working with pages.\n\n```ruby\nif page.next_page?\n new_page = page.next_page\n puts(new_page.individuals[0].id)\nend\n```\n\n\n\n### Handling errors\n\nWhen the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `FinchAPI::Errors::APIError` will be thrown:\n\n```ruby\nbegin\n company = finch.hris.company.retrieve\nrescue FinchAPI::Errors::APIConnectionError => e\n puts("The server could not be reached")\n puts(e.cause) # an underlying Exception, likely raised within `net/http`\nrescue FinchAPI::Errors::RateLimitError => e\n puts("A 429 status code was received; we should back off a bit.")\nrescue FinchAPI::Errors::APIStatusError => e\n puts("Another non-200-range status code was received")\n puts(e.status)\nend\n```\n\nError codes are as follows:\n\n| Cause | Error Type |\n| ---------------- | -------------------------- |\n| HTTP 400 | `BadRequestError` |\n| HTTP 401 | `AuthenticationError` |\n| HTTP 403 | `PermissionDeniedError` |\n| HTTP 404 | `NotFoundError` |\n| HTTP 409 | `ConflictError` |\n| HTTP 422 | `UnprocessableEntityError` |\n| HTTP 429 | `RateLimitError` |\n| HTTP >= 500 | `InternalServerError` |\n| Other HTTP error | `APIStatusError` |\n| Timeout | `APITimeoutError` |\n| Network error | `APIConnectionError` |\n\n### Retries\n\nCertain errors will be automatically retried 2 times by default, with a short exponential backoff.\n\nConnection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default.\n\nYou can use the `max_retries` option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nfinch = FinchAPI::Client.new(\n max_retries: 0 # default is 2\n)\n\n# Or, configure per-request:\nfinch.hris.directory.list(request_options: {max_retries: 5})\n```\n\n### Timeouts\n\nBy default, requests will time out after 60 seconds. You can use the timeout option to configure or disable this:\n\n```ruby\n# Configure the default for all requests:\nfinch = FinchAPI::Client.new(\n timeout: nil # default is 60\n)\n\n# Or, configure per-request:\nfinch.hris.directory.list(request_options: {timeout: 5})\n```\n\nOn timeout, `FinchAPI::Errors::APITimeoutError` is raised.\n\nNote that requests that time out are retried by default.\n\n## Advanced concepts\n\n### BaseModel\n\nAll parameter and response objects inherit from `FinchAPI::Internal::Type::BaseModel`, which provides several conveniences, including:\n\n1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.\n\n2. Structural equivalence for equality; if two API calls return the same values, comparing the responses with == will return true.\n\n3. Both instances and the classes themselves can be pretty-printed.\n\n4. Helpers such as `#to_h`, `#deep_to_h`, `#to_json`, and `#to_yaml`.\n\n### Making custom or undocumented requests\n\n#### Undocumented properties\n\nYou can send undocumented parameters to any endpoint, and read undocumented response properties, like so:\n\nNote: the `extra_` parameters of the same name overrides the documented parameters.\n\n```ruby\npage =\n finch.hris.directory.list(\n request_options: {\n extra_query: {my_query_parameter: value},\n extra_body: {my_body_parameter: value},\n extra_headers: {"my-header": value}\n }\n )\n\nputs(page[:my_undocumented_property])\n```\n\n#### Undocumented request params\n\nIf you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above.\n\n#### Undocumented endpoints\n\nTo make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so:\n\n```ruby\nresponse = client.request(\n method: :post,\n path: \'/undocumented/endpoint\',\n query: {"dog": "woof"},\n headers: {"useful-header": "interesting-value"},\n body: {"hello": "world"}\n)\n```\n\n### Concurrency & connection pooling\n\nThe `FinchAPI::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.\n\nEach instance of `FinchAPI::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.\n\nWhen all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.\n\nUnless otherwise specified, other classes in the SDK do not have locks protecting their underlying data structure.\n\n## Sorbet\n\nThis library provides comprehensive [RBI](https://sorbet.org/docs/rbi) definitions, and has no dependency on sorbet-runtime.\n\nYou can provide typesafe request parameters like so:\n\n```ruby\nfinch.hris.directory.list \n```\n\nOr, equivalently:\n\n```ruby\n# Hashes work, but are not typesafe:\nfinch.hris.directory.list\n\n# You can also splat a full Params class:\nparams = FinchAPI::HRIS::DirectoryListParams.new\nfinch.hris.directory.list(**params)\n```\n\n### Enums\n\nSince this library does not depend on `sorbet-runtime`, it cannot provide [`T::Enum`](https://sorbet.org/docs/tenum) instances. Instead, we provide "tagged symbols" instead, which is always a primitive at runtime:\n\n```ruby\n# :every_paycheck\nputs(FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK)\n\n# Revealed type: `T.all(FinchAPI::HRIS::BenefitFrequency, Symbol)`\nT.reveal_type(FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK)\n```\n\nEnum parameters have a "relaxed" type, so you can either pass in enum constants or their literal value:\n\n```ruby\n# Using the enum constants preserves the tagged type information:\nfinch.hris.benefits.create(\n frequency: FinchAPI::HRIS::BenefitFrequency::EVERY_PAYCHECK,\n # …\n)\n\n# Literal values are also permissible:\nfinch.hris.benefits.create(\n frequency: :every_paycheck,\n # …\n)\n```\n\n## Versioning\n\nThis package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time.\n\nThis package considers improvements to the (non-runtime) `*.rbi` and `*.rbs` type definitions to be non-breaking changes.\n\n## Requirements\n\nRuby 3.2.0 or higher.\n\n## Contributing\n\nSee [the contributing documentation](https://github.com/Finch-API/finch-api-ruby/tree/main/CONTRIBUTING.md).\n', }, { language: 'python', diff --git a/packages/mcp-server/src/server.ts b/packages/mcp-server/src/server.ts index 02218022..28062f9d 100644 --- a/packages/mcp-server/src/server.ts +++ b/packages/mcp-server/src/server.ts @@ -29,7 +29,7 @@ export const newMcpServer = async ({ new McpServer( { name: 'tryfinch_finch_api_api', - version: '10.8.1', + version: '10.8.2', }, { instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),